@custom-variant dark (&:is(.dark *));

:root {
  /* Couleurs principales Magellan */
  --magellan-gold: #F0B429;
  --magellan-sage: #92B0A1;
  --magellan-sage-dark: #6B8A7A;
  --magellan-gold-light: #F5C951;
  
  /* Fond d'écran - Tons chauds et naturels */
  --background: #2C2820;
  --background-gradient-start: #2C2820;
  --background-gradient-end: #4A423A;
  --background-elevated: #FFFFFF;
  --background-subtle: #4A423A;
  
  /* Textes - Couleurs claires pour fond sombre */
  --text-primary: #FFFFFF;
  --text-secondary: #E0E0E0;
  --text-muted: #B0B0B0;
  
  /* Dégradés */
  --gradient-primary: linear-gradient(135deg, var(--magellan-gold) 0%, var(--magellan-sage) 100%);
  --gradient-primary-reverse: linear-gradient(135deg, var(--magellan-sage) 0%, var(--magellan-gold) 100%);
  --gradient-gold: linear-gradient(135deg, var(--magellan-gold-light) 0%, var(--magellan-gold) 100%);
  --gradient-sage: linear-gradient(135deg, var(--magellan-sage) 0%, var(--magellan-sage-dark) 100%);
  
  /* Variables système */
  --font-size: 16px;
  --foreground: #FFFFFF;
  --card: #151515;
  --card-foreground: #FFFFFF;
  --popover: #1A1A1A;
  --popover-foreground: #FFFFFF;
  --primary: var(--magellan-gold);
  --primary-foreground: #000000;
  --secondary: var(--magellan-sage);
  --secondary-foreground: #FFFFFF;
  --muted: #2A2A2A;
  --muted-foreground: var(--text-secondary);
  --accent: var(--magellan-gold);
  --accent-foreground: #000000;
  --destructive: #EF4444;
  --destructive-foreground: #FFFFFF;
  --border: rgba(146, 176, 161, 0.2);
  --input: transparent;
  --input-background: #1A1A1A;
  --switch-background: #2A2A2A;
  --font-weight-medium: 600;
  --font-weight-normal: 400;
  --ring: var(--magellan-sage);
  --chart-1: var(--magellan-gold);
  --chart-2: var(--magellan-sage);
  --chart-3: #F5C951;
  --chart-4: #6B8A7A;
  --chart-5: #B8956A;
  --radius: 0.75rem;
  --sidebar: #0A0A0A;
  --sidebar-foreground: #FFFFFF;
  --sidebar-primary: var(--magellan-gold);
  --sidebar-primary-foreground: #000000;
  --sidebar-accent: #151515;
  --sidebar-accent-foreground: #FFFFFF;
  --sidebar-border: rgba(146, 176, 161, 0.2);
  --sidebar-ring: var(--magellan-sage);
}

.dark {
  --background: #0A0A0A;
  --foreground: #FFFFFF;
  --card: #151515;
  --card-foreground: #FFFFFF;
  --popover: #1A1A1A;
  --popover-foreground: #FFFFFF;
  --primary: var(--magellan-gold);
  --primary-foreground: #000000;
  --secondary: var(--magellan-sage);
  --secondary-foreground: #FFFFFF;
  --muted: #2A2A2A;
  --muted-foreground: var(--text-secondary);
  --accent: var(--magellan-gold);
  --accent-foreground: #000000;
  --destructive: #EF4444;
  --destructive-foreground: #FFFFFF;
  --border: rgba(146, 176, 161, 0.2);
  --input: #1A1A1A;
  --ring: var(--magellan-sage);
  --font-weight-medium: 600;
  --font-weight-normal: 400;
  --chart-1: var(--magellan-gold);
  --chart-2: var(--magellan-sage);
  --chart-3: #F5C951;
  --chart-4: #6B8A7A;
  --chart-5: #B8956A;
  --sidebar: #0A0A0A;
  --sidebar-foreground: #FFFFFF;
  --sidebar-primary: var(--magellan-gold);
  --sidebar-primary-foreground: #000000;
  --sidebar-accent: #151515;
  --sidebar-accent-foreground: #FFFFFF;
  --sidebar-border: rgba(146, 176, 161, 0.2);
  --sidebar-ring: var(--magellan-sage);
}

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-input-background: var(--input-background);
  --color-switch-background: var(--switch-background);
  --color-ring: var(--ring);
  --color-chart-1: var(--chart-1);
  --color-chart-2: var(--chart-2);
  --color-chart-3: var(--chart-3);
  --color-chart-4: var(--chart-4);
  --color-chart-5: var(--chart-5);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --color-sidebar: var(--sidebar);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-ring: var(--sidebar-ring);
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }

  body {
    @apply bg-background text-foreground;
    background-color: var(--background);
    color: var(--text-primary);
  }

  /**
  * Default typography styles for HTML elements (h1-h4, p, label, button, input).
  * These are in @layer base, so Tailwind utility classes (like text-sm, text-lg) automatically override them.
  */

  html {
    font-size: var(--font-size);
  }

  h1 {
    font-size: var(--text-2xl);
    font-weight: var(--font-weight-medium);
    line-height: 1.3;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  h2 {
    font-size: var(--text-xl);
    font-weight: var(--font-weight-medium);
    line-height: 1.4;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  h3 {
    font-size: var(--text-lg);
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
    color: var(--text-primary);
  }

  h4 {
    font-size: var(--text-base);
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
    color: var(--text-primary);
  }

  p {
    color: var(--text-secondary);
  }

  label {
    font-size: var(--text-base);
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
    color: var(--text-primary);
  }

  button {
    font-size: var(--text-base);
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
  }

  input {
    font-size: var(--text-base);
    font-weight: var(--font-weight-normal);
    line-height: 1.5;
    color: var(--text-primary);
  }
}

/* Classes utilitaires pour les dégradés */
.gradient-text-primary {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-text-gold {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-text-sage {
  background: var(--gradient-sage);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-bg-primary {
  background: var(--gradient-primary);
}

.gradient-bg-primary-reverse {
  background: var(--gradient-primary-reverse);
}

.gradient-bg-gold {
  background: var(--gradient-gold);
}

.gradient-bg-sage {
  background: var(--gradient-sage);
}
