/* =============================================================================
   Design Tokens - CSS Custom Properties
   All design values are defined here for consistent, maintainable styling.
   ============================================================================= */

:root {
  /* ========== COLOR PALETTE ========== */

  /* Neutrals */
  --color-white: #ffffff;
  --color-navy: #2c3e50;
  --color-gray-dark: #555;
  --color-gray-medium: #999;
  --color-gray-light: #f5f7fa;
  --color-gray-lighter: #e9ecef;
  --color-gray-lightest: #f8f9fa;

  /* Primary Brand Color */
  --color-blue-primary: #667eea;
  --color-blue-dark: #5568d3;
  --color-blue-light: #e3f2fd;
  --color-blue-info: #0066cc;
  --color-blue-bg: #e8f4f8;

  /* Semantic Colors */
  --color-red-critical: #ff6b6b;
  --color-red-error: #e74c3c;
  --color-red-light: #ffebee;
  --color-red-dark: #c62828;
  --color-green-success: #27ae60;
  --color-amber-warning: #f39c12;

  /* ========== TEXT COLORS ========== */
  --text-primary: #2c3e50;
  --text-secondary: #555;
  --text-tertiary: #999;
  --text-light: #e0e0e0;
  --text-on-blue: #0066cc;

  /* ========== BACKGROUND COLORS ========== */
  --bg-primary: #ffffff;
  --bg-secondary: #f5f7fa;
  --bg-tertiary: #f8f9fa;
  --bg-overlay: rgba(0, 0, 0, 0.5);

  /* ========== SPACING SCALE (8px base unit) ========== */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  --spacing-3xl: 64px;

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

  /* Font Family */
  --font-family-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --font-family-mono: 'Courier New', Courier, monospace;

  /* Font Sizes */
  --font-size-h1: 2.5rem;
  --font-size-h2: 1.8rem;
  --font-size-h3: 1.4rem;
  --font-size-h4: 1.2rem;
  --font-size-body: 1rem;
  --font-size-small: 0.875rem;
  --font-size-xs: 0.75rem;
  --font-size-code: 0.9rem;

  /* Font Weights */
  --font-weight-normal: 400;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Line Heights */
  --line-height-tight: 1.2;
  --line-height-normal: 1.6;
  --line-height-loose: 1.8;

  /* ========== BORDERS & RADIUS ========== */
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --border-width-sm: 1px;
  --border-width-md: 2px;
  --border-width-lg: 5px;

  /* ========== SHADOWS ========== */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);

  /* ========== TRANSITIONS & ANIMATIONS ========== */
  --transition-duration: 0.3s;
  --transition-duration-fast: 0.15s;
  --transition-duration-slow: 0.5s;
  --transition-timing: ease;
  --transition-easing-in-out: cubic-bezier(0.4, 0, 0.2, 1);

  /* ========== RESPONSIVE BREAKPOINTS ========== */
  --breakpoint-mobile: 320px;
  --breakpoint-tablet: 768px;
  --breakpoint-desktop: 1024px;
  --breakpoint-wide: 1400px;

  /* ========== CONTAINER WIDTHS ========== */
  --container-width-mobile: 100%;
  --container-width-tablet: 100%;
  --container-width-desktop: 900px;
  --container-width-wide: 1200px;

  /* ========== SEMANTIC SPACING ========== */
  --section-padding: var(--spacing-lg);
  --section-margin: var(--spacing-xl);
  --card-padding: var(--spacing-lg);
  --component-gap: var(--spacing-md);

  /* ========== Z-INDEX LAYERS ========== */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal: 400;
  --z-tooltip: 500;
}

/* ========== DARK MODE ========== */
@media (prefers-color-scheme: dark) {
  :root {
    /* Adjust text colors for dark mode */
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-tertiary: #808080;

    /* Adjust background colors for dark mode */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2a2a2a;
    --bg-tertiary: #333333;
    --color-white: #1a1a1a;
    --color-gray-light: #2a2a2a;
    --color-gray-lighter: #333333;
    --color-gray-lightest: #404040;

    /* Adjust blue shades for dark mode */
    --color-blue-light: #1a3a5c;
    --color-blue-bg: #0d2d48;

    /* Adjust red/warning shades */
    --color-red-light: #3d0a0a;

    /* Reduced shadow intensity for dark mode */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
  }
}

/* ========== ACCESSIBILITY ========== */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-duration: 0s;
    --transition-duration-fast: 0s;
    --transition-duration-slow: 0s;
  }
}
