/* Theme Toggle Button - Cool Animated Switch */
.theme-toggle {
  position: relative;
  width: 56px;
  height: 32px;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  box-shadow: 0 2px 8px var(--shadow);
}

.theme-toggle:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px var(--shadow);
  transform: scale(1.05);
}

.theme-toggle::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border-radius: 50%;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

html.light .theme-toggle::before {
  left: calc(100% - 26px);
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.theme-toggle::after {
  content: '🌙';
  position: absolute;
  top: 50%;
  left: 8px;
  transform: translateY(-50%);
  font-size: 16px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  z-index: 1;
}

html.light .theme-toggle::after {
  opacity: 0;
  transform: translateY(-50%) scale(0);
}

.theme-toggle .sun-icon {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%) scale(0) rotate(180deg);
  font-size: 16px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  z-index: 1;
}

html.light .theme-toggle .sun-icon {
  opacity: 1;
  transform: translateY(-50%) scale(1) rotate(0deg);
}

/* Alternative: Icon-only button style */
.theme-toggle-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text);
  font-size: 18px;
  box-shadow: 0 2px 8px var(--shadow);
}

.theme-toggle-icon:hover {
  background: var(--hover-bg);
  border-color: var(--accent);
  transform: rotate(180deg) scale(1.1);
  box-shadow: 0 4px 12px var(--shadow);
}

.theme-toggle-icon i {
  transition: all 0.3s ease;
}

/* Smooth theme transition overlay effect */
html.theme-transitioning,
html.theme-transitioning * {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease !important;
}

