/* ============================================
   Theme Switcher Panel
   ============================================ */

.theme-switcher {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.theme-switcher-toggle {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-right: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  color: var(--primary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.theme-switcher-toggle:hover {
  background: var(--bg-card-hover);
  color: var(--primary);
}

/* ---------- Tooltip (right button) ---------- */
.theme-switcher-toggle[data-tooltip] {
  position: relative;
}
.theme-switcher-toggle[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 50%;
  right: calc(100% + 12px);
  transform: translateY(-50%) translateX(6px);
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s;
  box-shadow: var(--shadow-md);
  z-index: 10000;
}
.theme-switcher-toggle[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

/* Pulsierender Glow-Effekt */
@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 0 0 0 var(--primary-glow-btn, rgba(57, 255, 20, 0));
  }
  50% {
    box-shadow: 0 0 20px 4px var(--primary-glow-btn, rgba(57, 255, 20, 0.25));
  }
}

.theme-switcher-toggle {
  animation: pulse-glow 3s ease-in-out infinite;
}

.theme-switcher-panel {
  position: absolute;
  top: 50%;
  right: 48px;
  transform: translateY(-50%) translateX(20px);
  width: 300px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-50%) translateX(0);
  transition: var(--transition);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
}

.theme-switcher-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

.theme-switcher-panel h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.theme-switcher-panel .panel-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.theme-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.theme-option {
  position: relative;
  padding: 12px;
  background: var(--bg-dark);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.theme-option:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.theme-option.active {
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--border-hover);
}

.theme-colors {
  display: flex;
  gap: 4px;
  align-items: center;
}

.theme-color-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-color-dot.bg {
  width: 14px;
  height: 14px;
}

.theme-color-dot.accent {
  width: 18px;
  height: 18px;
}

.theme-option-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
}

.theme-option.active .theme-option-name {
  color: var(--primary);
}

.theme-current {
  padding: 10px 16px;
  background: var(--border-color);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--primary);
  text-align: center;
}

.theme-current span {
  font-weight: 700;
  color: var(--primary);
}

/* Theme preview colors */
.theme-neon-green .theme-colors {
  --tc-bg: #1e293b;
  --tc-accent: #39ff14;
}
.theme-neon-green .theme-color-dot.bg {
  background: #1e293b;
}
.theme-neon-green .theme-color-dot.accent {
  background: #39ff14;
}

.theme-electric-blue .theme-colors {
  --tc-bg: #0f172a;
  --tc-accent: #3b82f6;
}
.theme-electric-blue .theme-color-dot.bg {
  background: #0f172a;
}
.theme-electric-blue .theme-color-dot.accent {
  background: #3b82f6;
}

.theme-warm-sunset .theme-colors {
  --tc-bg: #1c1917;
  --tc-accent: #f97316;
}
.theme-warm-sunset .theme-color-dot.bg {
  background: #1c1917;
}
.theme-warm-sunset .theme-color-dot.accent {
  background: #f97316;
}

.theme-rose-gold .theme-colors {
  --tc-bg: #1a1119;
  --tc-accent: #ec4899;
}
.theme-rose-gold .theme-color-dot.bg {
  background: #1a1119;
}
.theme-rose-gold .theme-color-dot.accent {
  background: #ec4899;
}

.theme-royal-purple .theme-colors {
  --tc-bg: #13102b;
  --tc-accent: #8b5cf6;
}
.theme-royal-purple .theme-color-dot.bg {
  background: #13102b;
}
.theme-royal-purple .theme-color-dot.accent {
  background: #8b5cf6;
}

.theme-ocean-deep .theme-colors {
  --tc-bg: #041a2c;
  --tc-accent: #0ea5e9;
}
.theme-ocean-deep .theme-color-dot.bg {
  background: #041a2c;
}
.theme-ocean-deep .theme-color-dot.accent {
  background: #0ea5e9;
}

.theme-matrix-dark .theme-colors {
  --tc-bg: #050a07;
  --tc-accent: #22c55e;
}
.theme-matrix-dark .theme-color-dot.bg {
  background: #050a07;
}
.theme-matrix-dark .theme-color-dot.accent {
  background: #22c55e;
}
