/**
 * CSS Custom Properties - Design Tokens
 * Single source of truth for all design tokens (colors, typography, spacing)
 */

:root {
  /* ============================================
     Brand Colors - Olive/Earth Palette
     ============================================ */
  --color-primary: #556B2F;        /* Olive Green */
  --color-primary-hover: #4F6228;  /* Darker Olive */
  --color-primary-light: #6B8338;  /* Lighter Olive */
  --color-secondary: #A3B18A;      /* Sage Green */
  --color-secondary-hover: #8FA376;
  --color-accent: #F4A261;         /* Warm Orange */
  --color-accent-hover: #E76F51;   /* Terracotta */

  /* ============================================
     Surface Colors
     ============================================ */
  --color-background: #FAF9F6;     /* Off-white background */
  --color-surface: #FFFFFF;        /* White cards/surfaces */
  --color-border: #DAD7CD;         /* Soft beige border */
  --color-border-light: #E8E6E1;

  /* ============================================
     Text Colors
     ============================================ */
  --color-text-primary: #1C1C1C;   /* Near black */
  --color-text-secondary: #5F6F52; /* Muted olive */
  --color-text-muted: #9CA3AF;

  /* ============================================
     Semantic Colors
     ============================================ */
  --color-success: #588157;        /* Forest green */
  --color-warning: #E9C46A;        /* Golden yellow */
  --color-error: #D62828;          /* Red */
  --color-info: #3B82F6;           /* Blue */

  /* ============================================
     Neutral Grays
     ============================================ */
  --color-white: #FFFFFF;
  --color-button-text: #FFFFFF;   /* Global button text color */
  --color-black: #000000;
  --color-gray-50: #F9FAFB;
  --color-gray-100: #F3F4F6;
  --color-gray-200: #E5E7EB;
  --color-gray-300: #D1D5DB;
  --color-gray-400: #9CA3AF;
  --color-gray-500: #6B7280;
  --color-gray-600: #4B5563;
  --color-gray-700: #374151;
  --color-gray-800: #1F2937;
  --color-gray-900: #111827;

  /* ============================================
     Typography
     ============================================ */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-arabic: 'IBM Plex Sans Arabic', -apple-system, sans-serif;

  /* Font Sizes (Readable for general consumers) */
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px - BASE SIZE */
  --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 */
  --text-6xl: 3.75rem;   /* 60px */

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

  /* Line Heights */
  --leading-tight: 1.2;
  --leading-snug: 1.4;
  --leading-normal: 1.6;
  --leading-relaxed: 1.8;

  /* ============================================
     Spacing (8px grid)
     ============================================ */
  --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 */

  /* ============================================
     Border Radius
     ============================================ */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* ============================================
     Shadows (Subtle, professional)
     ============================================ */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --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);

  /* ============================================
     Transitions (Smooth, not distracting)
     ============================================ */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);

  /* ============================================
     Layout
     ============================================ */
  --container-max: 1280px;
  --container-padding: var(--space-4);
  --section-spacing: var(--space-6);
  --section-spacing-mobile: var(--space-4);

  /* ============================================
     Z-Index Scale
     ============================================ */
  --z-base: 1;
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* ============================================
   RTL Overrides
   ============================================ */
[dir="rtl"] {
  --font-primary: var(--font-arabic);
}

/* ============================================
   Reduced Motion (Accessibility)
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-base: 0ms;
    --transition-slow: 0ms;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
