/**
 * SAW LMS Design System - CSS Variables
 * 
 * Design tokens for consistent styling across the application.
 * Supports light and dark modes via CSS custom properties.
 */

:root {
   /* ================================
       COLORS - Light Mode (Default)
       ================================ */

   /* Primary Brand Colors */
   --saw-primary: #6366f1;
   --saw-primary-hover: #4f46e5;
   --saw-primary-active: #4338ca;
   --saw-primary-subtle: #eef2ff;
   --saw-primary-rgb: 99, 102, 241;

   /* Secondary Colors */
   --saw-secondary: #64748b;
   --saw-secondary-hover: #475569;
   --saw-secondary-active: #334155;

   /* Semantic Colors */
   --saw-success: #10b981;
   --saw-success-subtle: #d1fae5;
   --saw-warning: #f59e0b;
   --saw-warning-subtle: #fef3c7;
   --saw-error: #ef4444;
   --saw-error-subtle: #fee2e2;
   --saw-info: #3b82f6;
   --saw-info-subtle: #dbeafe;

   /* Neutral Palette */
   --saw-white: #ffffff;
   --saw-gray-50: #f9fafb;
   --saw-gray-100: #f3f4f6;
   --saw-gray-200: #e5e7eb;
   --saw-gray-300: #d1d5db;
   --saw-gray-400: #9ca3af;
   --saw-gray-500: #6b7280;
   --saw-gray-600: #4b5563;
   --saw-gray-700: #374151;
   --saw-gray-800: #1f2937;
   --saw-gray-900: #111827;
   --saw-black: #000000;

   /* Surface Colors */
   --saw-surface: var(--saw-white);
   --saw-surface-elevated: var(--saw-white);
   --saw-surface-overlay: rgba(0, 0, 0, 0.5);

   /* Background Colors */
   --saw-bg: var(--saw-gray-50);
   --saw-bg-alt: var(--saw-gray-100);

   /* Border Colors */
   --saw-border: var(--saw-gray-200);
   --saw-border-focus: var(--saw-primary);

   /* Text Colors */
   --saw-text: var(--saw-gray-900);
   --saw-text-secondary: var(--saw-gray-600);
   --saw-text-tertiary: var(--saw-gray-400);
   --saw-text-inverse: var(--saw-white);
   --saw-text-link: var(--saw-primary);

   /* ================================
       TYPOGRAPHY
       ================================ */

   /* Font Families */
   --saw-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
   --saw-font-mono: 'JetBrains Mono', 'Fira Code', monospace;

   /* Font Sizes */
   --saw-text-xs: 0.75rem;
   /* 12px */
   --saw-text-sm: 0.875rem;
   /* 14px */
   --saw-text-base: 1rem;
   /* 16px */
   --saw-text-lg: 1.125rem;
   /* 18px */
   --saw-text-xl: 1.25rem;
   /* 20px */
   --saw-text-2xl: 1.5rem;
   /* 24px */
   --saw-text-3xl: 1.875rem;
   /* 30px */
   --saw-text-4xl: 2.25rem;
   /* 36px */
   --saw-text-5xl: 3rem;
   /* 48px */

   /* Line Heights */
   --saw-leading-none: 1;
   --saw-leading-tight: 1.25;
   --saw-leading-snug: 1.375;
   --saw-leading-normal: 1.5;
   --saw-leading-relaxed: 1.625;

   /* Font Weights */
   --saw-font-normal: 400;
   --saw-font-medium: 500;
   --saw-font-semibold: 600;
   --saw-font-bold: 700;

   /* ================================
       SPACING
       ================================ */
   --saw-space-0: 0;
   --saw-space-1: 0.25rem;
   /* 4px */
   --saw-space-2: 0.5rem;
   /* 8px */
   --saw-space-3: 0.75rem;
   /* 12px */
   --saw-space-4: 1rem;
   /* 16px */
   --saw-space-5: 1.25rem;
   /* 20px */
   --saw-space-6: 1.5rem;
   /* 24px */
   --saw-space-8: 2rem;
   /* 32px */
   --saw-space-10: 2.5rem;
   /* 40px */
   --saw-space-12: 3rem;
   /* 48px */
   --saw-space-16: 4rem;
   /* 64px */
   --saw-space-20: 5rem;
   /* 80px */
   --saw-space-24: 6rem;
   /* 96px */

   /* ================================
       BORDERS & SHADOWS
       ================================ */

   /* Border Radius */
   --saw-radius-none: 0;
   --saw-radius-sm: 0.25rem;
   /* 4px */
   --saw-radius: 0.5rem;
   /* 8px */
   --saw-radius-md: 0.625rem;
   /* 10px */
   --saw-radius-lg: 0.75rem;
   /* 12px */
   --saw-radius-xl: 1rem;
   /* 16px */
   --saw-radius-2xl: 1.5rem;
   /* 24px */
   --saw-radius-full: 9999px;

   /* Shadows */
   --saw-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
   --saw-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
   --saw-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
   --saw-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
   --saw-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
   --saw-shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
   --saw-shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.06);

   /* ================================
       TRANSITIONS
       ================================ */
   --saw-duration-fast: 150ms;
   --saw-duration-normal: 200ms;
   --saw-duration-slow: 300ms;
   --saw-ease-default: cubic-bezier(0.4, 0, 0.2, 1);
   --saw-ease-in: cubic-bezier(0.4, 0, 1, 1);
   --saw-ease-out: cubic-bezier(0, 0, 0.2, 1);
   --saw-ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);

   /* ================================
       Z-INDEX
       ================================ */
   --saw-z-dropdown: 100;
   --saw-z-sticky: 200;
   --saw-z-fixed: 300;
   --saw-z-modal-backdrop: 400;
   --saw-z-modal: 500;
   --saw-z-popover: 600;
   --saw-z-tooltip: 700;
   --saw-z-toast: 800;

   /* ================================
       LAYOUT
       ================================ */
   --saw-header-height: 64px;
   --saw-sidebar-width: 280px;
   --saw-sidebar-collapsed: 72px;
   --saw-container-sm: 640px;
   --saw-container-md: 768px;
   --saw-container-lg: 1024px;
   --saw-container-xl: 1600px;
   --saw-container-2xl: 1536px;
}

/* ================================
   DARK MODE
   ================================ */
[data-theme="dark"],
.saw-dark {
   /* Surface Colors */
   --saw-surface: #1e1e2e;
   --saw-surface-elevated: #2a2a3e;
   --saw-surface-overlay: rgba(0, 0, 0, 0.7);

   /* Background Colors */
   --saw-bg: #11111b;
   --saw-bg-alt: #181825;

   /* Border Colors */
   --saw-border: #313244;

   /* Text Colors */
   --saw-text: #cdd6f4;
   --saw-text-secondary: #a6adc8;
   --saw-text-tertiary: #6c7086;
   --saw-text-inverse: #11111b;

   /* Primary adjustments for dark mode */
   --saw-primary: #818cf8;
   --saw-primary-hover: #a5b4fc;
   --saw-primary-subtle: rgba(129, 140, 248, 0.15);

   /* Semantic adjustments */
   --saw-success-subtle: rgba(16, 185, 129, 0.15);
   --saw-warning-subtle: rgba(245, 158, 11, 0.15);
   --saw-error-subtle: rgba(239, 68, 68, 0.15);
   --saw-info-subtle: rgba(59, 130, 246, 0.15);

   /* Shadows need adjustment for dark mode */
   --saw-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
   --saw-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
   --saw-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
   --saw-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

/* System preference for dark mode */
@media (prefers-color-scheme: dark) {
   :root:not([data-theme="light"]) {
      --saw-surface: #1e1e2e;
      --saw-surface-elevated: #2a2a3e;
      --saw-surface-overlay: rgba(0, 0, 0, 0.7);
      --saw-bg: #11111b;
      --saw-bg-alt: #181825;
      --saw-border: #313244;
      --saw-text: #cdd6f4;
      --saw-text-secondary: #a6adc8;
      --saw-text-tertiary: #6c7086;
      --saw-text-inverse: #11111b;
      --saw-primary: #818cf8;
      --saw-primary-hover: #a5b4fc;
      --saw-primary-subtle: rgba(129, 140, 248, 0.15);
      --saw-success-subtle: rgba(16, 185, 129, 0.15);
      --saw-warning-subtle: rgba(245, 158, 11, 0.15);
      --saw-error-subtle: rgba(239, 68, 68, 0.15);
      --saw-info-subtle: rgba(59, 130, 246, 0.15);
   }
}