/* ============================================
   光曦星軌 — Cyber-Luxury Theme System
   All themes are DARK — Obsidian base variants
   ============================================ */

/* ---- DEFAULT: Obsidian Gold (曜石金) ---- */
/* Already set in style.css :root */

/* ---- THEME 1: Aurora Cyan (極光青) ---- */
body.theme-arctic {
  --gold: #38BDF8;
  --gold-muted: #0EA5E9;
  --gold-dim: rgba(56, 189, 248, 0.15);
  --aurora-cyan: #00FFCC;
  --aurora-blue: #38BDF8;
  --primary-blue: #38BDF8;
  --primary-gold: #38BDF8;
  --border-glow: rgba(56, 189, 248, 0.2);
  --hero-gradient: radial-gradient(ellipse at center, rgba(56, 189, 248, 0.04) 0%, transparent 70%);
}

/* ---- THEME 2: Emerald Lux (翡翠奢華) ---- */
body.theme-sunrise {
  --gold: #34D399;
  --gold-muted: #10B981;
  --gold-dim: rgba(52, 211, 153, 0.15);
  --aurora-cyan: #6EE7B7;
  --aurora-blue: #34D399;
  --primary-blue: #34D399;
  --primary-gold: #34D399;
  --border-glow: rgba(52, 211, 153, 0.2);
  --hero-gradient: radial-gradient(ellipse at center, rgba(52, 211, 153, 0.04) 0%, transparent 70%);
}

/* ---- THEME 3: Violet Elite (紫晶精英) ---- */
body.theme-emerald {
  --gold: #A78BFA;
  --gold-muted: #8B5CF6;
  --gold-dim: rgba(167, 139, 250, 0.15);
  --aurora-cyan: #C4B5FD;
  --aurora-blue: #A78BFA;
  --primary-blue: #A78BFA;
  --primary-gold: #A78BFA;
  --border-glow: rgba(167, 139, 250, 0.2);
  --hero-gradient: radial-gradient(ellipse at center, rgba(167, 139, 250, 0.04) 0%, transparent 70%);
}

/* ============================================
   Theme Transition
   ============================================ */
body.theme-arctic,
body.theme-sunrise,
body.theme-emerald {
  transition: background 0.6s ease, color 0.4s ease;
}

/* ============================================
   Tower Page — Always Dark Immersive
   ============================================ */
.tower-page {
  --gold: #D4AF37;
  --gold-muted: #C5A059;
  --aurora-cyan: #00FFCC;
  --aurora-blue: #38BDF8;
  --primary-blue: #38BDF8;
  --primary-gold: #D4AF37;
  --bg-dark: #05070A;
  --bg-card: rgba(10, 14, 23, 0.85);
  --bg-glass: rgba(10, 14, 23, 0.85);
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --border-glow: rgba(212, 175, 55, 0.2);
  --nav-bg: rgba(5, 7, 10, 0.92);
  --footer-bg: rgba(5, 7, 10, 0.95);
  --input-bg: rgba(255, 255, 255, 0.04);
  --divider: rgba(255, 255, 255, 0.06);
  background: #05070A !important;
  color: #F1F5F9 !important;
}

.tower-page.theme-arctic,
.tower-page.theme-sunrise,
.tower-page.theme-emerald {
  --bg-dark: #05070A;
  --bg-card: rgba(10, 14, 23, 0.85);
  --bg-glass: rgba(10, 14, 23, 0.85);
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --nav-bg: rgba(5, 7, 10, 0.92);
  --footer-bg: rgba(5, 7, 10, 0.95);
}

.tower-page .nav-main {
  background: rgba(5, 7, 10, 0.92) !important;
  border-bottom-color: rgba(212, 175, 55, 0.12) !important;
}

.tower-page .tower-container {
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 42%, rgba(212, 175, 55, 0.06), transparent 30%),
    radial-gradient(circle at 15% 80%, rgba(0, 255, 204, 0.04), transparent 32%),
    linear-gradient(135deg, #05070A 0%, #0B0F17 45%, #05070A 100%) !important;
}

.tower-page .tower-container::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.2;
  background-image: linear-gradient(rgba(212, 175, 55, 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(212, 175, 55, 0.06) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, transparent, black 18%, black 82%, transparent);
  z-index: -1;
}

.tower-page .tower-floor {
  background: linear-gradient(135deg, rgba(10, 14, 23, 0.88), rgba(212, 175, 55, 0.04)) !important;
  border-color: rgba(212, 175, 55, 0.25) !important;
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.06), inset 0 0 22px rgba(212, 175, 55, 0.03);
}

.tower-page .tower-floor:hover,
.tower-page .tower-floor[style*="border-color"] {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.08), rgba(10, 14, 23, 0.88)) !important;
  border-color: var(--gold) !important;
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.3), inset 0 0 28px rgba(212, 175, 55, 0.06) !important;
}

.tower-page .tower-floor-label {
  color: var(--text-primary) !important;
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.4), 0 2px 4px rgba(0, 0, 0, 0.8);
}

.tower-page .info-panel,
.tower-page .floor-modal-content,
.tower-page .tower-control-btn {
  background: var(--glass-bg) !important;
  color: var(--text-primary) !important;
  border-color: rgba(212, 175, 55, 0.2) !important;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(16px) saturate(130%);
}

.tower-page .info-panel-content,
.tower-page .info-panel-content p,
.tower-page .info-panel-list li,
.tower-page .floor-modal-desc {
  color: var(--text-secondary) !important;
}

.tower-page .info-panel-title,
.tower-page .floor-modal-title {
  color: var(--gold) !important;
}

.tower-page .tower-control-btn {
  color: var(--text-primary) !important;
}

.tower-page .tower-control-btn:hover,
.tower-page .tower-control-btn.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-muted)) !important;
  color: #05070A !important;
  border-color: var(--gold) !important;
}

.tower-page .floor-modal {
  background: rgba(5, 7, 10, 0.85) !important;
}

.tower-page .floor-modal-close {
  background: rgba(10, 14, 23, 0.8) !important;
  border-color: rgba(212, 175, 55, 0.2) !important;
  color: var(--text-primary) !important;
}

.tower-page .section,
.tower-page .footer {
  background: #05070A !important;
  color: var(--text-primary) !important;
}

.tower-page .card {
  background: var(--glass-bg) !important;
  border-color: rgba(212, 175, 55, 0.15) !important;
  box-shadow: var(--glass-shadow);
}

@media (max-width: 768px) {
  .tower-page .tower-container { min-height: 100svh; }
  .tower-page .info-panel { background: rgba(10, 14, 23, 0.92) !important; }
}

/* ============================================
   Theme Switcher UI
   ============================================ */
.theme-switcher {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.theme-switcher-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.2);
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(12px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.theme-switcher-btn:hover {
  transform: scale(1.08);
  border-color: var(--gold);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.15);
}

.theme-switcher-btn .theme-color-ring {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--gold);
  border-right-color: var(--aurora-cyan);
  animation: themeRingSpin 3s linear infinite;
}

@keyframes themeRingSpin { to { transform: rotate(360deg); } }

.theme-switcher-label {
  background: rgba(10, 14, 23, 0.9);
  color: var(--text-primary);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(212, 175, 55, 0.15);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.theme-switcher:hover .theme-switcher-label {
  opacity: 1;
  transform: translateY(0);
}

.theme-dots { display: flex; gap: 3px; }

.theme-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.2);
  transition: all 0.3s ease;
}

.theme-dot.active { background: var(--gold); transform: scale(1.3); }

/* Transition */
body { transition: background-color 0.6s ease, color 0.4s ease; }
body * { transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease; }

/* Exclude animations */
body .tower-3d,
body .tower-3d *,
body .orbit-ring,
body .line-float-pulse { transition: none; }

@media (max-width: 768px) {
  .theme-switcher { bottom: 1rem; left: 1rem; }
  .theme-switcher-btn { width: 38px; height: 38px; font-size: 16px; }
}
