/* ── Theme toggle switch — always loaded (works in both light & dark) ──────── */

.theme-switch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin-left: 0.75em;
  vertical-align: middle;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  text-decoration: none !important;
}

/* Track (the pill) */
.theme-track {
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: 14px;
  background: #30363d;
  transition: background 0.35s ease;
  flex-shrink: 0;
}

/* Knob (the sliding circle) */
.theme-knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #58a6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #0d1117;
  transition: left 0.35s ease, background 0.35s ease, color 0.35s ease;
  pointer-events: none;
}

/* ── Dark mode state (knob right, moon icon) ──────────────────────────────── */
.theme-switch.is-dark .theme-track {
  background: #1f2937;
}

.theme-switch.is-dark .theme-knob {
  left: 28px;
  background: #8b949e;
  color: #0d1117;
}

/* ── Light mode state (knob left, sun icon) ───────────────────────────────── */
.theme-switch.is-light .theme-track {
  background: #fde68a;
}

.theme-switch.is-light .theme-knob {
  left: 4px;
  background: #f59e0b;
  color: #ffffff;
}

/* Remove any focus ring from main.css on the label */
.theme-switch:focus,
.theme-switch:focus-within {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}
