/* Santuário Sagrado — Custom Styles */

/* ============================================================
   CSS Custom Properties
   ============================================================ */
:root {
  --color-bg: #0f0a1e;
  --color-surface-1: rgba(255,255,255,0.03);
  --color-surface-2: rgba(255,255,255,0.06);
  --color-surface-3: rgba(255,255,255,0.09);
  --color-border-subtle: rgba(255,255,255,0.06);
  --color-border-medium: rgba(255,255,255,0.12);
  --color-accent-gold: #d4a853;
  --color-accent-gold-dim: rgba(212,168,83,0.15);
  --color-accent-gold-glow: rgba(212,168,83,0.25);
  --shadow-elevated: 0 8px 32px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
  --shadow-card: 0 4px 16px rgba(0,0,0,0.25);
  --shadow-gold: 0 4px 20px rgba(212,168,83,0.2);
  --font-display: 'Cormorant Garamond', Georgia, serif;
}

/* ============================================================
   Base
   ============================================================ */
* {
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: #0f0a1e;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   Scrollbar hide utility
   ============================================================ */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ============================================================
   Existing Animations
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes soundbar1 {
  0%, 100% { height: 0.5rem; }
  50% { height: 1rem; }
}

@keyframes soundbar2 {
  0%, 100% { height: 0.75rem; }
  50% { height: 0.375rem; }
}

@keyframes soundbar3 {
  0%, 100% { height: 0.375rem; }
  50% { height: 0.875rem; }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(245, 158, 11, 0.1); }
  50% { box-shadow: 0 0 40px rgba(245, 158, 11, 0.25); }
}

/* ============================================================
   New Animation Keyframes
   ============================================================ */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes gentlePulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

@keyframes ringPulse {
  0% { box-shadow: 0 0 0 0 rgba(212,168,83,0.4); }
  70% { box-shadow: 0 0 0 10px rgba(212,168,83,0); }
  100% { box-shadow: 0 0 0 0 rgba(212,168,83,0); }
}

@keyframes waveBar {
  0%, 100% { height: 4px; }
  50% { height: var(--bar-height, 16px); }
}

@keyframes checkBounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes expandDot {
  from { width: 8px; }
  to { width: 32px; }
}

@keyframes slideFromRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* ============================================================
   Existing Animation Utility Classes
   ============================================================ */
.animate-fadeIn {
  animation: fadeIn 0.4s ease-out;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-shimmer {
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.05) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

.animate-soundbar1 {
  animation: soundbar1 0.8s ease-in-out infinite;
}

.animate-soundbar2 {
  animation: soundbar2 0.6s ease-in-out infinite 0.2s;
}

.animate-soundbar3 {
  animation: soundbar3 0.7s ease-in-out infinite 0.1s;
}

.animate-pulse-glow {
  animation: pulse-glow 3s ease-in-out infinite;
}

/* ============================================================
   New Animation Utility Classes
   ============================================================ */
.animate-slideUp { animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-slideInRight { animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-gentlePulse { animation: gentlePulse 3s ease-in-out infinite; }
.animate-breathe { animation: breathe 6s ease-in-out infinite; }
.animate-ringPulse { animation: ringPulse 2s ease-out infinite; }
.animate-checkBounce { animation: checkBounce 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

/* Stagger classes for list items */
.stagger-1 { animation: slideUp 0.5s cubic-bezier(0.16,1,0.3,1) 0.03s both; }
.stagger-2 { animation: slideUp 0.5s cubic-bezier(0.16,1,0.3,1) 0.06s both; }
.stagger-3 { animation: slideUp 0.5s cubic-bezier(0.16,1,0.3,1) 0.09s both; }
.stagger-4 { animation: slideUp 0.5s cubic-bezier(0.16,1,0.3,1) 0.12s both; }
.stagger-5 { animation: slideUp 0.5s cubic-bezier(0.16,1,0.3,1) 0.15s both; }
.stagger-6 { animation: slideUp 0.5s cubic-bezier(0.16,1,0.3,1) 0.18s both; }
.stagger-7 { animation: slideUp 0.5s cubic-bezier(0.16,1,0.3,1) 0.21s both; }
.stagger-8 { animation: slideUp 0.5s cubic-bezier(0.16,1,0.3,1) 0.24s both; }

/* ============================================================
   Line clamp
   ============================================================ */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================
   Safe areas for iOS
   ============================================================ */
@supports (padding-top: env(safe-area-inset-top)) {
  .safe-top {
    padding-top: env(safe-area-inset-top);
  }
  .safe-bottom {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ============================================================
   Sound progress animation
   ============================================================ */
.sound-progress {
  animation: shimmer 2s infinite;
}

/* ============================================================
   Selection
   ============================================================ */
::selection {
  background: rgba(245, 158, 11, 0.3);
  color: white;
}

/* ============================================================
   Focus styles
   ============================================================ */
input:focus, select:focus, button:focus-visible {
  outline: 2px solid rgba(245, 158, 11, 0.5);
  outline-offset: 2px;
}

button:focus:not(:focus-visible) {
  outline: none;
}

/* ============================================================
   PWA status bar
   ============================================================ */
@media (display-mode: standalone) {
  body {
    padding-top: env(safe-area-inset-top);
  }
}

/* ============================================================
   Card System
   ============================================================ */
.card-elevated {
  background: var(--color-surface-2);
  border-radius: 20px;
  box-shadow: var(--shadow-elevated);
  border: none;
}

.card-glass {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
}

.card-feature {
  background: var(--color-surface-2);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  border-left: 3px solid var(--color-accent-gold);
  border-top: none;
  border-right: none;
  border-bottom: none;
}

.card-minimal {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  border-radius: 0;
  padding-bottom: 16px;
  margin-bottom: 16px;
}
.card-minimal:last-child {
  border-bottom: none;
}

/* ============================================================
   Typography Utilities
   ============================================================ */
.text-display {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.text-display-sm {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.text-body-refined {
  letter-spacing: 0.01em;
  line-height: 1.8;
}

.text-scripture {
  font-family: var(--font-display);
  font-style: italic;
  letter-spacing: 0.01em;
  line-height: 1.7;
}

.drop-cap::first-letter {
  font-family: var(--font-display);
  float: left;
  font-size: 3.5em;
  line-height: 0.8;
  padding-right: 8px;
  padding-top: 4px;
  color: var(--color-accent-gold);
  font-weight: 600;
}

/* ============================================================
   Interactive Effects
   ============================================================ */
.press-effect {
  transition: all 150ms ease;
  cursor: pointer;
}
.press-effect:active {
  transform: scale(0.97);
  filter: brightness(0.95);
}

.hover-lift {
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.hover-lift:active {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated);
}

/* ============================================================
   Decorative Elements
   ============================================================ */
.ornament-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}
.ornament-divider::before,
.ornament-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.08), transparent);
}
.ornament-divider .ornament-icon {
  width: 8px;
  height: 8px;
  border: 1px solid rgba(212,168,83,0.3);
  transform: rotate(45deg);
  flex-shrink: 0;
}

.gradient-line {
  height: 2px;
  width: 40px;
  background: linear-gradient(to right, var(--color-accent-gold), transparent);
  border-radius: 1px;
}

.section-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.06), transparent);
  margin: 8px 0;
}

/* ============================================================
   Waveform Bars
   ============================================================ */
.waveform-container {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 32px;
}
.waveform-bar {
  width: 3px;
  border-radius: 2px;
  background: currentColor;
  transition: height 0.1s ease;
}
.waveform-bar.playing {
  animation: waveBar 0.6s ease-in-out infinite;
}

/* ============================================================
   Timer Ring
   ============================================================ */
.timer-ring {
  transform: rotate(-90deg);
}
.timer-ring circle {
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}

/* ============================================================
   Nav Pill Indicator
   ============================================================ */
.nav-pill {
  position: absolute;
  width: 48px;
  height: 32px;
  background: var(--color-accent-gold-dim);
  border-radius: 16px;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  top: 50%;
  transform: translateY(-50%);
}

.nav-gradient-border {
  border-top: 1px solid transparent;
  border-image: linear-gradient(to right, transparent, rgba(255,255,255,0.08), transparent) 1;
}

/* ============================================================
   Segmented Control
   ============================================================ */
.segmented-control {
  display: flex;
  background: rgba(255,255,255,0.05);
  border-radius: 100px;
  padding: 3px;
  position: relative;
}
.segmented-pill {
  position: absolute;
  background: rgba(255,255,255,0.1);
  border-radius: 100px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  top: 3px;
  bottom: 3px;
}
.segmented-btn {
  position: relative;
  z-index: 1;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  transition: color 0.2s;
  white-space: nowrap;
}
.segmented-btn.active {
  color: white;
}

/* ============================================================
   Scroll Snap for Carousels
   ============================================================ */
.carousel-container {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: 12px;
  padding-bottom: 8px;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 32px;
}
.carousel-container::-webkit-scrollbar { display: none; }
.carousel-container > * {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* ============================================================
   Gold Accent Color Utilities
   ============================================================ */
.text-gold { color: var(--color-accent-gold); }
.bg-gold { background-color: var(--color-accent-gold); }
.border-gold { border-color: var(--color-accent-gold); }
.bg-gold-dim { background-color: var(--color-accent-gold-dim); }
.shadow-gold { box-shadow: var(--shadow-gold); }

/* ============================================================
   Menu Slide Animation
   ============================================================ */
.menu-overlay {
  animation: fadeIn 0.2s ease;
}
.menu-panel {
  animation: slideFromRight 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
