/* ── MODE SOMBRE ── */
:root[data-theme="dark"] {
  --bg-gradient: linear-gradient(135deg, #14142b 0%, #101f2a 50%, #0f2420 100%);
  --navy: #5468d9;
  --text-heading: #96a4f5;
  --navy-mid: #96a4f5;
  --teal: #4dd0c4;
  --purple: #b39ddb;
  --purple-light: #2a2440;
  --teal-light: #17332f;
  --white: #1c1c30;
  --text-body: #b8b8d0;
  /* En sombre, --navy vire au bleu clair : on garde un fond de barre foncé
     et bien distinct de la carte, avec texte blanc lisible. */
  --home-card-hover-bg: #3f3596;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg-gradient: linear-gradient(135deg, #14142b 0%, #101f2a 50%, #0f2420 100%);
    --navy: #5468d9;
    --text-heading: #96a4f5;
    --navy-mid: #96a4f5;
    --teal: #4dd0c4;
    --purple: #b39ddb;
    --purple-light: #2a2440;
    --teal-light: #17332f;
    --white: #1c1c30;
    --text-body: #b8b8d0;
    --home-card-hover-bg: #3f3596;
  }
}

/* ── MODE SOMBRE — surfaces "glass" non couvertes par les variables ── */
[data-theme="dark"] .app-header {
  background: rgba(20,20,40,.75);
  border-bottom-color: rgba(255,255,255,.12);
}
[data-theme="dark"] .tabs-outer {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.15);
}
[data-theme="dark"] .tab-pill:hover:not(.active) {
  background: rgba(255,255,255,.12);
}
[data-theme="dark"] .home-about-links {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.15);
}
[data-theme="dark"] .dropdown-sub-inner {
  background: rgba(255,255,255,.08);
  border-color: rgba(179,157,219,.25);
}
/* .header-brand ("MASID") est un dégradé texte figé sur des teintes claires
   (#0d1b5e → #26a69a) via -webkit-text-fill-color: transparent — invisible
   sur le fond quasi noir du header en mode sombre sans ce correctif. */
[data-theme="dark"] .header-brand {
  background: linear-gradient(135deg, #96a4f5 20%, #4dd0c4 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .app-header {
    background: rgba(20,20,40,.75);
    border-bottom-color: rgba(255,255,255,.12);
  }
  :root:not([data-theme]) .tabs-outer {
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.15);
  }
  :root:not([data-theme]) .tab-pill:hover:not(.active) {
    background: rgba(255,255,255,.12);
  }
  :root:not([data-theme]) .home-about-links {
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.15);
  }
  :root:not([data-theme]) .dropdown-sub-inner {
    background: rgba(255,255,255,.08);
    border-color: rgba(179,157,219,.25);
  }
  :root:not([data-theme]) .header-brand {
    background: linear-gradient(135deg, #96a4f5 20%, #4dd0c4 100%);
    -webkit-background-clip: text;
    background-clip: text;
  }
}

/* ── CONTRASTE ÉLEVÉ ── */
[data-contrast="high"] {
  --text-body: #1a1a2e;
}
[data-theme="dark"][data-contrast="high"] {
  --text-body: #f0f0fa;
  --white: #000000;
}
[data-contrast="high"] .app-header,
[data-contrast="high"] .dropdown-sub-inner,
[data-contrast="high"] #pwa-modal .pwa-backdrop {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
[data-contrast="high"] .app-header {
  border-bottom-width: 2px !important;
}
[data-contrast="high"] .dropdown-sub-inner {
  border-width: 2px !important;
}

