/* ==========================================================================
   Zeon OS - SYSTEM DESIGN SYSTEM & TOKENS
   ========================================================================== */

:root {
  /* Font Family */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;

  /* UI Style 1 - Obsidian Glass (Deep Space Dark) - DEFAULT */
  --bg-base: #090a0f;
  --bg-surface: rgba(18, 22, 34, 0.75);
  --bg-surface-solid: #121622;
  --bg-surface-elevated: rgba(28, 34, 52, 0.85);
  --bg-surface-active: rgba(45, 54, 82, 0.9);
  
  --glass-blur: blur(24px) saturate(180%);
  --glass-border: 1px solid rgba(255, 255, 255, 0.1);
  --glass-border-subtle: 1px solid rgba(255, 255, 255, 0.05);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-invert: #0f172a;

  /* Accent Colors */
  --accent-hue: 220;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-light: rgba(59, 130, 246, 0.18);
  --accent-contrast: #ffffff;
  
  /* System States */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;

  /* Elevations & Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-window: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
  --shadow-window-active: 0 25px 60px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.14);

  /* Geometry */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Layout Constants */
  --taskbar-height: 48px;
  --taskbar-dock-padding: 8px;
  --z-desktop: 1;
  --z-window-base: 10;
  --z-taskbar: 1000;
  --z-launcher: 1010;
  --z-flyout: 1020;
  --z-context-menu: 1050;
  --z-notification: 1100;
  --z-lockscreen: 2000;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);

  /* Style-specific extras */
  --window-titlebar-bg: rgba(15, 18, 28, 0.92);
  --taskbar-bg: rgba(10, 12, 20, 0.85);
  --icon-accent: #3b82f6;
  --icon-folder: #f59e0b;
  --desktop-icon-label-color: #ffffff;
  --style-corner-radius: var(--radius-md);
  --menu-bg: rgba(20, 25, 38, 0.92);
}

/* ============================================================
   UI STYLE NO. 1 — Monochrome Minimal (light desk, floating widgets)
   ============================================================ */
[data-ui-style="1"] {
  --icon-folder: #14161a;
}

/* Light Mode Overrides */
[data-theme="light"] {
  --bg-base: #e2e8f0;
  --bg-surface: rgba(255, 255, 255, 0.8);
  --bg-surface-solid: #ffffff;
  --bg-surface-elevated: rgba(241, 245, 249, 0.95);
  --bg-surface-active: rgba(226, 232, 240, 0.95);

  --glass-border: 1px solid rgba(0, 0, 0, 0.08);
  --glass-border-subtle: 1px solid rgba(0, 0, 0, 0.04);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-invert: #f8fafc;

  --window-titlebar-bg: rgba(240, 245, 255, 0.95);
  --taskbar-bg: rgba(220, 230, 245, 0.9);
  --desktop-icon-label-color: #0f172a;
  --menu-bg: rgba(248, 250, 252, 0.92);

  --shadow-window: 0 15px 35px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.08);
  --shadow-window-active: 0 20px 45px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.12);
}

/* ============================================================
   UI STYLE NO. 2 — Cinematic Dark (deep navy/charcoal, muted blue)
   Placed after the light theme so the cinematic palette always wins
   ============================================================ */
[data-ui-style="2"] {
  --bg-base: #0b0e16;
  --bg-surface: rgba(18, 21, 33, 0.76);
  --bg-surface-solid: #121521;
  --bg-surface-elevated: rgba(40, 44, 62, 0.60);
  --bg-surface-active: rgba(52, 58, 80, 0.70);

  --glass-blur: blur(16px) saturate(130%);
  --glass-border: 1px solid rgba(255, 255, 255, 0.12);
  --glass-border-subtle: 1px solid rgba(255, 255, 255, 0.06);

  --text-primary: #F5F6FA;
  --text-secondary: #B8BCC8;
  --text-muted: #9298AA;
  --text-invert: #0b0e16;

  --accent-hue: 222;
  --accent: #647DB8;
  --accent-hover: #7C93C9;
  --accent-light: rgba(100, 125, 184, 0.18);

  --window-titlebar-bg: rgba(14, 17, 27, 0.90);
  --taskbar-bg: rgba(14, 17, 27, 0.70);
  --icon-accent: #647DB8;
  --icon-folder: #f0b429;
  --desktop-icon-label-color: #F5F6FA;
  --style-corner-radius: var(--radius-sm);
  --hover-surface: rgba(255, 255, 255, 0.08);
  --menu-bg: rgba(23, 26, 40, 0.92);
}

/* ============================================================
   UI STYLE NO. 3 — Ultra-Minimal Monochrome (high-contrast dark)
   Pure white / soft muted white / mid gray, dark atmospheric
   ============================================================ */
[data-ui-style="3"] {
  --bg-base: #0a0a0b;
  --bg-surface: rgba(18, 18, 20, 0.55);
  --bg-surface-solid: #121214;
  --bg-surface-elevated: rgba(28, 28, 32, 0.60);
  --bg-surface-active: rgba(40, 40, 46, 0.70);

  --glass-blur: blur(16px) saturate(120%);
  --glass-border: 1px solid rgba(255, 255, 255, 0.12);
  --glass-border-subtle: 1px solid rgba(255, 255, 255, 0.06);

  --text-primary: #FFFFFF;
  --text-secondary: #E0E0E0;
  --text-muted: #808080;
  --text-invert: #0a0a0b;

  --accent-hue: 0;
  --accent: #ffffff;
  --accent-hover: #e0e0e0;
  --accent-light: rgba(255, 255, 255, 0.16);
  --accent-contrast: #111827;

  --window-titlebar-bg: rgba(14, 14, 16, 0.90);
  --taskbar-bg: rgba(18, 18, 20, 0.55);
  --icon-accent: #ffffff;
  --icon-folder: #e0e0e0;
  --desktop-icon-label-color: #FFFFFF;
  --style-corner-radius: var(--radius-md);
  --hover-surface: rgba(255, 255, 255, 0.08);
  --menu-bg: rgba(17, 17, 19, 0.92);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-base);
  -webkit-font-smoothing: antialiased;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}
[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Button & Input Base */
button {
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.25);
  border: var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

[data-theme="light"] input, 
[data-theme="light"] select, 
[data-theme="light"] textarea {
  background: rgba(0, 0, 0, 0.05);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}

/* Glass Surface Utility */
.glass-panel {
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
}

/* ==========================================================================
   GLOBAL BUTTONS & TOGGLES (DARK MODE: WHITE / LIGHT MODE: DARK)
   ========================================================================== */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 44px;
  height: 24px;
  margin-right: 38px;
  vertical-align: middle;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  transition: all .2s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  transition: all .2s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* Small text beside all toggle buttons showing whether the option is on or off */
.switch::after {
  content: "Off";
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
}

.switch:has(input:checked)::after,
.switch[data-state="on"]::after {
  content: "On";
}

.switch[data-state="off"]::after {
  content: "Off";
}

/* Dark Mode: White Buttons & Toggles */
[data-theme="dark"] .slider,
[data-ui-style="2"] .slider,
[data-ui-style="3"] .slider,
:root:not([data-theme="light"]) .slider {
  background-color: rgba(255, 255, 255, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

[data-theme="dark"] .slider:before,
[data-ui-style="2"] .slider:before,
[data-ui-style="3"] .slider:before,
:root:not([data-theme="light"]) .slider:before {
  background-color: #ffffff;
}

[data-theme="dark"] input:checked + .slider,
[data-ui-style="2"] input:checked + .slider,
[data-ui-style="3"] input:checked + .slider,
:root:not([data-theme="light"]) input:checked + .slider {
  background-color: #ffffff !important;
  border-color: #ffffff !important;
}

[data-theme="dark"] input:checked + .slider:before,
[data-ui-style="2"] input:checked + .slider:before,
[data-ui-style="3"] input:checked + .slider:before,
:root:not([data-theme="light"]) input:checked + .slider:before {
  background-color: #0f172a !important;
}

[data-theme="dark"] .switch::after,
[data-ui-style="2"] .switch::after,
[data-ui-style="3"] .switch::after,
:root:not([data-theme="light"]) .switch::after {
  color: #ffffff;
}

/* Light Mode: Dark Buttons & Toggles */
[data-theme="light"] .slider {
  background-color: rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(15, 23, 42, 0.3);
}

[data-theme="light"] .slider:before {
  background-color: #0f172a;
}

[data-theme="light"] input:checked + .slider {
  background-color: #0f172a !important;
  border-color: #0f172a !important;
}

[data-theme="light"] input:checked + .slider:before {
  background-color: #ffffff !important;
}

[data-theme="light"] .switch::after {
  color: #0f172a;
}
