/* ==========================================================
   SANCTUARY 2.0 — PLAYER DE MÚSICA + MODO CONTEMPLATIVO
   (Layout persistente entre páginas, controles grandes)
   ========================================================== */

.ambient-player {
  position: fixed;
  bottom: calc(var(--s-5) + var(--tabbar-h) + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-fab);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-lg);
  max-width: 95vw;
  transition: all var(--t-normal);
}

.ambient-player[hidden] { display: none; }

.ambient-player__eq {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
  width: 24px;
}

.ambient-player__eq span {
  width: 3px;
  background: var(--gold-sacred);
  border-radius: var(--r-pill);
  animation: eq 1.2s ease-in-out infinite;
}

.ambient-player__eq span:nth-child(1) { animation-delay: 0s; }
.ambient-player__eq span:nth-child(2) { animation-delay: 0.2s; }
.ambient-player__eq span:nth-child(3) { animation-delay: 0.4s; }
.ambient-player__eq span:nth-child(4) { animation-delay: 0.6s; }

@keyframes eq {
  0%, 100% { height: 30%; }
  50%      { height: 100%; }
}

.ambient-player.is-paused .ambient-player__eq span {
  animation-play-state: paused;
  height: 30% !important;
}

.ambient-player__info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 120px;
}

.ambient-player__info strong {
  font-size: 0.85rem;
  color: var(--text-main);
}

.ambient-player__info small {
  font-size: 0.7rem;
  color: var(--text-light);
}

#ambient-volume {
  width: 80px;
  height: 4px;
  -webkit-appearance: none;
  background: var(--border);
  border-radius: var(--r-pill);
  cursor: pointer;
}

#ambient-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  background: var(--gold-sacred);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 8px var(--halo-gold);
}

#ambient-volume::-moz-range-thumb {
  width: 14px; height: 14px;
  background: var(--gold-sacred);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

@media (min-width: 1200px) {
  .ambient-player {
    bottom: var(--s-5);
    left: var(--s-5);
    transform: none;
  }
}

@media (max-width: 767px) {
  .ambient-player__info { display: none; }
  #ambient-volume { display: none; }
  .ambient-player { padding: var(--s-2) var(--s-3); gap: var(--s-2); }
}

/* ===== MODO CONTEMPLATIVO (TELA CHEIA) ===== */
.contemplative {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  flex-direction: column;
  background: var(--grad-aurora);
  background-size: 200% 200%;
  animation: auroraShift 30s ease-in-out infinite;
}

.contemplative.is-open { display: flex; }

#contemplative-stars {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
}

.contemplative__close {
  position: absolute;
  top: calc(var(--s-5) + var(--safe-top));
  right: var(--s-5);
  width: 50px; height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: white;
  font-size: 1.2rem;
  z-index: 2;
  display: grid;
  place-items: center;
  transition: all var(--t-fast);
}

.contemplative__close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(90deg);
}

.contemplative__content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-7);
  z-index: 1;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.contemplative__text {
  font-family: var(--font-prayer);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  line-height: 1.6;
  color: white;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
  animation: fadeIn 1.5s ease;
  letter-spacing: 0.01em;
  max-width: 32ch;
}

.contemplative__controls {
  display: flex;
  justify-content: center;
  gap: var(--s-4);
  padding: var(--s-5) var(--s-5) calc(var(--s-7) + var(--safe-bottom));
  z-index: 1;
}

.ctl-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: white;
  font-size: 1.1rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all var(--t-fast);
}

.ctl-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
}

.ctl-btn:active { transform: scale(0.95); }

[data-action="contemplative-tts"] {
  width: 72px; height: 72px;
  background: var(--grad-dourado);
  border: none;
  font-size: 1.4rem;
  box-shadow: 0 0 30px var(--halo-gold);
}

/* ===== DRAWER LATERAL (Tablet + Mobile) ===== */
.drawer {
  position: fixed;
  inset: 0;
  z-index: var(--z-drawer);
  display: none;
  pointer-events: none;
}

.drawer.is-open {
  display: block;
  pointer-events: auto;
}

.drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 13, 22, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
}

.drawer__panel {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: min(320px, 80vw);
  background: var(--bg-card);
  padding: calc(var(--s-6) + var(--safe-top)) var(--s-5) var(--s-6);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  animation: slideInLeft 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.drawer__close {
  position: absolute;
  top: calc(var(--s-4) + var(--safe-top));
  right: var(--s-4);
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg-site);
  color: var(--text-main);
  display: grid;
  place-items: center;
}

.drawer__title {
  font-family: var(--font-cinzel);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-sacred);
  margin: var(--s-3) 0 var(--s-2);
}

.drawer__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}

.drawer__list a,
.drawer__list button {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 500;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: all var(--t-fast);
  min-height: 48px;
}

.drawer__list a:hover,
.drawer__list button:hover {
  background: var(--halo-gold-soft);
  color: var(--gold-sacred);
}

.drawer__list i {
  width: 24px;
  text-align: center;
  color: var(--gold-sacred);
}

.drawer__footer {
  margin-top: auto;
  font-size: 0.75rem;
  color: var(--text-light);
  text-align: center;
  padding-top: var(--s-5);
  border-top: 1px solid var(--border);
}

/* ===== FAB (Floating Action Button) =====
   Posicionado à direita, em altura intermediária para não
   colidir com o botão de voltar ao topo (que fica à esquerda). */
.fab {
  position: fixed;
  bottom: calc(var(--s-5) + var(--tabbar-h) + var(--safe-bottom) + 76px);
  right: var(--s-5);
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--grad-dourado);
  color: white;
  font-size: 1.3rem;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-glow-gold);
  z-index: var(--z-fab);
  transition: all var(--t-normal);
  animation: pulseGold 3s ease-in-out infinite;
}

.fab:hover {
  transform: scale(1.1) rotate(8deg);
}

.fab:active { transform: scale(0.95); }

@media (min-width: 1200px) {
  .fab { bottom: calc(var(--s-5) + 80px); }
}

/* ===== BOTTOM TAB BAR (Mobile) ===== */
.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  z-index: var(--z-header);
  display: none;
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--border);
}

.tabbar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: var(--tabbar-h);
  color: var(--text-light);
  font-size: 0.7rem;
  font-weight: 500;
  position: relative;
  text-decoration: none;
  transition: color var(--t-fast);
}

.tabbar__item i {
  font-size: 1.15rem;
  transition: transform var(--t-fast);
}

.tabbar__item.is-active {
  color: var(--gold-sacred);
}

.tabbar__item.is-active i {
  transform: translateY(-2px);
  filter: drop-shadow(0 0 6px var(--halo-gold));
}

.tabbar__item.is-active::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--gold-sacred);
  border-radius: var(--r-pill);
}

@media (max-width: 767px) {
  .tabbar { display: flex; }
}

/* ===== ONBOARDING (primeira visita) ===== */
.onboarding {
  position: fixed;
  inset: 0;
  z-index: var(--z-toast);
  display: none;
  flex-direction: column;
  background: var(--grad-aurora);
  background-size: 200% 200%;
  animation: auroraShift 20s ease-in-out infinite;
  color: white;
  padding: var(--s-7) var(--s-5);
}

.onboarding.is-open { display: flex; }

.onboarding__slide {
  display: none;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--s-5);
  animation: fadeIn 0.6s ease;
  max-width: 480px;
  margin: 0 auto;
}

.onboarding__slide.is-active { display: flex; }

.onboarding__icon {
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: grid;
  place-items: center;
  font-size: 3rem;
  color: white;
  margin-bottom: var(--s-3);
  box-shadow: 0 0 60px rgba(212, 175, 55, 0.3);
  animation: float 5s ease-in-out infinite;
}

.onboarding__slide h2 {
  font-family: var(--font-title);
  color: white;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  margin: 0;
}

.onboarding__slide p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 360px;
}

.onboarding__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding-top: var(--s-5);
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.onboarding__dots {
  display: flex;
  gap: 8px;
  flex: 1;
  justify-content: center;
}

.onboarding__dots span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: all var(--t-fast);
}

.onboarding__dots span.is-active {
  width: 24px;
  border-radius: var(--r-pill);
  background: white;
}
