* { margin: 0; padding: 0; box-sizing: border-box; }
html, body, #root { width: 100%; height: 100%; overflow: hidden; font-family: 'Segoe UI', -apple-system, sans-serif; user-select: none; }

:root {
  --accent: #0078d4;
  --bg-deep: #0a0a2e;
  --glass-bg: rgba(25, 25, 60, 0.72);
  --glass-border: rgba(255,255,255,0.08);
  --glass-highlight: rgba(255,255,255,0.04);
  --text-primary: #ffffff;
  --text-secondary: rgba(255,255,255,0.6);
  --taskbar-bg: rgba(15, 15, 45, 0.82);
}

/* Wallpaper */
.wallpaper {
  background: radial-gradient(ellipse at 20% 80%, #1a0a3e 0%, transparent 50%),
              radial-gradient(ellipse at 80% 20%, #0a2a4e 0%, transparent 50%),
              radial-gradient(ellipse at 50% 50%, #0d1a3a 0%, transparent 70%),
              radial-gradient(ellipse at 90% 90%, #1a0a3e 0%, transparent 40%),
              radial-gradient(ellipse at 10% 10%, #0a3a4e 0%, transparent 40%),
              linear-gradient(135deg, #060620 0%, #0a0a2e 30%, #0d1a3a 50%, #0a1e3e 70%, #080828 100%);
  background-attachment: fixed;
}

/* Glass effect */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
}

.glass-light {
  background: rgba(30, 30, 70, 0.6);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--glass-border);
}

.glass-heavy {
  background: rgba(15, 15, 50, 0.88);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid rgba(255,255,255,0.1);
}

/* Taskbar */
.taskbar {
  background: var(--taskbar-bg);
  backdrop-filter: blur(60px) saturate(200%);
  -webkit-backdrop-filter: blur(60px) saturate(200%);
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* Window animations */
@keyframes windowOpen {
  0% { opacity: 0; transform: scale(0.92) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes windowClose {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.92) translateY(10px); }
}

@keyframes windowMinimize {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.4) translateY(200px); }
}

@keyframes slideUp {
  0% { opacity: 0; transform: translateY(20px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slideDown {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(20px) scale(0.98); }
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes bootSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes bootPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@keyframes copilotGlow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(0,120,212,0.4)); }
  50% { filter: drop-shadow(0 0 20px rgba(0,120,212,0.8)); }
}

@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; }
  30% { opacity: 1; }
}

@keyframes shutdownFade {
  0% { opacity: 1; }
  40% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes notifSlide {
  0% { transform: translateX(120%); opacity: 0; }
  10% { transform: translateX(0); opacity: 1; }
  90% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(120%); opacity: 0; }
}

.window-open { animation: windowOpen 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.window-close { animation: windowClose 0.2s ease-in forwards; }
.window-minimize { animation: windowMinimize 0.3s ease-in forwards; }
.start-open { animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.start-close { animation: slideDown 0.2s ease-in forwards; }
.notif-anim { animation: notifSlide 4s ease-in-out forwards; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* Right click menu */
.ctx-menu-item:hover { background: rgba(0,120,212,0.3); }

/* Titlebar buttons */
.titlebar-btn:hover { background: rgba(255,255,255,0.1); }
.titlebar-close:hover { background: #c42b1c !important; }

/* Desktop icon */
.desktop-icon:hover { background: rgba(255,255,255,0.08); }
.desktop-icon.selected { background: rgba(0,120,212,0.25); border: 1px solid rgba(0,120,212,0.4); }

/* Taskbar icon */
.taskbar-icon { transition: all 0.15s ease; }
.taskbar-icon:hover { background: rgba(255,255,255,0.1); transform: translateY(-1px); }
.taskbar-icon:active { transform: scale(0.95); }

/* Start menu search */
.start-search:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px rgba(0,120,212,0.3); }

/* Calculator buttons */
.calc-btn { transition: all 0.1s ease; }
.calc-btn:hover { background: rgba(255,255,255,0.15); }
.calc-btn:active { transform: scale(0.95); }

/* Copilot typing dots */
.typing-dot { animation: typing 1.4s infinite; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* Terminal cursor blink */
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
.cursor-blink { animation: blink 1s step-end infinite; }

/* Mobile message */
@media (max-width: 640px) {
  .mobile-block { display: flex !important; }
  .desktop-only { display: none !important; }
}
@media (min-width: 641px) {
  .mobile-block { display: none !important; }
  .desktop-only { display: flex !important; }
}

/* Tooltip */
.tooltip-container { position: relative; }
.tooltip-container .tooltip-text { 
  visibility: hidden; opacity: 0; position: absolute; bottom: 100%; left: 50%; 
  transform: translateX(-50%); padding: 4px 10px; border-radius: 4px;
  background: rgba(30,30,60,0.95); border: 1px solid rgba(255,255,255,0.1);
  font-size: 11px; white-space: nowrap; transition: opacity 0.15s; z-index: 9999;
  margin-bottom: 8px; color: white; pointer-events: none;
}
.tooltip-container:hover .tooltip-text { visibility: visible; opacity: 1; }

/* Resize handle */
.resize-handle { position: absolute; }
.resize-handle-se { right: 0; bottom: 0; width: 12px; height: 12px; cursor: se-resize; }
.resize-handle-e { right: 0; top: 0; width: 6px; height: 100%; cursor: e-resize; }
.resize-handle-s { bottom: 0; left: 0; width: 100%; height: 6px; cursor: s-resize; }
.resize-handle-w { left: 0; top: 0; width: 6px; height: 100%; cursor: w-resize; }
.resize-handle-n { top: 0; left: 0; width: 100%; height: 6px; cursor: n-resize; }
.resize-handle-ne { right: 0; top: 0; width: 12px; height: 12px; cursor: ne-resize; }
.resize-handle-sw { left: 0; bottom: 0; width: 12px; height: 12px; cursor: sw-resize; }
.resize-handle-nw { left: 0; top: 0; width: 12px; height: 12px; cursor: nw-resize; }

/* Accent color override */
[data-accent="blue"] { --accent: #0078d4; }
[data-accent="purple"] { --accent: #7b2ff7; }
[data-accent="teal"] { --accent: #00b7c3; }
[data-accent="red"] { --accent: #e74856; }
[data-accent="green"] { --accent: #00cc6a; }
[data-accent="orange"] { --accent: #f7630c; }