/**
 * E-Visa Sri Lanka - Theme System
 *
 * Couleurs principales :
 * - Primaire (Bleu) : #0058bb
 * - Secondaire (Orange) : #ee9d1e
 *
 * Format : OKLCH (espace colorimétrique moderne, plus précis que RGB/HSL)
 * Conversion : https://oklch.com/
 *
 * Structure :
 * - Variables CSS natives (:root)
 * - Support mode sombre (.dark)
 * - Palette complète dérivée des couleurs principales
 * - Compatible Basecoat CSS
 */

:root {
  /* ===================================
     RADIUS & SPACING
     ================================== */
  --radius: 0;
  --radius-lg: 0;

  /* ===================================
     COULEURS PRINCIPALES
     ================================== */

  /* Primaire : #0058bb (Bleu institution) */
  --primary: oklch(0.466 0.161 262.52);
  --primary-pale: #50d0f7;
  --primary-dark: #002e62;
  --primary-foreground: oklch(1 0 0);
  --primary-hover: oklch(0.396 0.145 262.52);
  --primary-active: oklch(0.536 0.177 262.52);

  /* Secondaire : #ee9d1e (Orange chaleureux) */
  --secondary: oklch(0.753 0.167 73.39);
  --secondary-foreground: oklch(0.2 0.005 285.823);
  --secondary-hover: oklch(0.823 0.183 73.39);
  --secondary-active: oklch(0.683 0.151 73.39);

  /* ===================================
     BACKGROUNDS & SURFACES
     ================================== */
  --background: oklch(0.98 0.002 264.542);
  --foreground: oklch(0.2 0.005 285.823);

  --card: oklch(1 0 0);
  --card-foreground: oklch(0.2 0.005 285.823);

  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.2 0.005 285.823);

  /* ===================================
     SEMANTIC COLORS
     ================================== */

  /* Success (vert dérivé du bleu primaire) */
  --success: oklch(0.62 0.15 142.5);
  --success-foreground: oklch(1 0 0);

  /* Warning (utilise la couleur secondaire orange) */
  --warning: oklch(0.753 0.167 73.39);
  --warning-foreground: oklch(0.2 0.005 285.823);

  /* Destructive (rouge) */
  --destructive: oklch(0.577 0.245 27.325);
  --destructive-foreground: oklch(1 0 0);

  /* Info (utilise le bleu primaire plus clair) */
  --info: oklch(0.566 0.161 262.52);
  --info-foreground: oklch(1 0 0);

  /* ===================================
     UI ELEMENTS
     ================================== */

  /* Muted (neutre, basé sur le bleu primaire désaturé) */
  --muted: oklch(0.94 0.005 264.542);
  --muted-foreground: oklch(0.48 0.016 264.542);

  /* Accent (orange secondaire léger) */
  --accent: oklch(0.96 0.025 73.39);
  --accent-foreground: oklch(0.683 0.151 73.39);
  --color-accent-foreground: #000000;

  /* Border & Input */
  --border: oklch(0.88 0.008 264.542);
  --input: oklch(0.92 0.004 264.542);
  --ring: oklch(0.466 0.161 262.52); /* Primaire pour focus */

  /* ===================================
     CHARTS (dégradé bleu → orange)
     ================================== */
  --chart-1: oklch(0.466 0.161 262.52); /* Bleu primaire */
  --chart-2: oklch(0.566 0.161 262.52); /* Bleu clair */
  --chart-3: oklch(0.61 0.164 180);     /* Turquoise */
  --chart-4: oklch(0.683 0.151 100);    /* Jaune-orange */
  --chart-5: oklch(0.753 0.167 73.39);  /* Orange secondaire */

  /* ===================================
     SIDEBAR
     ================================== */
  --sidebar: oklch(0.98 0.002 264.542);
  --sidebar-foreground: oklch(0.2 0.005 285.823);
  --sidebar-primary: oklch(0.466 0.161 262.52);
  --sidebar-primary-foreground: oklch(1 0 0);
  --sidebar-accent: oklch(0.96 0.025 73.39);
  --sidebar-accent-foreground: oklch(0.683 0.151 73.39);
  --sidebar-border: oklch(0.88 0.008 264.542);
  --sidebar-ring: oklch(0.466 0.161 262.52);

  /* ===================================
     GRADIENTS (optionnel)
     ================================== */
  --gradient-primary: linear-gradient(135deg,
    oklch(0.466 0.161 262.52) 0%,
    oklch(0.566 0.161 262.52) 100%
  );

  --gradient-secondary: linear-gradient(135deg,
    oklch(0.753 0.167 73.39) 0%,
    oklch(0.823 0.183 73.39) 100%
  );

  --gradient-hero: linear-gradient(135deg,
    oklch(0.466 0.161 262.52) 0%,
    oklch(0.61 0.164 180) 50%,
    oklch(0.753 0.167 73.39) 100%
  );
}

/* ===================================
   DARK MODE
   ================================== */
.dark {
  /* Backgrounds inversés */
  --background: oklch(0.18 0.008 264.542);
  --foreground: oklch(0.98 0.002 264.542);

  --card: oklch(0.22 0.01 264.542);
  --card-foreground: oklch(0.98 0.002 264.542);

  --popover: oklch(0.22 0.01 264.542);
  --popover-foreground: oklch(0.98 0.002 264.542);

  /* Primaire : garde sa luminosité pour contraste */
  --primary: oklch(0.566 0.177 262.52);
  --primary-foreground: oklch(1 0 0);
  --primary-hover: oklch(0.636 0.193 262.52);
  --primary-active: oklch(0.496 0.161 262.52);

  /* Secondaire : augmente légèrement la luminosité */
  --secondary: oklch(0.823 0.183 73.39);
  --secondary-foreground: oklch(0.2 0.008 264.542);
  --secondary-hover: oklch(0.893 0.199 73.39);
  --secondary-active: oklch(0.753 0.167 73.39);

  /* Semantic colors (ajustés pour contraste) */
  --success: oklch(0.72 0.17 142.5);
  --success-foreground: oklch(0.18 0.008 264.542);

  --warning: oklch(0.823 0.183 73.39);
  --warning-foreground: oklch(0.18 0.008 264.542);

  --destructive: oklch(0.677 0.265 27.325);
  --destructive-foreground: oklch(1 0 0);

  --info: oklch(0.666 0.177 262.52);
  --info-foreground: oklch(0.18 0.008 264.542);

  /* UI Elements (dark) */
  --muted: oklch(0.28 0.012 264.542);
  --muted-foreground: oklch(0.65 0.02 264.542);

  --accent: oklch(0.32 0.015 264.542);
  --accent-foreground: oklch(0.823 0.183 73.39);

  --border: oklch(0.32 0.012 264.542);
  --input: oklch(0.35 0.015 264.542);
  --ring: oklch(0.566 0.177 262.52);

  /* Charts (dark mode) */
  --chart-1: oklch(0.566 0.177 262.52);
  --chart-2: oklch(0.666 0.177 262.52);
  --chart-3: oklch(0.71 0.18 180);
  --chart-4: oklch(0.783 0.167 100);
  --chart-5: oklch(0.823 0.183 73.39);

  /* Sidebar (dark) */
  --sidebar: oklch(0.22 0.01 264.542);
  --sidebar-foreground: oklch(0.98 0.002 264.542);
  --sidebar-primary: oklch(0.566 0.177 262.52);
  --sidebar-primary-foreground: oklch(1 0 0);
  --sidebar-accent: oklch(0.32 0.015 264.542);
  --sidebar-accent-foreground: oklch(0.823 0.183 73.39);
  --sidebar-border: oklch(0.32 0.012 264.542);
  --sidebar-ring: oklch(0.566 0.177 262.52);

  /* Gradients (dark mode) */
  --gradient-primary: linear-gradient(135deg,
    oklch(0.566 0.177 262.52) 0%,
    oklch(0.666 0.177 262.52) 100%
  );

  --gradient-secondary: linear-gradient(135deg,
    oklch(0.823 0.183 73.39) 0%,
    oklch(0.893 0.199 73.39) 100%
  );

  --gradient-hero: linear-gradient(135deg,
    oklch(0.566 0.177 262.52) 0%,
    oklch(0.71 0.18 180) 50%,
    oklch(0.823 0.183 73.39) 100%
  );
}

/* ===================================
   UTILITY CLASSES (optionnel)
   ================================== */

/* Backgrounds */
.bg-primary { background-color: oklch(var(--primary)); }
.bg-secondary { background-color: oklch(var(--secondary)); }
.bg-success { background-color: oklch(var(--success)); }
.bg-warning { background-color: oklch(var(--warning)); }
.bg-destructive { background-color: oklch(var(--destructive)); }
.bg-info { background-color: oklch(var(--info)); }

/* Text colors */
.text-primary { color: oklch(var(--primary)); }
.text-secondary { color: oklch(var(--secondary)); }
.text-success { color: oklch(var(--success)); }
.text-warning { color: oklch(var(--warning)); }
.text-destructive { color: oklch(var(--destructive)); }
.text-info { color: oklch(var(--info)); }

/* Borders */
.border-primary { border-color: oklch(var(--primary)); }
.border-secondary { border-color: oklch(var(--secondary)); }

/* Gradients */
.gradient-primary { background: var(--gradient-primary); }
.gradient-secondary { background: var(--gradient-secondary); }
.gradient-hero { background: var(--gradient-hero); }
