/* ============================================================
   Wimau - Variables de thème : Clair / Sombre
   Appliqué via data-theme="light" | data-theme="dark" sur <html>
   ============================================================ */

/* ── Thème CLAIR (par défaut si préférence OS = light) ── */
[data-theme="light"] {
  color-scheme: light;

  --bg:        #F5F3EE;
  --surface:   #FFFFFF;
  --surface2:  #F0EDE6;
  --surface3:  #E8E4DC;
  --border:    #DDD9D0;
  --border-hi: #C8C4BB;

  --gold:      #A07830;
  --gold-br:   #C9A24B;
  --gold-dim:  #C9A24B18;

  --ink:       #1A1814;
  --ink-dim:   #6B6760;

  --danger:    #B0392E;
  --green:     #3D7A55;
  --warn:      #B5872A;
  --blue:      #3B6DB5;

  /* Composants spécifiques light */
  --nav-bg:       rgba(245, 243, 238, 0.92);
  --sidebar-bg:   #FFFFFF;
  --card-shadow:  0 1px 4px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
}

/* ── Thème SOMBRE ── */
[data-theme="dark"] {
  color-scheme: dark;

  --bg:        #0B0C0F;
  --surface:   #15171C;
  --surface2:  #1D2027;
  --surface3:  #252830;
  --border:    #2A2D35;
  --border-hi: #3A3F4A;

  --gold:      #C9A24B;
  --gold-br:   #E5C572;
  --gold-dim:  #C9A24B22;

  --ink:       #EDEAE3;
  --ink-dim:   #9A968C;

  --danger:    #C1554B;
  --green:     #5E9C76;
  --warn:      #D6A34A;
  --blue:      #5B8DD9;

  --nav-bg:      rgba(21, 23, 28, 0.95);
  --sidebar-bg:  #15171C;
  --card-shadow: none;
}

/* ── Base commune (utilise les variables) ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  transition: background .25s ease, color .25s ease;
}

/* Transition douce sur tous les éléments qui portent des couleurs */
*, *::before, *::after {
  transition:
    background-color .2s ease,
    border-color     .2s ease,
    color            .15s ease,
    box-shadow       .2s ease;
}
/* Exclure les animations existantes */
.fade-in, .skeleton, .animate-spin,
[class*="transition-"],
svg *, .zone-dot { transition: none !important; }
.fade-in  { animation: fadeIn .2s ease both; }
.skeleton { animation: shimmer 1.4s ease infinite; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ── Focus ── */
.ring-focus:focus {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 30%, transparent);
  border-color: var(--gold) !important;
}

/* ── Tape divider ── */
.tape-divider {
  height: 10px;
  background-image: repeating-linear-gradient(
    to right, var(--gold) 0px, var(--gold) 1px, transparent 1px, transparent 8px
  );
  background-size: 8px 100%;
  opacity: .45;
  mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
  flex-shrink: 0;
}

/* ── Bouton thème toggle ── */
.theme-toggle {
  display: flex;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 3px;
  gap: 2px;
}
.theme-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 99px;
  border: none;
  background: transparent;
  color: var(--ink-dim);
  cursor: pointer;
  font-size: 13px;
  transition: background .15s, color .15s !important;
}
.theme-btn.active {
  background: var(--gold);
  color: var(--bg);
}
.theme-btn:not(.active):hover {
  background: var(--surface3);
  color: var(--ink);
}
