/* ============================================
   THEME SWITCHER — Top-right toggle + dropdown
   ============================================ */

.theme-switcher {
  position: fixed;
  top: 30px;
  right: 30px;
  z-index: 9999;
  font-family: 'Inter', -apple-system, sans-serif;
}

.theme-switcher-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card, rgba(30, 41, 59, 0.5));
  border: 1px solid var(--border-color, rgba(255,255,255,0.1));
  color: var(--text-primary, #f8fafc);
  width: 50px;
  height: 50px;
  padding: 0;
  border-radius: var(--radius-xl, 1rem);
  cursor: pointer;
  font-size: 1.2rem;
  font-family: inherit;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.25s ease;
}

.theme-switcher-btn:hover {
  border-color: var(--primary, #3b82f6);
  color: #fff;
  background: var(--primary, #3b82f6);
}

.theme-switcher-btn i {
  font-size: 1.2rem;
}

.theme-switcher-btn .switcher-label {
  display: none;
}

/* Dropdown panel */
.theme-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: var(--bg-secondary, #1e293b);
  border: 1px solid var(--border-color, rgba(255,255,255,0.1));
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.96);
  transition: all 0.2s ease;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.theme-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.theme-dropdown-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted, #64748b);
  padding: 6px 10px 4px;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: var(--text-primary, #f8fafc);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  transition: all 0.15s ease;
}

.theme-option:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.08);
}

.theme-option.active {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

.theme-option-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.theme-option-icon.icon-classic {
  background: linear-gradient(135deg, #3b82f6, #0ea5e9);
  color: white;
}

.theme-option-icon.icon-lethal {
  background: #0a0a0a;
  border: 1px solid #33ff33;
  color: #33ff33;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  font-size: 13px;
}

.theme-option-icon.icon-minimal {
  background: #f5f0e8;
  border: 1px solid #8b4049;
  color: #8b4049;
}

.theme-option-icon.icon-swiss {
  background: #fafafa;
  border: 1px solid #111;
  color: #c4a35a;
}

.theme-option-text {
  flex: 1;
  min-width: 0;
}

.theme-option-name {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
}

.theme-option-desc {
  font-size: 11px;
  color: var(--text-muted, #64748b);
  line-height: 1.3;
  margin-top: 1px;
}

.theme-option-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.badge-new {
  background: rgba(51, 255, 51, 0.12);
  color: #33ff33;
}

/* Theme-aware switcher styles */
body.theme-ui-classic .theme-switcher-btn {
  background: var(--bg-glass, rgba(255, 255, 255, 0.06));
  border-color: var(--border-color, rgba(255,255,255,0.1));
  color: var(--text-primary, #f8fafc);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.theme-ui-classic .theme-switcher-btn:hover {
  background: var(--primary, #3b82f6);
  border-color: var(--primary, #3b82f6);
  color: #fff;
}

body.theme-ui-lethal .theme-switcher {
  top: 16px;
  right: 16px;
  font-family: 'Share Tech Mono', 'Courier New', monospace;
}

body.theme-ui-lethal .theme-switcher-btn {
  background: rgba(10, 10, 10, 0.95);
  border-color: #33ff33;
  color: #33ff33;
  border-radius: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 0 14px rgba(51, 255, 51, 0.15);
}

body.theme-ui-lethal .theme-switcher-btn:hover {
  background: #112211;
  border-color: #66ff66;
  color: #66ff66;
}

body.theme-ui-lethal .theme-dropdown {
  background: rgba(8, 15, 8, 0.97);
  border-color: #1a8c1a;
  border-radius: 0;
  box-shadow: 0 0 18px rgba(51, 255, 51, 0.12);
}

body.theme-ui-lethal .theme-dropdown-title,
body.theme-ui-lethal .theme-option-desc {
  color: #1a8c1a;
}

body.theme-ui-lethal .theme-option {
  color: #33ff33;
  border-radius: 0;
}

body.theme-ui-lethal .theme-option:hover,
body.theme-ui-lethal .theme-option.active {
  background: rgba(51, 255, 51, 0.1);
  border-color: #1a8c1a;
}

body.theme-ui-minimal .theme-switcher {
  font-family: 'IBM Plex Serif', Georgia, serif;
  top: 48px;
  right: 12px;
}

body.theme-ui-minimal .theme-switcher-btn {
  background: rgba(248, 243, 230, 0.95);
  border-color: rgba(49, 42, 32, 0.32);
  color: #19150f;
  border-radius: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.theme-ui-minimal .theme-switcher-btn:hover {
  background: #19150f;
  border-color: #19150f;
  color: #f4edde;
}

body.theme-ui-minimal .theme-dropdown {
  border-radius: 0;
  background: rgba(245, 238, 223, 0.98);
  border-color: rgba(49, 42, 32, 0.35);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.theme-ui-minimal .theme-dropdown-title,
body.theme-ui-minimal .theme-option-desc {
  color: #4a4136;
}

body.theme-ui-minimal .theme-option {
  color: #19150f;
  border-radius: 0;
}

body.theme-ui-minimal .theme-option:hover,
body.theme-ui-minimal .theme-option.active {
  background: rgba(25, 21, 15, 0.08);
  border-color: rgba(25, 21, 15, 0.2);
}

/* Swiss theme switcher — positioned in main content area (sidebar is 115px) */
body.theme-ui-swiss .theme-switcher {
  font-family: 'Inter', -apple-system, sans-serif;
  top: 16px;
  right: 16px;
}

body.theme-ui-swiss .theme-switcher-btn {
  background: #222;
  border-color: #333;
  color: #fff;
  border-radius: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.theme-ui-swiss .theme-switcher-btn:hover {
  background: #e53935;
  border-color: #e53935;
  color: #fff;
}

body.theme-ui-swiss .theme-dropdown {
  border-radius: 0;
  background: #1a1a1a;
  border-color: #333;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.theme-ui-swiss .theme-dropdown-title,
body.theme-ui-swiss .theme-option-desc {
  color: #666;
}

body.theme-ui-swiss .theme-option {
  color: #fff;
  border-radius: 0;
}

body.theme-ui-swiss .theme-option:hover,
body.theme-ui-swiss .theme-option.active {
  background: rgba(229, 57, 53, 0.12);
  border-color: rgba(229, 57, 53, 0.3);
}

/* Light mode adaptations */
body.light-mode.theme-ui-classic .theme-switcher-btn {
  background: var(--bg-glass, rgba(255, 255, 255, 0.8));
  border-color: rgba(0,0,0,0.1);
  color: var(--text-primary, #0f172a);
}

body.light-mode.theme-ui-classic .theme-switcher-btn:hover {
  background: var(--primary, #3b82f6);
  color: #fff;
}

body.light-mode.theme-ui-classic .theme-dropdown {
  background: #fff;
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

body.light-mode.theme-ui-classic .theme-option:hover {
  background: rgba(0,0,0,0.04);
}

body.light-mode.theme-ui-classic .theme-option.active {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.2);
}

/* Mobile */
@media (max-width: 768px) {
  .theme-switcher {
    right: 20px;
    top: 20px;
  }

  .theme-switcher-btn {
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }

  .theme-switcher-btn i {
    font-size: 1rem;
  }

  .theme-dropdown {
    width: 230px;
    right: 0;
  }

  body.theme-ui-minimal .theme-switcher {
    top: 48px;
    right: 10px;
  }

  /* Swiss on mobile: sidebar collapses to top bar (44px), so switcher goes below */
  body.theme-ui-swiss .theme-switcher {
    top: 50px;
    right: 10px;
  }
}
