/* ================================================================
   Realspaces — Immersive Soundscapes
   styles.css
   ================================================================ */

/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  color: #fff;
}

/* Hide cursor only after user has entered the experience */
body.immersive {
  cursor: none;
}

/* Show cursor when controls are visible */
body.controls-visible {
  cursor: default;
}

/* ── Full-Screen Scene ────────────────────────────────────────── */
#scene {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.scene-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: opacity 2s ease;
}

.scene-video.underneath {
  z-index: 0;
}

.scene-video.on-top {
  z-index: 1;
}

.scene-video.fading {
  opacity: 0;
}

/* ── Entry Prompt (first visit / autoplay gate) ───────────────── */
#entry-prompt {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

#entry-prompt.dismissed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#enter-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: none;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  padding: 40px 56px;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 300;
}

#enter-btn:hover,
#enter-btn:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.7);
  color: #fff;
  transform: scale(1.03);
}

#enter-btn svg {
  opacity: 0.8;
}

/* ── Overlay Controls ─────────────────────────────────────────── */
#controls {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#controls.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#controls.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ── Menu ──────────────────────────────────────────────────────── */
#menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#menu-toggle {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: all 0.25s ease;
}

#menu-toggle:hover,
#menu-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* ── Menu Panel (dropdown container) ──────────────────────────── */
#menu-panel {
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 10px 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease, padding 0.35s ease;
  max-height: 500px;
  opacity: 1;
}

#menu-panel.collapsed {
  max-height: 0;
  opacity: 0;
  padding: 0;
  border-color: transparent;
}

#menu-items {
  list-style: none;
}

#menu-items li a,
#menu-meta li a {
  display: block;
  padding: 10px 24px;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  transition: all 0.2s ease;
}

#menu-items li a:hover,
#menu-items li a:focus-visible,
#menu-meta li a:hover,
#menu-meta li a:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

#menu-items li a.active {
  color: #fff;
}

#menu-meta {
  list-style: none;
}

.menu-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 8px 16px;
}

/* ── Sound Player (inside menu) ───────────────────────────────── */
#sound-player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 18px;
}

#play-pause-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

#play-pause-btn:hover,
#play-pause-btn:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.hidden-icon {
  display: none;
}

#volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.7);
}

/* ── Volume Slider (custom range input) ───────────────────────── */
#volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 110px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  cursor: pointer;
}

#volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease;
}

#volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

#volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  cursor: pointer;
}

#volume-slider::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
}

/* ── Fullscreen Toggle ────────────────────────────────────────── */
#fullscreen-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 24px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.92rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s ease;
}

#fullscreen-btn:hover,
#fullscreen-btn:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* ── Responsive tweaks ────────────────────────────────────────── */
@media (max-width: 480px) {
  #controls {
    padding: 16px 18px;
  }

  #enter-btn {
    padding: 30px 40px;
    font-size: 0.95rem;
  }

  #volume-slider {
    width: 80px;
  }
}
