/* ============================================
   Podcast Landing Page — Styles
   Mobile-first, dark theme, locked viewport
   ============================================ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Prevent pull-to-refresh & overscroll */
  overscroll-behavior: none;
  touch-action: pan-x;
}

/* ---- Autoplay Overlay ---- */
.autoplay-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 1;
  transition: opacity 0.4s ease;
}

.autoplay-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.autoplay-overlay button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 40px;
  border: none;
  border-radius: 60px;
  background: #fff;
  color: #000;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.autoplay-overlay button:active {
  transform: scale(0.96);
}

.autoplay-overlay button svg {
  width: 24px;
  height: 24px;
  fill: #000;
}

.autoplay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.overlay-title {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  max-width: 80vw;
}

.overlay-subtitle {
  font-size: 18px;
  font-weight: 400;
  text-align: center;
  max-width: 80vw;
  opacity: 0.85;
}

/* ---- Carousel (fade transition) ---- */
.carousel {
  position: fixed;
  inset: 0;
  z-index: 1;
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
  z-index: 0;
}

.carousel-slide.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

.carousel-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Pagination dots */
.carousel-dots {
  position: fixed;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 8px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.carousel-dot.active {
  background: #fff;
  transform: scale(1.25);
}

/* ---- Audio Player ---- */
.audio-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.65) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.player-title {
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 8px;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Play/Pause button */
.play-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease;
}

.play-btn:active {
  transform: scale(0.92);
}

.play-btn svg {
  width: 18px;
  height: 18px;
  fill: #000;
}

/* Hide one icon depending on state */
.play-btn .icon-pause { display: none; }
.play-btn.playing .icon-play { display: none; }
.play-btn.playing .icon-pause { display: block; }

/* Scrubber / progress */
.scrubber-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scrubber {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
  outline: none;
  cursor: pointer;
}

.scrubber::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
}

.scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  margin-top: -5px;
  cursor: pointer;
}

.scrubber::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
}

.time-display {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
}

/* ---- Landing Page (index) ---- */
.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
  text-align: center;
  overflow: auto;
}

.landing h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.landing p {
  font-size: 15px;
  opacity: 0.6;
  margin-bottom: 32px;
}

.episode-list {
  list-style: none;
  width: 100%;
  max-width: 400px;
}

.episode-list a {
  display: block;
  padding: 16px 20px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: background 0.2s ease;
}

.episode-list a:hover,
.episode-list a:active {
  background: rgba(255, 255, 255, 0.15);
}

/* ---- 404 ---- */
.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  text-align: center;
  padding: 24px;
}

.not-found h1 {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 8px;
}

.not-found p {
  font-size: 16px;
  opacity: 0.6;
  margin-bottom: 24px;
}

.not-found a {
  color: #fff;
  text-decoration: underline;
}
