/* ============================================
   Audio Player — Prova FEBRASGO
   Player inline no modo estudo
   ============================================ */

.audio-player {
  background: var(--teal-tint);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  margin-bottom: 1rem;
}

/* --- Collapsed State --- */
.audio-player-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.875rem;
  font-family: inherit;
  transition: background 0.15s;
}

.audio-player-toggle:hover {
  background: var(--shadow-teal);
}

.audio-player-toggle svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* --- Expanded Controls --- */
.audio-player-controls {
  display: none;
  padding: 0 1rem 0.75rem;
  gap: 0.75rem;
  flex-direction: column;
}

.audio-player.expanded .audio-player-controls {
  display: flex;
}

/* --- Play/Pause + Progress Row --- */
.audio-player-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.audio-play-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
}

.audio-play-btn:hover {
  background: var(--primary-light);
}

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

.audio-play-btn svg {
  width: 18px;
  height: 18px;
}

/* --- Progress Bar --- */
.audio-progress-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.audio-progress-bar {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}

.audio-progress-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.audio-progress-bar::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.audio-progress-bar::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
}

.audio-progress-bar::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: var(--border);
}

.audio-time {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* --- Speed Controls --- */
.audio-speed-row {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.audio-speed-row::-webkit-scrollbar {
  display: none;
}

.audio-speed-btn {
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  min-height: 32px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.audio-speed-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.audio-speed-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* --- Loading State --- */
.audio-player.loading .audio-play-btn {
  opacity: 0.5;
  pointer-events: none;
}

/* --- Dark Mode --- */
:root[data-theme="dark"] .audio-player {
  background: rgba(77, 184, 209, 0.08);
}

:root[data-theme="dark"] .audio-play-btn {
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

:root[data-theme="dark"] .audio-progress-bar::-webkit-slider-thumb {
  border-color: var(--card-bg);
}

:root[data-theme="dark"] .audio-speed-btn {
  background: var(--card-bg);
}

/* --- Mobile Adjustments --- */
@media (max-width: 640px) {
  .audio-player-toggle {
    padding: 0.625rem 0.75rem;
  }

  .audio-player-controls {
    padding: 0 0.75rem 0.625rem;
  }
}
