/* ========================================
   Design Tokens - CSS Variables
   ======================================== */

:root {
  /* ========================================
     Color Palette
     ======================================== */

  /* Base Colors */
  --white: #ffffff;
  --black: #000000;

  /* Primary Colors (Indigo) */
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;
  --primary-300: #a5b4fc;
  --primary-400: #818cf8;
  --primary-500: #6366f1;
  --primary-600: #4f46e5;
  --primary-700: #4338ca;
  --primary-800: #3730a3;
  --primary-900: #312e81;

  /* Legacy color mappings (for backward compatibility) */
  --primary-color: var(--primary-500);
  --primary-dark: var(--primary-600);
  --primary-light: var(--primary-400);

  /* Accent Colors (VTuber vibrancy) */
  --accent-pink: #ec4899;
  --accent-purple: #a855f7;
  --accent-cyan: #06b6d4;
  --accent-yellow: #fbbf24;

  /* Semantic Colors */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;

  /* Neutral Colors (Grayscale) */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Text Colors */
  --text-color: var(--gray-800);
  --text-secondary: var(--gray-500);
  --text-tertiary: var(--gray-400);
  --text-muted: var(--gray-500);
  --text-inverse: var(--white);

  /* Background Colors */
  --bg-color: var(--gray-50);
  --bg-white: var(--white);
  --bg-secondary: var(--gray-100);
  --bg-hover: var(--gray-50);
  --bg-dark: var(--gray-900);

  /* Border Colors */
  --border-color: var(--gray-200);
  --border-dark: var(--gray-300);
  --border-light: var(--gray-100);

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

  /* Type Scale (Major Third: 1.250) */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */
  --text-5xl: 3rem;        /* 48px */

  /* Font Weights */
  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;

  /* Line Heights */
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;

  /* Letter Spacing */
  --tracking-tighter: -0.05em;
  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;

  /* ========================================
     Spacing Scale (4px base)
     ======================================== */

  --space-0: 0;
  --space-px: 1px;
  --space-0_5: 0.125rem;   /* 2px */
  --space-1: 0.25rem;      /* 4px */
  --space-2: 0.5rem;       /* 8px */
  --space-3: 0.75rem;      /* 12px */
  --space-4: 1rem;         /* 16px */
  --space-5: 1.25rem;      /* 20px */
  --space-6: 1.5rem;       /* 24px */
  --space-7: 1.75rem;      /* 28px */
  --space-8: 2rem;         /* 32px */
  --space-9: 2.25rem;      /* 36px */
  --space-10: 2.5rem;      /* 40px */
  --space-11: 2.75rem;     /* 44px */
  --space-12: 3rem;        /* 48px */
  --space-14: 3.5rem;      /* 56px */
  --space-16: 4rem;        /* 64px */
  --space-20: 5rem;        /* 80px */
  --space-24: 6rem;        /* 96px */
  --space-28: 7rem;        /* 112px */
  --space-32: 8rem;        /* 128px */

  /* ========================================
     Shadows & Elevation
     ======================================== */

  /* Standard Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);

  /* Colored Shadows (for emphasis) */
  --shadow-primary: 0 10px 15px -3px rgba(99, 102, 241, 0.2);
  --shadow-accent: 0 10px 15px -3px rgba(236, 72, 153, 0.2);
  --shadow-error: 0 10px 15px -3px rgba(239, 68, 68, 0.2);
  --shadow-success: 0 10px 15px -3px rgba(16, 185, 129, 0.2);

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

  --radius-none: 0;
  --radius-sm: 0.125rem;   /* 2px */
  --radius-base: 0.25rem;  /* 4px */
  --radius-md: 0.375rem;   /* 6px */
  --radius-lg: 0.5rem;     /* 8px */
  --radius-xl: 0.75rem;    /* 12px */
  --radius-2xl: 1rem;      /* 16px */
  --radius-3xl: 1.5rem;    /* 24px */
  --radius-full: 9999px;

  /* Legacy radius mapping */
  --border-radius: var(--radius-lg);

  /* ========================================
     Transitions & Animations
     ======================================== */

  /* Timing Functions */
  --ease-linear: linear;
  --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);

  /* Transition Durations */
  --duration-75: 75ms;
  --duration-100: 100ms;
  --duration-150: 150ms;
  --duration-200: 200ms;
  --duration-300: 300ms;
  --duration-500: 500ms;
  --duration-700: 700ms;
  --duration-1000: 1000ms;

  /* Composite Transitions */
  --transition-fast: var(--duration-150) var(--ease-in-out);
  --transition-base: var(--duration-300) var(--ease-in-out);
  --transition-slow: var(--duration-500) var(--ease-in-out);
  --transition-all: all var(--duration-300) var(--ease-in-out);

  /* Legacy transition mapping */
  --transition: var(--transition-all);

  /* ========================================
     Breakpoints (for reference in JS)
     ======================================== */

  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;

  /* ========================================
     Z-Index Scale
     ======================================== */

  --z-0: 0;
  --z-10: 10;
  --z-20: 20;
  --z-30: 30;
  --z-40: 40;
  --z-50: 50;
  --z-auto: auto;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
}

/* ========================================
   Dark Mode Theme
   ======================================== */

[data-theme="dark"] {
  /* Dark mode color palette */

  /* Text Colors */
  --text-color: var(--gray-100);
  --text-secondary: var(--gray-400);
  --text-tertiary: var(--gray-500);
  --text-muted: var(--gray-400);
  --text-inverse: var(--white);

  /* Background Colors */
  --bg-color: var(--gray-900);
  --bg-white: var(--gray-800);
  --bg-secondary: var(--gray-700);
  --bg-hover: var(--gray-700);
  --bg-dark: var(--gray-950, #030712);

  /* Border Colors */
  --border-color: var(--gray-700);
  --border-dark: var(--gray-600);
  --border-light: var(--gray-800);

  /* Shadows - darker for dark mode */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.5);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.4);

  /* Colored shadows for dark mode */
  --shadow-primary: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
  --shadow-accent: 0 10px 15px -3px rgba(236, 72, 153, 0.4);
  --shadow-error: 0 10px 15px -3px rgba(239, 68, 68, 0.4);
  --shadow-success: 0 10px 15px -3px rgba(16, 185, 129, 0.4);
}
