/* ==========================================================
   Syndeo Dashboard — Theme Toggle Component
   Tri-state switcher: Light / Dark / Auto
   ========================================================== */

.theme-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 2rem;
  padding: 0.25rem 0.4rem;
  height: 2rem;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.theme-switcher input[type="radio"] {
  display: none;
}

.theme-switcher label {
  cursor: pointer;
  padding: 0.3rem 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color 0.25s ease;
  position: relative;
  z-index: 1;
}

.theme-switcher input[type="radio"]:checked + label {
  color: var(--accent-color);
}

.theme-switcher label:hover {
  color: var(--accent-color);
}

/* SVG icons */
.theme-icon {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

/* Slider animation */
.theme-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(33.333% - 4px);
  height: calc(100% - 4px);
  background: var(--accent-color);
  border-radius: 1rem;
  z-index: 0;
  transition: all 0.3s ease;
  opacity: 0.2;
}

#theme-light:checked ~ .theme-slider,
#theme-mobile-light:checked ~ .theme-slider {
  transform: translateX(0);
}

#theme-dark:checked ~ .theme-slider,
#theme-mobile-dark:checked ~ .theme-slider {
  transform: translateX(100%);
}

#theme-auto:checked ~ .theme-slider,
#theme-mobile-auto:checked ~ .theme-slider {
  transform: translateX(200%);
}

/* Dark mode adjustments */
[data-theme='dark'] .theme-switcher {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

[data-theme='dark'] .theme-icon {
  filter: brightness(1.3);
}

/* Smooth theme transition */
html {
  transition: background-color 0.25s ease, color 0.25s ease;
}
