/* ============================================
   Design System Variables
   Apple HIG-inspired design tokens
   ============================================ */

:root {
  /* ==================== Colors ==================== */

  /* Background layers (Dark theme - default) */
  --bg-primary: #1c1c1e;
  --bg-secondary: #2c2c2e;
  --bg-tertiary: #3a3a3c;
  --bg-quaternary: #48484a;

  /* Glass effects */
  --glass-light: rgba(255, 255, 255, 0.1);
  --glass-medium: rgba(255, 255, 255, 0.15);
  --glass-dark: rgba(0, 0, 0, 0.3);
  --glass-darker: rgba(0, 0, 0, 0.5);

  /* Text colors */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-tertiary: rgba(255, 255, 255, 0.5);
  --text-disabled: rgba(255, 255, 255, 0.3);

  /* Accent colors */
  --accent-blue: #007aff;
  --accent-blue-hover: #0051d5;
  --accent-blue-active: #004bb8;

  /* Semantic colors */
  --success: #34c759;
  --success-hover: #2fb350;
  --warning: #ff9f0a;
  --warning-hover: #ff8f00;
  --error: #ff3b30;
  --error-hover: #ff2d1f;

  /* UI element colors */
  --border-light: rgba(255, 255, 255, 0.1);
  --border-medium: rgba(255, 255, 255, 0.2);
  --separator: rgba(255, 255, 255, 0.08);

  /* ==================== Shadows ==================== */

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.24);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.36);
  --shadow-xl: 0 30px 60px rgba(0, 0, 0, 0.48);

  /* Window-specific shadows */
  --shadow-window: 0 20px 60px rgba(0, 0, 0, 0.5);
  --shadow-window-active: 0 30px 80px rgba(0, 0, 0, 0.6);

  /* ==================== Blur ==================== */

  --blur-sm: blur(10px);
  --blur-md: blur(20px);
  --blur-lg: blur(30px);
  --blur-xl: blur(40px);

  /* ==================== Typography ==================== */

  /* Font family - Apple system fonts */
  --font-system: -apple-system, BlinkMacSystemFont,
                 "SF Pro Display", "SF Pro Text",
                 "Helvetica Neue", Arial, sans-serif;

  --font-mono: "SF Mono", Monaco, "Cascadia Code",
               "Roboto Mono", Consolas, monospace;

  /* Font sizes */
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 32px;
  --text-4xl: 48px;

  /* Font weights */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Line heights */
  --leading-tight: 1.2;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;

  /* Letter spacing */
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.02em;

  /* ==================== Spacing ==================== */

  /* Based on 4px/8px scale */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* ==================== Border Radius ==================== */

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* ==================== Animation ==================== */

  /* Durations */
  --duration-instant: 100ms;
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 350ms;
  --duration-slower: 500ms;

  /* Easing curves */
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1); /* Bounce effect */
  --ease-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);

  /* ==================== Layout ==================== */

  /* Z-index layers */
  --z-desktop: 1;
  --z-window-base: 100;
  --z-menubar: 900;
  --z-dock: 950;
  --z-context-menu: 980;
  --z-spotlight: 990;
  --z-notification: 1000;
  --z-boot: 9999;

  /* Component dimensions */
  --menubar-height: 28px;
  --dock-height: 68px;
  --dock-icon-size: 52px;
  --window-titlebar-height: 40px;
  --window-min-width: 320px;
  --window-min-height: 200px;

  /* ==================== Backdrop ==================== */

  /* Glassmorphic backdrop filters */
  --backdrop-menubar: blur(20px) saturate(180%);
  --backdrop-dock: blur(30px) saturate(200%);
  --backdrop-window: blur(40px) saturate(180%);
  --backdrop-modal: blur(20px) saturate(150%);
}

/* ============================================
   Light Theme Variables
   ============================================ */

[data-theme="light"] {
  /* Background layers */
  --bg-primary: #f5f5f7;
  --bg-secondary: #ffffff;
  --bg-tertiary: #fafafa;
  --bg-quaternary: #e5e5e7;

  /* Glass effects */
  --glass-light: rgba(255, 255, 255, 0.7);
  --glass-medium: rgba(255, 255, 255, 0.8);
  --glass-dark: rgba(0, 0, 0, 0.05);
  --glass-darker: rgba(0, 0, 0, 0.1);

  /* Text colors */
  --text-primary: #1d1d1f;
  --text-secondary: rgba(0, 0, 0, 0.7);
  --text-tertiary: rgba(0, 0, 0, 0.5);
  --text-disabled: rgba(0, 0, 0, 0.3);

  /* UI element colors */
  --border-light: rgba(0, 0, 0, 0.1);
  --border-medium: rgba(0, 0, 0, 0.2);
  --separator: rgba(0, 0, 0, 0.08);

  /* Shadows (lighter in light mode) */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 30px 60px rgba(0, 0, 0, 0.20);
  --shadow-window: 0 20px 60px rgba(0, 0, 0, 0.2);
  --shadow-window-active: 0 30px 80px rgba(0, 0, 0, 0.25);
}
