/**
 * Custom Theme Toggle Button Styling
 */

:root {
  --theme-toggle-dark: var(--dark-primary);
  --theme-toggle-height: 38px;
  --theme-toggle-width: 76px;
  --theme-toggle-padding: 4px;
  --theme-toggle-thumb-size: 30px;
}

.custom-theme-toggle {
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.toggle-track {
  position: relative;
  display: inline-block;
  width: var(--theme-toggle-width);
  height: var(--theme-toggle-height);
  border-radius: calc(var(--theme-toggle-height) / 2);
  background-color: var(--theme-toggle-dark);
  box-shadow: var(--shadow-2);
  padding: var(--theme-toggle-padding);
}

.toggle-text {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--theme-toggle-dark);
  font-weight: bold;
  font-size: 14px;
  opacity: 0;
  z-index: 1;
  transition: opacity 0.3s ease;
}

[data-theme="dark"] .toggle-text {
  opacity: 1;
}

.toggle-icon {
  position: absolute;
  top: 47%;
  transform: translateY(-50%);
  z-index: 1;
}

.toggle-icon.light {
  right: 10px;
}

.toggle-icon.dark {
  left: 10px;
}

.toggle-icon .icon {
  width: 20px;
  height: 20px;
  fill: var(--white);
}

.toggle-thumb {
  position: absolute;
  width: var(--theme-toggle-thumb-size);
  height: var(--theme-toggle-thumb-size);
  background-color: var(--white);
  border-radius: 50%;
  top: 47%;
  transform: translateY(-50%);
  left: var(--theme-toggle-padding);
  transition: transform 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .toggle-thumb {
  transform: translate(calc(var(--theme-toggle-width) - var(--theme-toggle-padding) * 2 - var(--theme-toggle-thumb-size)), -50%);
}

/* Hide default theme icons when using custom toggle */
.custom-theme-toggle .toggle-icon.light .icon {
  fill: var(--white);
}

.custom-theme-toggle .toggle-icon.dark .icon {
  fill: var(--white);
}

[data-theme="light"] .toggle-icon.dark,
[data-theme="dark"] .toggle-icon.light {
  opacity: 0;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  :root {
    --theme-toggle-width: 60px;
    --theme-toggle-height: 32px;
    --theme-toggle-thumb-size: 24px;
  }
  
  .toggle-text {
    font-size: 12px;
    left: 8px;
  }
  
  .toggle-icon .icon {
    width: 16px;
    height: 16px;
  }
  
  .toggle-icon.light {
    right: 8px;
  }
  
  .toggle-icon.dark {
    left: 8px;
  }
} 