/* Theme Switch Styles */

.theme-switch-wrapper {
  display: inline-block;
  vertical-align: middle;
  margin-top: 14px;
}

.theme-switch {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.theme-checkbox {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.theme-slider {
  position: relative;
  display: block;
  width: 48px;
  height: 24px;
  background: rgba(45, 27, 27, 0.8);
  border: none;
  border-radius: 12px;
  transition: all var(--transition-base);
  overflow: visible;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-slider.mobile {
  width: 54px;
  height: 28px;
  border-radius: 14px;
}

.theme-slider-button {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border: none;
  border-radius: 50%;
  transition: transform var(--transition-base);
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.theme-slider.mobile .theme-slider-button {
  width: 22px;
  height: 22px;
  top: 3px;
  left: 3px;
}

.theme-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  z-index: 1;
  transition: opacity var(--transition-base);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  line-height: 1;
}

.theme-slider.mobile .theme-icon {
  font-size: 0.85rem;
}

.theme-icon.sun {
  left: 5px;
  opacity: 1;
}

.theme-icon.moon {
  right: 5px;
  opacity: 1;
}

.theme-slider.mobile .theme-icon.sun {
  left: 7px;
}

.theme-slider.mobile .theme-icon.moon {
  right: 7px;
}

/* Dark theme state */
.theme-checkbox:checked + .theme-slider .theme-slider-button {
  transform: translateX(24px);
}

.theme-slider.mobile .theme-checkbox:checked + .theme-slider .theme-slider-button,
.theme-checkbox:checked + .theme-slider.mobile .theme-slider-button {
  transform: translateX(22px);
}

.theme-checkbox:checked + .theme-slider .theme-icon.sun {
  opacity: 1;
}

.theme-checkbox:checked + .theme-slider .theme-icon.moon {
  opacity: 1;
}

/* Hover effects */
.theme-switch:hover .theme-slider {
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 2px 8px var(--brand-red-light);
  background: rgba(35, 20, 20, 0.9);
}

.theme-switch:hover .theme-slider-button {
  background: #f8f9fa;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Active state */
.theme-checkbox:active + .theme-slider {
  transform: scale(0.95);
}

/* Focus state for accessibility */
.theme-checkbox:focus + .theme-slider {
  outline: 2px solid var(--text-secondary);
  outline-offset: 2px;
}

/* Dark theme switch styling */
[data-theme="dark"] .theme-slider {
  background: rgba(45, 27, 27, 0.8) !important;
  border: none !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="dark"] .theme-slider-button {
  background: var(--brand-red-dim) !important;
  border: none !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="dark"] .theme-switch:hover .theme-slider {
  background: rgba(35, 20, 20, 0.9) !important;
  border: none !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 2px 8px var(--brand-red-light) !important;
}

[data-theme="dark"] .theme-switch:hover .theme-slider-button {
  background: var(--brand-red-dim) !important;
  border: none !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}
