/* Bouton thème — app Lambert Chem */

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.theme-toggle {
  position: relative;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  font-family: inherit;
}

.theme-toggle:active {
  border-color: var(--blue);
  color: var(--blue);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon-sun,
.theme-icon-moon,
.theme-icon-auto {
  position: absolute;
  transition: opacity 0.2s, transform 0.2s;
}

.theme-icon-sun { opacity: 0; transform: scale(0.7) rotate(-30deg); }
.theme-icon-moon { opacity: 0; transform: scale(0.7) rotate(30deg); }
.theme-icon-auto { opacity: 0; transform: scale(0.7); }

[data-theme-pref="light"] .theme-toggle .theme-icon-sun,
[data-theme-pref="dark"] .theme-toggle .theme-icon-moon,
[data-theme-pref="auto"] .theme-toggle .theme-icon-auto {
  opacity: 1;
  transform: scale(1) rotate(0);
}

[data-theme-pref="auto"] .theme-toggle::after {
  content: "";
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 1px var(--card);
}
