/* ============================================================
   GALAXY BACKGROUND + AUDIO PLAYER
   Kakkamvelly Sreekrishna Temple
   ============================================================ */

/* ══════════════════════════════════════════════
   GALAXY CANVAS — full page deep space
══════════════════════════════════════════════ */
#galaxy-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
}

/* Page base — deep space dark */
body {
  background: #020008 !important;
}

/* Override section backgrounds to be translucent over galaxy */
.section-light {
  background: rgba(253, 246, 227, 0.88) !important;
  backdrop-filter: blur(2px);
}
.section-saffron {
  background: linear-gradient(135deg,
    rgba(255,243,224,0.92) 0%,
    rgba(255,248,236,0.90) 100%) !important;
  backdrop-filter: blur(2px);
}
.section-dark {
  background: linear-gradient(135deg,
    rgba(10,0,30,0.96) 0%,
    rgba(26,18,8,0.97) 100%) !important;
}

/* Live section, Baby krishna, donate — keep dark with galaxy showing */
#live-section,
#baby-krishna,
#donate {
  background: rgba(8,4,25,0.93) !important;
  backdrop-filter: blur(4px);
}

/* Visitor info section */
#visitor-info {
  background: rgba(253,240,208,0.90) !important;
  backdrop-filter: blur(2px);
}

/* Annadhanam / Kulam */
.annadhanam-banner {
  background: rgba(26,6,32,0.95) !important;
}
.kulam-banner {
  background: rgba(0,16,40,0.95) !important;
}

/* Hero — let galaxy show through */
.hero {
  background: transparent !important;
  position: relative;
}
.hero::before {
  background: linear-gradient(160deg,
    rgba(80,0,0,0.6) 0%,
    rgba(10,0,40,0.4) 40%,
    rgba(0,20,10,0.5) 100%) !important;
}

/* Nebula glow orbs behind hero */
.galaxy-nebula {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  filter: blur(80px);
  animation: nebula-drift ease-in-out infinite;
}
.galaxy-nebula-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(120,0,80,0.35) 0%, transparent 70%);
  top: -100px; left: -100px;
  animation-duration: 20s;
}
.galaxy-nebula-2 {
  width: 600px; height: 400px;
  background: radial-gradient(circle, rgba(0,40,120,0.3) 0%, transparent 70%);
  top: 30%; right: -150px;
  animation-duration: 25s;
  animation-delay: -8s;
}
.galaxy-nebula-3 {
  width: 400px; height: 500px;
  background: radial-gradient(circle, rgba(60,0,100,0.25) 0%, transparent 70%);
  bottom: 10%; left: 20%;
  animation-duration: 18s;
  animation-delay: -12s;
}

@keyframes nebula-drift {
  0%,100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(30px,-20px) scale(1.08); }
  66%      { transform: translate(-20px,30px) scale(0.95); }
}

/* Shooting star trail */
.shooting-star {
  position: fixed;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: shoot linear forwards;
}
@keyframes shoot {
  0%   { transform: translate(0,0) scaleX(1);      opacity: 1; }
  100% { transform: translate(600px,300px) scaleX(80); opacity: 0; }
}

/* ══════════════════════════════════════════════
   AUDIO TOGGLE BUTTON
══════════════════════════════════════════════ */
#audio-toggle {
  position: fixed;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px) + 60px);
  right: 1.1rem;
  z-index: 850;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,215,0,0.35);
  background: rgba(10,4,28,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  -webkit-tap-highlight-color: transparent;
}
#audio-toggle:hover {
  border-color: rgba(255,215,0,0.7);
  box-shadow: 0 0 16px rgba(255,215,0,0.3);
  transform: scale(1.05);
}
#audio-toggle:active { transform: scale(0.95); }

.audio-icon  {
  font-size: 1.1rem;
  line-height: 1;
  transition: all 0.3s;
}
.audio-label {
  font-family: 'Noto Serif Malayalam', serif;
  font-size: 0.5rem;
  color: rgba(255,215,0,0.7);
  letter-spacing: 0.04em;
}

/* Playing state */
#audio-toggle.playing {
  border-color: rgba(255,215,0,0.6);
  background: rgba(255,215,0,0.12);
  animation: audio-pulse 2s ease-in-out infinite;
}
#audio-toggle.playing .audio-icon {
  animation: note-bounce 0.6s ease-in-out infinite alternate;
}
@keyframes audio-pulse {
  0%,100% { box-shadow: 0 0 8px rgba(255,215,0,0.3); }
  50%      { box-shadow: 0 0 20px rgba(255,215,0,0.6), 0 0 40px rgba(255,165,0,0.2); }
}
@keyframes note-bounce {
  from { transform: scale(1) rotate(-5deg); }
  to   { transform: scale(1.2) rotate(5deg); }
}

/* Muted state */
#audio-toggle.muted .audio-icon::after {
  content: '🔇';
  position: absolute;
  font-size: 0.8rem;
}

/* ══════════════════════════════════════════════
   LANGUAGE SWITCHER — 2 options only
══════════════════════════════════════════════ */
.lang-switcher {
  gap: 2px;
  padding: 3px 5px;
}
.lang-btn {
  font-size: 0.72rem;
  padding: 3px 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* ══════════════════════════════════════════════
   MOBILE ADJUSTMENTS
══════════════════════════════════════════════ */
@media (max-width: 768px) {
  #audio-toggle {
    width: 44px;
    height: 44px;
    bottom: calc(76px + env(safe-area-inset-bottom,0px) + 56px);
    right: 0.9rem;
  }
  .audio-icon { font-size: 1rem; }

  .galaxy-nebula-1 { width: 300px; height: 300px; }
  .galaxy-nebula-2 { width: 250px; height: 300px; }
  .galaxy-nebula-3 { display: none; }
}

/* ══════════════════════════════════════════════
   REDUCED MOTION
══════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .galaxy-nebula,
  .shooting-star { animation: none; }
  #audio-toggle.playing { animation: none; }
}

/* ══════════════════════════════════════════════
   IN-DRAWER LANGUAGE SWITCHER (mobile)
   Architect recommendation: inside nav drawer
══════════════════════════════════════════════ */
.nav-lang-item {
  padding: 0.6rem 0.4rem 0.8rem !important;
  border-bottom: none !important;
}
.nav-lang-switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,215,0,0.06);
  border: 1px solid rgba(255,215,0,0.18);
  border-radius: 12px;
  padding: 0.6rem 1rem;
}
.nav-lang-label {
  font-size: 0.78rem;
  color: rgba(255,215,0,0.7);
  font-family: 'Lato', sans-serif;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.nav-lang-btns {
  display: flex;
  gap: 4px;
  background: rgba(0,0,0,0.3);
  border-radius: 20px;
  padding: 3px;
}
.nav-lang-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 0.78rem;
  font-weight: 700;
  font-family: 'Noto Serif Malayalam', serif;
  padding: 4px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
  -webkit-tap-highlight-color: transparent;
}
.nav-lang-btn.active {
  background: linear-gradient(135deg, #c8860a, #ffd700);
  color: #1a0800;
  box-shadow: 0 2px 8px rgba(255,180,0,0.4);
}
.nav-lang-btn:hover:not(.active) {
  color: rgba(255,215,0,0.8);
  background: rgba(255,215,0,0.1);
}

/* Divider after lang item */
.nav-divider {
  height: 1px;
  background: rgba(255,215,0,0.1);
  margin: 0.2rem 0.4rem 0.4rem;
  list-style: none;
}

/* Desktop: keep floating switcher, hide in-drawer lang item */
@media (min-width: 769px) {
  .nav-lang-item,
  .nav-divider { display: none !important; }
}

/* Mobile: hide floating lang switcher (it's in drawer now) */
@media (max-width: 768px) {
  .lang-switcher { display: none !important; }
}

/* ══════════════════════════════════════════════
   NAV LANGUAGE PILL — replaces hamburger
   Full language names: മലയാളം / English
══════════════════════════════════════════════ */
.nav-lang-pill {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,215,0,0.25);
  border-radius: 50px;
  padding: 3px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  flex-shrink: 0;
}

.nlp-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Noto Serif Malayalam', serif;
  font-size: clamp(0.68rem, 2vw, 0.8rem);
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  padding: 5px 12px;
  border-radius: 50px;
  transition: all 0.25s ease;
  letter-spacing: 0.02em;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.2;
}
.nlp-btn:hover {
  color: rgba(255,215,0,0.85);
}
.nlp-btn.active {
  background: linear-gradient(135deg, #c8860a, #ffd700);
  color: #1a0800;
  box-shadow: 0 2px 10px rgba(255,180,0,0.45);
}
.nlp-btn:active { transform: scale(0.95); }

/* Mobile — slightly smaller */
@media (max-width: 480px) {
  .nlp-btn { padding: 5px 9px; font-size: 0.72rem; }
  .nav-lang-pill { padding: 2px; }
}

/* Hide old floating lang-switcher everywhere */
.lang-switcher { display: none !important; }

/* ══════════════════════════════════════════════
   AUDIO TOGGLE — highlighted playing state
   Much more visible when music is on
══════════════════════════════════════════════ */
#audio-toggle {
  position: fixed;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px) + 64px);
  right: 1.1rem;
  z-index: 850;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid rgba(255,215,0,0.2);
  background: rgba(10,4,28,0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  -webkit-tap-highlight-color: transparent;
}

/* PLAYING — very visible golden glow */
#audio-toggle.playing {
  background: linear-gradient(135deg, rgba(200,100,0,0.6), rgba(255,215,0,0.2));
  border-color: #ffd700;
  border-width: 2px;
  box-shadow:
    0 0 0 4px rgba(255,215,0,0.15),
    0 0 20px rgba(255,180,0,0.5),
    0 0 40px rgba(255,140,0,0.2);
  animation: audio-glow-ring 2s ease-in-out infinite;
}
@keyframes audio-glow-ring {
  0%,100% {
    box-shadow:
      0 0 0 4px rgba(255,215,0,0.15),
      0 0 20px rgba(255,180,0,0.5),
      0 0 40px rgba(255,140,0,0.2);
  }
  50% {
    box-shadow:
      0 0 0 8px rgba(255,215,0,0.2),
      0 0 30px rgba(255,180,0,0.7),
      0 0 60px rgba(255,140,0,0.3);
  }
}

/* Playing — note icon bounces */
#audio-toggle.playing .audio-icon {
  animation: note-dance 0.5s ease-in-out infinite alternate;
  color: #ffd700;
  filter: drop-shadow(0 0 6px rgba(255,215,0,0.8));
}
@keyframes note-dance {
  from { transform: scale(1) rotate(-8deg) translateY(0); }
  to   { transform: scale(1.3) rotate(8deg) translateY(-2px); }
}

/* Paused — muted look, greyed out */
#audio-toggle.muted {
  border-color: rgba(255,255,255,0.12);
  background: rgba(10,4,28,0.6);
  box-shadow: none;
  opacity: 0.65;
}
#audio-toggle.muted .audio-icon { animation: none; }

.audio-icon {
  font-size: 1.2rem;
  line-height: 1;
  color: rgba(255,255,255,0.7);
  transition: all 0.3s;
}
.audio-label {
  font-family: 'Noto Serif Malayalam', serif;
  font-size: 0.48rem;
  color: rgba(255,215,0,0.6);
  letter-spacing: 0.04em;
  transition: all 0.3s;
}
#audio-toggle.playing .audio-label {
  color: #ffd700;
}

/* Tooltip on hover */
#audio-toggle::before {
  content: attr(title);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(10,4,28,0.9);
  border: 1px solid rgba(255,215,0,0.25);
  color: rgba(255,215,0,0.9);
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  font-family: 'Noto Serif Malayalam', serif;
}
#audio-toggle:hover::before { opacity: 1; }

@media (max-width: 768px) {
  #audio-toggle { width: 48px; height: 48px; right: 0.9rem; }
  #audio-toggle::before { display: none; } /* no hover tooltip on mobile */
}
