/**
 * theme-toggle.css
 * Styles pour le sélecteur de thème (auto / clair / sombre)
 * Chargé par base.html.twig ET base-landingpage.html.twig
 */

/* ── Picker 3 options (topbar landing) ── */
.theme-picker {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}

.theme-picker__opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  padding: 0;
}

.theme-picker__opt:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

.theme-picker__opt.is-active {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.theme-picker__opt .material-symbols-outlined {
  font-size: 16px;
  line-height: 1;
}

/* Variante plus compacte et discrète (dans la nav) */
.theme-picker--sm {
  padding: 2px;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.theme-picker--sm:hover {
  opacity: 1;
}
.theme-picker--sm .theme-picker__opt {
  width: 20px;
  height: 20px;
}
.theme-picker--sm .theme-picker__opt .material-symbols-outlined {
  font-size: 13px;
}

/* Mode clair — picker */
html[data-theme="light"] .theme-picker {
  background: rgba(41, 87, 255, 0.05);
  border-color: rgba(41, 87, 255, 0.18);
}

html[data-theme="light"] .theme-picker__opt {
  color: rgba(15, 23, 42, 0.4);
}

html[data-theme="light"] .theme-picker__opt:hover {
  background: rgba(41, 87, 255, 0.08);
  color: #2957FF;
}

html[data-theme="light"] .theme-picker__opt.is-active {
  background: rgba(41, 87, 255, 0.14);
  color: #2957FF;
}

/* ── Variante pour le header de l’application (fond clair) ── */
.theme-toggle--app {
  border-color: var(--border-color, #d1d7e0);
  color: var(--text-color-main, #333);
}

.theme-toggle--app:hover {
  background: var(--bg-color-hover, #e0e0e0);
  border-color: var(--main-color, #2957FF);
  color: var(--main-color, #2957FF);
}

html[data-theme="dark"] .theme-toggle--app {
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.8);
}

html[data-theme="dark"] .theme-toggle--app:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.4);
  color: white;
}

/* ── Sélecteur de thème dans les paramètres app ── */
.theme-mode-picker {
  display: inline-flex;
  gap: 6px;
}

.theme-mode-picker__opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border-color, #d1d7e0);
  background: transparent;
  color: var(--muted, #6b7280);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.theme-mode-picker__opt .material-symbols-outlined {
  font-size: 16px;
}

.theme-mode-picker__opt:hover {
  border-color: #2957FF;
  color: #2957FF;
}

.theme-mode-picker__opt.is-active {
  background: #2957FF;
  border-color: #2957FF;
  color: #ffffff;
}


/* ── Bouton ── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease,
    transform 0.15s ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.6);
  color: white;
  transform: scale(1.08);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-toggle .material-symbols-outlined {
  font-size: 20px;
  line-height: 1;
  /* Animation de rotation lors du changement */
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Affichage conditionnel des ic\u00f4nes ── */

/* En mode SOMBRE : afficher le soleil (pour passer en clair) */
html[data-theme="dark"] .theme-toggle__icon--dark { display: none; }

/* En mode CLAIR : afficher la lune (pour passer en sombre) */
html[data-theme="light"] .theme-toggle__icon--light { display: none; }

/* Par d\u00e9faut (pas de data-theme) : on suppose sombre */
html:not([data-theme="light"]) .theme-toggle__icon--dark { display: none; }

/* ── Variante pour le header de l\u2019application (fond clair) ── */
.theme-toggle--app {
  border-color: var(--border-color, #d1d7e0);
  color: var(--text-color-main, #333);
}

.theme-toggle--app:hover {
  background: var(--bg-color-hover, #e0e0e0);
  border-color: var(--main-color, #2957FF);
  color: var(--main-color, #2957FF);
}

/* Mode sombre pour le bouton app */
html[data-theme="dark"] .theme-toggle--app {
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.8);
}

html[data-theme="dark"] .theme-toggle--app:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.4);
  color: white;
}

/* ── Position du bouton dans la sidebar de l\u2019app ── */
/* Le .logo--reduit devient flex-column pour acc\u00e9der au bouton sous le logo */
.logo--reduit {
  flex-direction: column !important;
  height: auto !important;
  min-height: 80px;
  gap: 6px;
  padding-bottom: 8px !important;
}

.logo--reduit > a {
  flex: unset;
  height: auto !important;
}

.logo--reduit .theme-toggle--app {
  width: 80%;
  border-radius: 8px;
  height: 28px;
  font-size: 0;        /* cache le texte \u00e9ventuel */
  gap: 0;
}

.logo--reduit .theme-toggle--app .material-symbols-outlined {
  font-size: 18px;
}
