/* =========================================
   SMOOTH VEGA PODCAST — Mini Player + Full Player
   Podcast-first layout: skip ±15s, chapters,
   no volume slider (system handles it)
   ========================================= */

/* ---- MINI PLAYER BAR ---- */
.mini-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mini-player-height);
  background: var(--bg-elevated);
  border-top: 1px solid var(--glass-border);
  z-index: 900;
  transform: translateY(calc(100% + 10px));
  transition: transform 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
  padding-bottom: var(--safe-bottom);
  will-change: transform;
}

.mini-player.visible {
  transform: translateY(0);
}

.mini-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.04);
}

.mini-progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 200ms linear;
}

.mini-player-inner {
  display: flex;
  align-items: center;
  height: var(--mini-player-height);
  padding: 0 12px;
  gap: 10px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.mini-cover {
  width: 42px;
  height: 42px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  cursor: pointer;
}

.mini-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.mini-title {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-artist {
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.mini-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: none;
  border: none;
  color: var(--text-primary);
  transition: opacity var(--transition-fast);
}

.mini-btn:active {
  opacity: 0.5;
}

.mini-btn svg {
  width: 22px;
  height: 22px;
}

.mini-btn.play-pause svg {
  width: 26px;
  height: 26px;
}

/* ---- FULL PLAYER OVERLAY ---- */
.full-player {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 600ms cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.full-player.open {
  transform: translateY(0);
}

/* Safe areas */
@supports (padding: env(safe-area-inset-top)) {
  .full-player {
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

/* Blurred backdrop — Apple Music style */
.fp-backdrop {
  position: absolute;
  inset: -40px;
  z-index: 0;
  background-size: cover;
  background-position: center;
  filter: blur(60px) saturate(1.4);
  opacity: 0.15;
  transform: scale(1.2);
  transition: background-image 800ms ease;
}

.fp-backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,10,10,0.4) 0%, rgba(10,10,10,0.8) 100%);
}

/* Drag handle — primary dismiss affordance */
.fp-drag-handle {
  position: relative;
  z-index: 2;
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: var(--glass-light);
  margin: 10px auto 0;
  flex-shrink: 0;
}

/* Scrollable content area */
.fp-scroll-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 24px 24px;
  gap: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* When chapters exist or queue is populated, shift to top alignment */
.fp-scroll-content:has(.fp-chapters.has-chapters),
.fp-scroll-content:has(.fp-queue-card) {
  justify-content: flex-start;
}

/* Art container with crossfade */
.fp-art-container {
  position: relative;
  width: min(320px, 75vw);
  aspect-ratio: 1;
  flex-shrink: 0;
}

.fp-art-glow {
  position: absolute;
  inset: -20%;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.15);
  filter: blur(40px);
  z-index: 0;
}

.fp-art {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
  position: relative;
  z-index: 1;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  transition: opacity 300ms ease;
}

.fp-art.crossfading {
  opacity: 0;
}

/* Track info */
.fp-track-info {
  text-align: center;
  max-width: 400px;
  flex-shrink: 0;
}

.fp-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fp-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.fp-description {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--text-dim);
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
  transition: all 200ms ease;
}

.fp-description.expanded {
  -webkit-line-clamp: unset;
  display: block;
}

.fp-description:empty {
  display: none;
}

/* Progress */
.fp-progress-section {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 480px;
  flex-shrink: 0;
}

.fp-time {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  color: var(--text-dim);
  min-width: 36px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.fp-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
}

/* Buffered indicator */
.fp-buffered {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  width: 0%;
  transition: width 500ms linear;
}

.fp-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width 200ms linear;
  z-index: 1;
}

/* Thumb — always visible (small dot), enlarges on interaction */
.fp-progress-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 6px rgba(220, 38, 38, 0.4);
  transition: width 150ms ease, height 150ms ease;
  z-index: 2;
}

.fp-progress-bar:hover .fp-progress-thumb,
.fp-progress-bar:active .fp-progress-thumb {
  width: 14px;
  height: 14px;
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.6);
}

/* Chapter tick marks on progress bar */
.fp-chapter-tick {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 1px;
  z-index: 1;
  pointer-events: none;
}

/* Expand touch target for progress bar */
.fp-progress-bar::before {
  content: '';
  position: absolute;
  inset: -12px 0;
}

/* Controls — podcast layout: skip15 / prev / play / next / skip15 */
.fp-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.fp-ctrl {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: none;
  border: none;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.fp-ctrl svg {
  width: 24px;
  height: 24px;
}

.fp-ctrl:hover {
  color: var(--text-primary);
}

.fp-ctrl:active {
  transform: scale(0.9);
  opacity: 0.7;
}

.fp-ctrl-sm {
  width: 44px;
  height: 44px;
}

.fp-ctrl-sm svg {
  width: 20px;
  height: 20px;
}

.fp-ctrl.active {
  color: var(--accent);
}

/* Skip ±15s buttons */
.fp-skip-btn {
  position: relative;
  width: 48px;
  height: 48px;
}

.fp-skip-btn svg {
  width: 26px;
  height: 26px;
}

.fp-skip-label {
  position: absolute;
  font-family: 'Inter', sans-serif;
  font-size: 0.5rem;
  font-weight: 700;
  color: var(--text-secondary);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin-top: 1px;
  pointer-events: none;
}

/* Play button (large) */
.fp-play-btn {
  width: 64px;
  height: 64px;
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: var(--accent-bright);
}

.fp-play-btn svg {
  width: 30px;
  height: 30px;
}

.fp-play-btn:hover {
  background: rgba(220, 38, 38, 0.2);
  color: #fff;
}

/* Repeat badge */
.fp-repeat-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 0.5rem;
  font-weight: 700;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
}

#fp-repeat {
  position: relative;
}

/* Secondary toolbar — speed, share, sleep, repeat */
.fp-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* Speed control — pill */
.fp-speed-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0 12px;
  transition: all var(--transition-fast);
}

.fp-speed-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.fp-speed-btn.active {
  color: var(--accent-bright);
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.25);
}

/* Action buttons (share, sleep) */
.fp-action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  min-height: 36px;
  background: none;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: var(--text-dim);
  font-family: 'Inter', sans-serif;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all var(--transition-fast);
}

.fp-action-btn:hover {
  color: var(--text-secondary);
  border-color: rgba(255, 255, 255, 0.12);
}

.fp-action-btn.active {
  color: var(--accent);
  border-color: rgba(220, 38, 38, 0.25);
}

.fp-action-btn svg {
  width: 14px;
  height: 14px;
}

/* Section dividers */
.fp-chapters.has-chapters::before,
.fp-queue:not(:empty)::before {
  content: '';
  display: block;
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: 12px;
}

/* Chapter markers — navigation, shown prominently */
.fp-chapters {
  width: 100%;
  max-width: 480px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 500ms cubic-bezier(0.32, 0.72, 0, 1);
  flex-shrink: 0;
}

.fp-chapters.has-chapters {
  max-height: 400px;
  overflow-y: auto;
}

.fp-chapter-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
}

.fp-chapter {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 150ms ease;
  min-height: 44px;
}

.fp-chapter:hover {
  background: rgba(255, 255, 255, 0.06);
}

.fp-chapter:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.08);
}

.fp-chapter.active {
  background: rgba(220, 38, 38, 0.1);
  border-left: 2px solid var(--accent);
}

.fp-chapter-time {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  min-width: 42px;
  text-align: right;
}

.fp-chapter-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.fp-chapter.active .fp-chapter-label {
  color: var(--text-primary);
  font-weight: 600;
}

/* Queue — Up Next / Previous */
.fp-queue {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.fp-queue:empty {
  display: none;
}

.fp-queue-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 4px;
  margin-top: 4px;
}

.fp-queue-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 150ms ease;
  min-height: 44px;
}

.fp-queue-card:hover {
  background: rgba(255, 255, 255, 0.08);
}

.fp-queue-card:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.1);
}

.fp-queue-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.fp-queue-info {
  flex: 1;
  min-width: 0;
}

.fp-queue-guest {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fp-queue-title {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fp-queue-duration {
  font-family: 'Inter', sans-serif;
  font-size: 0.6rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* Overflow "..." button */
.fp-overflow-btn {
  color: var(--text-dim);
}

/* Overflow bottom sheet */
.fp-overflow-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.fp-overflow-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.fp-overflow-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 11;
  background: var(--bg-elevated);
  border-top: 1px solid var(--glass-border);
  border-radius: 16px 16px 0 0;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 400ms cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fp-overflow-sheet.open {
  transform: translateY(0);
}

.fp-overflow-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--glass-light);
  margin: 0 auto 12px;
}

.fp-overflow-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 12px;
  background: none;
  border: none;
  border-radius: 10px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  text-align: left;
  transition: background 150ms ease;
  min-height: 44px;
}

.fp-overflow-option:hover {
  background: rgba(255, 255, 255, 0.06);
}

.fp-overflow-option:active {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(0.98);
}

.fp-overflow-option svg {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.fp-overflow-cancel {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px;
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  border-radius: 10px;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  min-height: 44px;
  transition: all 150ms ease;
}

.fp-overflow-cancel:active {
  background: rgba(255, 255, 255, 0.1);
}

/* Audio error fallback */
.episode-error {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.1);
  border-radius: 10px;
  margin: 8px 0;
}

.episode-error-text {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.episode-error-link {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

.episode-error-link:hover {
  text-decoration: underline;
}

/* Responsive — larger art on tablet/desktop */
@media (min-width: 768px) {
  .fp-art-container {
    width: min(380px, 45vw);
  }
  .fp-progress-section,
  .fp-chapters,
  .fp-queue {
    max-width: 560px;
  }
}

/* Compact layout for short phones */
@media (max-height: 680px) {
  .fp-art-container {
    width: min(200px, 45vw);
  }
  .fp-scroll-content {
    gap: 10px;
    padding: 8px 20px 16px;
  }
}
