@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --color-primary: #9d4040;
  --color-primary-container: #f2827f;
  --color-on-primary: #ffffff;
  --color-surface: #fff8f5;
  --color-surface-container: #f8ece4;
  --color-surface-container-low: #fef1ea;
  --color-surface-container-lowest: #ffffff;
  --color-on-surface: #201b16;
  --color-on-surface-variant: #554241;
  --color-outline-variant: #dbc0be;
  --color-tertiary: #006c4c;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: #f7f6f4;
  color: var(--color-on-surface);
  min-height: 100vh;
}

/* Ghost border — felt but not seen */
.ghost-border {
  border: 1px solid rgba(219, 192, 190, 0.3);
}

/* Lock overlay on prayer list items */
.lock-overlay {
  position: relative;
}
.lock-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, transparent 60%, rgba(254, 241, 234, 0.95) 100%);
  pointer-events: none;
}

/* Audio player timeline */
.audio-timeline {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--color-outline-variant);
  outline: none;
}
.audio-timeline::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
}

/* Hero gradient overlay */
.hero-overlay {
  background: linear-gradient(to top, rgba(32, 27, 22, 0.85) 0%, rgba(32, 27, 22, 0.2) 60%, transparent 100%);
}

/* PTN Plus badge */
.ptn-plus-badge {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-container) 100%);
}

/* Glassmorphism nav */
.glass-nav {
  background: rgba(255, 248, 245, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Smooth transitions */
.prayer-item {
  transition: background-color 0.15s ease;
}
.prayer-item:active {
  background-color: var(--color-surface-container);
}

/* ── Chunk-based transcript reveal ── */
.transcript-chunk {
  transition: opacity 0.8s ease, transform 0.8s ease, color 0.8s ease;
}

.transcript-chunk.chunk-upcoming {
  opacity: 0.55;
  transform: translateY(0);
}

.transcript-chunk.chunk-active {
  opacity: 1;
  transform: translateY(0);
}

.transcript-chunk.chunk-spoken {
  opacity: 0.7;
  transform: translateY(0);
}

/* ── Focused vignette / prayer mode ── */

/* Vignette overlay — darkened edges cupping inward */
/* ── Prayer mode — subtle glow on active chunk only ── */

/* Dim the chrome */
header,
#episode-header,
#action-row,
#upgrade-strip,
#tab-row {
  transition: opacity 2s ease;
}

body.prayer-mode {
  background-color: #E8E3DE;
}

body.prayer-mode header,
body.prayer-mode #episode-header,
body.prayer-mode #action-row,
body.prayer-mode #upgrade-strip,
body.prayer-mode #tab-row {
  opacity: 0.06;
}

/* Active chunk gets a soft warm glow behind it */
.transcript-chunk.chunk-active {
  position: relative;
}

body.prayer-mode .transcript-chunk.chunk-active {
  box-shadow: 0 0 40px 20px rgba(250, 240, 225, 0.5);
  border-radius: 8px;
}

/* Spoken chunks soften more during prayer */
body.prayer-mode .transcript-chunk.chunk-spoken {
  opacity: 0.25;
}

/* Upcoming chunks nearly invisible during prayer */
body.prayer-mode .transcript-chunk.chunk-upcoming {
  opacity: 0.06;
}

/* Transition the background */
body {
  transition: background-color 2s ease;
}

/* Player bar softens */
footer {
  transition: opacity 2s ease;
}

body.prayer-mode footer {
  opacity: 0.7;
}

/* ── Breathing circle pause indicator ── */
.pause-overlay {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 390px;
  height: 100%;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(250, 249, 247, 0.95);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

.pause-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.breathing-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(151, 196, 174, 0.25) 0%, rgba(151, 196, 174, 0.08) 70%, transparent 100%);
  border: 2px solid rgba(151, 196, 174, 0.4);
  animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% {
    transform: scale(0.85);
    border-color: rgba(151, 196, 174, 0.3);
    box-shadow: 0 0 0 0 rgba(151, 196, 174, 0.1);
  }
  50% {
    transform: scale(1.15);
    border-color: rgba(151, 196, 174, 0.6);
    box-shadow: 0 0 40px 10px rgba(151, 196, 174, 0.15);
  }
}

.pause-message {
  margin-top: 24px;
  font-family: 'Poppins', 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: #97C4AE;
  letter-spacing: 0.03em;
  opacity: 0;
  animation: fadeInText 1.5s ease 0.5s forwards;
}

@keyframes fadeInText {
  to { opacity: 1; }
}

/* ── End-of-prayer CTA overlay ── */
.end-cta-overlay {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 390px;
  height: 100%;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(250, 249, 247, 0.0);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease, background 1.2s ease;
}

.end-cta-overlay.visible {
  opacity: 1;
  pointer-events: auto;
  background: rgba(250, 249, 247, 0.92);
}

.end-cta-card {
  max-width: 320px;
  padding: 32px 28px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(70, 63, 58, 0.1);
  text-align: center;
  font-family: 'Poppins', 'Plus Jakarta Sans', sans-serif;
  transform: translateY(20px);
  transition: transform 0.8s ease;
}

.end-cta-overlay.visible .end-cta-card {
  transform: translateY(0);
}
