/* =============================================
   MASTER 272 — Theme Switch (pill slider)
   ============================================= */

.theme-switch {
  position: relative;
  width: 52px;
  height: 26px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.3s ease, border-color 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.theme-switch:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.28);
}

.theme-switch:focus-visible {
  box-shadow: 0 0 0 2px rgba(77, 163, 255, 0.5);
}

/* Thumb */
.theme-switch__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 1;
}

/* Icons inside the pill */
.theme-switch__icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.75;
  color: #fff;
}

/* Dark mode (default): thumb LEFT → moon icon on RIGHT */
.theme-switch__icon--moon { right: 5px; display: block; }
.theme-switch__icon--sun  { left: 5px;  display: none;  }

/* ===== LIGHT STATE ===== */
html.theme-light .theme-switch {
  background: rgba(47, 68, 134, 0.12);
  border-color: rgba(47, 68, 134, 0.25);
}

html.theme-light .theme-switch:hover {
  background: rgba(47, 68, 134, 0.18);
  border-color: rgba(47, 68, 134, 0.35);
}

html.theme-light .theme-switch__thumb {
  transform: translateX(26px);
  background: #2f4486;
  box-shadow: 0 1px 4px rgba(47, 68, 134, 0.35);
}

/* Light mode: thumb RIGHT → sun icon on LEFT */
html.theme-light .theme-switch__icon--moon { display: none;  }
html.theme-light .theme-switch__icon--sun  { display: block; color: #2f4486; opacity: 0.85; }
