/* The Sector — Audio Player */
/* Clean light theme player */

/* Listen button in header */
.listen-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-xl);
  color: #ffffff;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  margin-top: 18px;
}
.listen-btn:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.5);
}
.listen-btn .listen-icon { font-size: 1.1em; }

/* Equalizer animation when playing */
.listen-btn .eq-icon {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  width: 16px;
}
.listen-btn .eq-icon span {
  display: block;
  width: 3px;
  background: currentColor;
  border-radius: 1px;
  animation: eq-bar 0.8s ease-in-out infinite;
}
.listen-btn .eq-icon span:nth-child(1) { height: 60%; animation-delay: 0s; }
.listen-btn .eq-icon span:nth-child(2) { height: 100%; animation-delay: 0.2s; }
.listen-btn .eq-icon span:nth-child(3) { height: 40%; animation-delay: 0.4s; }

@keyframes eq-bar {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.3); }
}

.listen-btn.playing {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.5);
}

/* Floating player bar */
.audio-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 14px 24px;
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}
.audio-player.visible { transform: translateY(0); }

.audio-player-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Controls */
.player-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.player-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9em;
  transition: all 0.2s;
}
.player-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
}
.player-btn.play-btn {
  width: 44px;
  height: 44px;
  background: var(--blue);
  border-color: var(--blue);
  color: #ffffff;
  font-size: 1.1em;
}
.player-btn.play-btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); }

/* Progress area */
.player-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.player-section-name {
  font-size: 0.78em;
  color: var(--text-bright);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.player-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-section);
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  transition: height 0.15s;
}
.player-progress-bar:hover { height: 6px; }
.player-progress-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}
.player-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
.player-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68em;
  color: var(--text-dim);
}

/* Voice quality indicator */
.voice-quality {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6em;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.vq-natural { background: #ecfdf5; color: #047857; }
.vq-enhanced { background: #eff6ff; color: #1d4ed8; }
.vq-standard { background: var(--bg-section); color: var(--text-dim); }

/* Speed control */
.speed-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72em;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 500;
}
.speed-btn:hover { border-color: var(--blue); color: var(--blue); }

/* Close button */
.player-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9em;
  flex-shrink: 0;
  transition: all 0.2s;
}
.player-close:hover { border-color: #dc2626; color: #dc2626; }

/* Highlight active section */
.reading {
  position: relative;
  background: rgba(41,111,177,0.03);
  border-radius: var(--radius-sm);
}

/* Add padding to body when player is visible */
body.player-active { padding-bottom: 90px; }

/* Mobile responsive */
@media (max-width: 640px) {
  .audio-player { padding: 12px 14px; }
  .audio-player-inner { gap: 10px; }
  .player-btn { width: 32px; height: 32px; font-size: 0.85em; }
  .player-btn.play-btn { width: 40px; height: 40px; }
  .player-section-name { font-size: 0.72em; }
  .speed-btn { font-size: 0.65em; padding: 4px 8px; }
  .player-close { width: 26px; height: 26px; }
  .voice-quality { font-size: 0.55em; }
}

@media (max-width: 380px) {
  .speed-btn { display: none; }
  .voice-quality { display: none; }
}
