/* === VARIABLES DE BASE (TOKENS) === */
:root {
  /* Couleurs de base (palette) */
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-300: #93c5fd;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --blue-900: #1e3a8a;
  
  --green-50: #ecfdf5;
  --green-100: #d1fae5;
  --green-200: #a7f3d0;
  --green-300: #6ee7b7;
  --green-400: #34d399;
  --green-500: #10b981;
  --green-600: #059669;
  --green-700: #047857;
  --green-800: #065f46;
  --green-900: #064e3b;
  
  --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;
  
  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-200: #fecaca;
  --red-300: #fca5a5;
  --red-400: #f87171;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --red-700: #b91c1c;
  --red-800: #991b1b;
  --red-900: #7f1d1d;
  
  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-200: #fde68a;
  --amber-300: #fcd34d;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-700: #b45309;
  --amber-800: #92400e;
  --amber-900: #78350f;
  
  /* Spacing et autres valeurs qui ne changent pas avec le thème */
  --spacing-0: 0;
  --spacing-px: 1px;
  --spacing-1: 0.25rem;     /* 4px */
  --spacing-2: 0.5rem;      /* 8px */
  --spacing-3: 0.75rem;     /* 12px */
  --spacing-4: 1rem;        /* 16px */
  --spacing-6: 1.5rem;      /* 24px */
  --spacing-8: 2rem;        /* 32px */
  --spacing-12: 3rem;       /* 48px */
  --spacing-16: 4rem;       /* 64px */
  
  /* Polices */
  --font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  
  /* Border radius */
  --border-radius-sm: 0.125rem;
  --border-radius: 0.25rem;
  --border-radius-md: 0.375rem;
  --border-radius-lg: 0.5rem;
  --border-radius-full: 9999px;
}

/* === THÈME CLAIR (DÉFAUT) === */
:root {
  /* Sémantique des couleurs */
  --color-primary: var(--blue-600);
  --color-primary-hover: var(--blue-700);
  --color-primary-light: var(--blue-100);
  
  --color-success: var(--green-600);
  --color-success-hover: var(--green-700);
  --color-success-light: var(--green-100);
  
  --color-warning: var(--amber-500);
  --color-warning-hover: var(--amber-600);
  --color-warning-light: var(--amber-100);
  
  --color-error: var(--red-600);
  --color-error-hover: var(--red-700);
  --color-error-light: var(--red-100);
  
  /* Couleurs d'interface */
  --color-background: var(--gray-50);
  --color-background-subtle: var(--gray-100);
  --color-background-muted: var(--gray-200);
  --color-surface: white;
  
  /* Texte */
  --color-text: var(--gray-900);
  --color-text-muted: var(--gray-600);
  --color-text-disabled: var(--gray-400);
  
  /* Bordures */
  --color-border: var(--gray-200);
  --color-border-focus: var(--blue-500);
  
  /* États interactifs */
  --color-hover: rgba(0, 0, 0, 0.04);
  --color-focus-ring: rgba(59, 130, 246, 0.5);
  
  /* Ombres */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 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);
}

/* === THÈME SOMBRE === */
@media (prefers-color-scheme: dark) {
  :root {
    /* Sémantique des couleurs */
    --color-primary: var(--blue-500);
    --color-primary-hover: var(--blue-400);
    --color-primary-light: var(--blue-900);
    
    --color-success: var(--green-500);
    --color-success-hover: var(--green-400);
    --color-success-light: var(--green-900);
    
    --color-warning: var(--amber-400);
    --color-warning-hover: var(--amber-300);
    --color-warning-light: var(--amber-900);
    
    --color-error: var(--red-500);
    --color-error-hover: var(--red-400);
    --color-error-light: var(--red-900);
    
    /* Couleurs d'interface */
    --color-background: var(--gray-900);
    --color-background-subtle: var(--gray-800);
    --color-background-muted: var(--gray-700);
    --color-surface: var(--gray-800);
    
    /* Texte */
    --color-text: var(--gray-50);
    --color-text-muted: var(--gray-400);
    --color-text-disabled: var(--gray-600);
    
    /* Bordures */
    --color-border: var(--gray-700);
    --color-border-focus: var(--blue-400);
    
    /* États interactifs */
    --color-hover: rgba(255, 255, 255, 0.06);
    --color-focus-ring: rgba(59, 130, 246, 0.5);
    
    /* Ombres */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
  }
}

/* === CLASSE POUR FORCER LE THÈME SOMBRE === */
.dark-theme {
  /* Sémantique des couleurs */
  --color-primary: var(--blue-500);
  --color-primary-hover: var(--blue-400);
  --color-primary-light: var(--blue-900);
  
  --color-success: var(--green-500);
  --color-success-hover: var(--green-400);
  --color-success-light: var(--green-900);
  
  --color-warning: var(--amber-400);
  --color-warning-hover: var(--amber-300);
  --color-warning-light: var(--amber-900);
  
  --color-error: var(--red-500);
  --color-error-hover: var(--red-400);
  --color-error-light: var(--red-900);
  
  /* Couleurs d'interface */
  --color-background: var(--gray-900);
  --color-background-subtle: var(--gray-800);
  --color-background-muted: var(--gray-700);
  --color-surface: var(--gray-800);
  
  /* Texte */
  --color-text: var(--gray-50);
  --color-text-muted: var(--gray-400);
  --color-text-disabled: var(--gray-600);
  
  /* Bordures */
  --color-border: var(--gray-700);
  --color-border-focus: var(--blue-400);
  
  /* États interactifs */
  --color-hover: rgba(255, 255, 255, 0.06);
  --color-focus-ring: rgba(59, 130, 246, 0.5);
  
  /* Ombres */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
}