/**
 * Design Tokens
 * Modern CSS Design System with Custom Properties
 * Following cutting-edge practices for maintainability and theming
 */

:root {
  /* ==================== COLOR TOKENS ==================== */

  /* Brand Colors - EmpowerAgile Identity */
  --color-brand-primary: #1A355E;       /* Dark Navy Blue */
  --color-brand-secondary: #2A4A7C;     /* Lighter Navy */
  --color-brand-accent: #FFBD03;        /* Golden Yellow/Orange */
  --color-brand-accent-hover: #FFD54F;  /* Lighter accent */

  /* Semantic Colors - Light Mode */
  --color-surface-primary: oklch(100% 0 0);
  --color-surface-secondary: oklch(98% 0.005 265);
  --color-surface-tertiary: oklch(95% 0.01 265);
  --color-surface-elevated: oklch(100% 0 0);

  --color-text-primary: oklch(25% 0.02 265);
  --color-text-secondary: oklch(45% 0.02 265);
  --color-text-tertiary: oklch(60% 0.02 265);
  --color-text-inverse: oklch(100% 0 0);

  --color-border-subtle: oklch(90% 0.01 265);
  --color-border-default: oklch(85% 0.02 265);
  --color-border-strong: oklch(70% 0.03 265);

  /* Feedback Colors */
  --color-success: oklch(65% 0.15 145);
  --color-warning: oklch(75% 0.15 85);
  --color-error: oklch(60% 0.18 25);
  --color-info: oklch(65% 0.15 235);

  /* ==================== TYPOGRAPHY TOKENS ==================== */

  /* Font Families */
  --font-family-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-family-display: 'Inter', system-ui, sans-serif;
  --font-family-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Font Sizes - Fluid Typography */
  --font-size-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --font-size-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --font-size-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
  --font-size-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);
  --font-size-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
  --font-size-2xl: clamp(1.5rem, 1.3rem + 1vw, 1.875rem);
  --font-size-3xl: clamp(1.875rem, 1.6rem + 1.375vw, 2.25rem);
  --font-size-4xl: clamp(2.25rem, 1.9rem + 1.75vw, 3rem);
  --font-size-5xl: clamp(3rem, 2.4rem + 3vw, 4rem);

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

  /* Line Heights */
  --line-height-tight: 1.2;
  --line-height-snug: 1.375;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 1.875;

  /* Letter Spacing */
  --letter-spacing-tight: -0.025em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.025em;
  --letter-spacing-wider: 0.05em;

  /* ==================== SPACING TOKENS ==================== */

  /* Spacing Scale - Based on 0.25rem (4px) */
  --space-0: 0;
  --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-8: 2rem;       /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */
  --space-20: 5rem;      /* 80px */
  --space-24: 6rem;      /* 96px */
  --space-32: 8rem;      /* 128px */
  --space-40: 10rem;     /* 160px */
  --space-48: 12rem;     /* 192px */

  /* Fluid Spacing */
  --space-section: clamp(4rem, 8vw, 8rem);
  --space-content: clamp(2rem, 4vw, 4rem);

  /* ==================== LAYOUT TOKENS ==================== */

  /* Container Widths */
  --container-xs: 20rem;    /* 320px */
  --container-sm: 40rem;    /* 640px */
  --container-md: 48rem;    /* 768px */
  --container-lg: 64rem;    /* 1024px */
  --container-xl: 80rem;    /* 1280px */
  --container-2xl: 96rem;   /* 1536px */

  /* Grid */
  --grid-gap: var(--space-6);
  --grid-columns: 12;

  /* ==================== BORDER TOKENS ==================== */

  /* Border Widths */
  --border-width-thin: 1px;
  --border-width-default: 2px;
  --border-width-thick: 4px;

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* ==================== SHADOW TOKENS ==================== */

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

  /* ==================== ANIMATION TOKENS ==================== */

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

  /* Easing Functions */
  --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);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* ==================== Z-INDEX TOKENS ==================== */

  --z-index-base: 0;
  --z-index-dropdown: 100;
  --z-index-sticky: 200;
  --z-index-fixed: 300;
  --z-index-modal-backdrop: 400;
  --z-index-modal: 500;
  --z-index-popover: 600;
  --z-index-tooltip: 700;

  /* ==================== BREAKPOINT TOKENS ==================== */

  /* Used in CSS @container and @media queries */
  --breakpoint-sm: 40rem;    /* 640px */
  --breakpoint-md: 48rem;    /* 768px */
  --breakpoint-lg: 64rem;    /* 1024px */
  --breakpoint-xl: 80rem;    /* 1280px */
  --breakpoint-2xl: 96rem;   /* 1536px */
}

/* ==================== DARK MODE TOKENS ==================== */

[data-theme="dark"] {
  /* Surfaces */
  --color-surface-primary: oklch(20% 0.02 265);
  --color-surface-secondary: oklch(22% 0.02 265);
  --color-surface-tertiary: oklch(25% 0.02 265);
  --color-surface-elevated: oklch(25% 0.02 265);

  /* Text */
  --color-text-primary: oklch(95% 0.01 265);
  --color-text-secondary: oklch(75% 0.02 265);
  --color-text-tertiary: oklch(60% 0.02 265);
  --color-text-inverse: oklch(20% 0.02 265);

  /* Borders */
  --color-border-subtle: oklch(30% 0.02 265);
  --color-border-default: oklch(40% 0.02 265);
  --color-border-strong: oklch(50% 0.03 265);

  /* Brand Colors - Adjusted for dark mode */
  --color-brand-primary: #4A7BA7;       /* Lighter Navy for dark mode */
  --color-brand-secondary: #5A8BB7;     /* Even lighter */
  --color-brand-accent: #FFD54F;        /* Lighter golden for dark mode */
  --color-brand-accent-hover: #FFBD03;  /* Original accent */

  /* Shadows - Darker in dark mode */
  --shadow-sm: 0 1px 2px 0 oklch(0% 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px oklch(0% 0 0 / 0.4),
               0 2px 4px -1px oklch(0% 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px oklch(0% 0 0 / 0.4),
               0 4px 6px -2px oklch(0% 0 0 / 0.3);
  --shadow-xl: 0 20px 25px -5px oklch(0% 0 0 / 0.5),
               0 10px 10px -5px oklch(0% 0 0 / 0.4);
  --shadow-2xl: 0 25px 50px -12px oklch(0% 0 0 / 0.6);
}

/* ==================== PREFERS REDUCED MOTION ==================== */

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-instant: 0ms;
    --duration-fast: 0ms;
    --duration-normal: 0ms;
    --duration-slow: 0ms;
    --duration-slower: 0ms;
  }
}

/* ==================== HIGH CONTRAST MODE ==================== */

@media (prefers-contrast: high) {
  :root {
    --color-border-default: oklch(50% 0.05 265);
    --color-border-strong: oklch(30% 0.05 265);
  }

  [data-theme="dark"] {
    --color-border-default: oklch(70% 0.05 265);
    --color-border-strong: oklch(90% 0.05 265);
  }
}
