﻿/* ============================================================
   Gadgets & Desktop Features
   ============================================================ */

/* Context Menu */
#context-menu {
  position: absolute; display: none; z-index: var(--z-context-menu);
  background: #f0f0f0; border: 1px solid #999;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
  padding: 2px; border-radius: 2px;
  min-width: 150px; font-family: 'Segoe UI', Tahoma, sans-serif; font-size: 12px;
}
.context-item { padding: 4px 16px; cursor: pointer; color: #000; }
.context-item:hover { background: #316ac5; color: #fff; }
.context-separator { height: 1px; background: #ccc; margin: 2px 0; }

/* Gadgets Sidebar */
#gadgets-sidebar {
  position: absolute; right: 20px; top: 20px; bottom: 60px;
  width: 180px; z-index: var(--z-desktop);
  display: flex; flex-direction: column; gap: 20px;
  pointer-events: none; /* Only gadgets are clickable */
}

.gadget-item {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.2), inset 0 1px rgba(255,255,255,0.6);
  padding: 10px; pointer-events: auto;
  text-align: center; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  font-family: 'Segoe UI', sans-serif; position: relative;
}

/* Clock Gadget */
.clock-face {
  width: 100px; height: 100px; margin: 0 auto;
  border-radius: 50%; border: 3px solid rgba(255,255,255,0.8);
  background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, rgba(200,200,200,0.6) 100%);
  position: relative; box-shadow: inset 0 2px 5px rgba(0,0,0,0.3);
}
.clock-center {
  position: absolute; top: 46px; left: 46px; width: 8px; height: 8px;
  border-radius: 50%; background: #333; z-index: 10;
}
.clock-hand {
  position: absolute; bottom: 50%; left: 49%;
  background: #333; transform-origin: bottom center;
  border-radius: 4px;
}
.clock-hour { width: 4px; height: 25px; left: 48px; background: #000; }
.clock-min { width: 3px; height: 35px; left: 48.5px; background: #222; }
.clock-sec { width: 2px; height: 40px; left: 49px; background: red; z-index: 5; }

/* Weather Gadget */
.weather-icon { font-size: 36px; line-height: 1; margin-bottom: 5px; }
.weather-temp { font-size: 24px; font-weight: bold; }
.weather-loc { font-size: 12px; opacity: 0.8; }

/* CPU Gadget */
.cpu-title { font-size: 12px; font-weight: bold; margin-bottom: 8px; text-transform: uppercase; }
.cpu-bar-container {
  height: 10px; background: rgba(0,0,0,0.5); border-radius: 5px;
  overflow: hidden; border: 1px solid rgba(255,255,255,0.3);
  position: relative;
}
.cpu-bar-fill {
  height: 100%; width: 14%; background: linear-gradient(90deg, #4caf50, #8bc34a);
  transition: width 0.3s ease;
}
.cpu-val { font-size: 14px; margin-top: 5px; font-weight: bold; }

/* Wallpaper Picker Modal */
#wallpaper-picker {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: #f0f0f0; border: 1px solid #777; border-radius: 6px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.5); z-index: 99999;
  width: 400px; max-width: 90vw; overflow: hidden;
}
.wp-header {
  background: linear-gradient(180deg, #e6f0fa 0%, #c3d9f1 100%);
  padding: 8px 12px; font-family: 'Segoe UI', sans-serif; font-size: 14px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid #aaa;
}
.wp-close { cursor: pointer; color: #a00; font-weight: bold; font-size: 16px; }
.wp-body { padding: 12px; }
.wp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.wp-thumb {
  width: 100%; aspect-ratio: 16/9; object-fit: cover; cursor: pointer;
  border: 2px solid transparent; border-radius: 4px; transition: 0.2s;
}
.wp-thumb:hover { border-color: #316ac5; transform: scale(1.05); }

