/* ==========================================================================
   Custom Audio Player
   ========================================================================== */

.audio-player {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    transition: background var(--transition-fast);
}

.audio-player:hover {
    background: rgba(255, 255, 255, 0.1);
}

.audio-player.playing {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Play button */
.audio-player__play {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-accent);
    color: var(--color-white);
    transition: all var(--transition-fast);
}

.audio-player[data-color="amber"] .audio-player__play {
    background: var(--color-amber);
}

.audio-player[data-color="sage"] .audio-player__play {
    background: var(--color-sage);
}

.audio-player[data-color="purple"] .audio-player__play {
    background: var(--color-purple);
}

.audio-player__play:hover {
    transform: scale(1.08);
    opacity: 0.9;
}

.audio-player__play:focus-visible {
    outline: 2px solid var(--color-white);
    outline-offset: 2px;
}

/* Info area */
.audio-player__info {
    flex: 1;
    min-width: 0;
}

.audio-player__title {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-white);
    margin-bottom: 0.375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Waveform / Progress */
.audio-player__waveform {
    position: relative;
    height: 32px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
}

.audio-player__waveform-bars {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    padding: 4px 2px;
}

.audio-player__waveform-bar {
    flex: 1;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 1px;
    min-height: 3px;
    transition: background var(--transition-fast);
}

.audio-player__waveform-bar.played {
    background: var(--color-accent);
}

.audio-player[data-color="amber"] .audio-player__waveform-bar.played {
    background: var(--color-amber);
}

.audio-player[data-color="sage"] .audio-player__waveform-bar.played {
    background: var(--color-sage);
}

.audio-player[data-color="purple"] .audio-player__waveform-bar.played {
    background: var(--color-purple);
}

.audio-player__progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: rgba(255, 255, 255, 0.06);
    pointer-events: none;
    transition: width 100ms linear;
}

/* Time */
.audio-player__time {
    flex-shrink: 0;
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, 0.5);
    font-variant-numeric: tabular-nums;
    min-width: 3.5em;
    text-align: right;
}

/* Loading state */
.audio-player.loading .audio-player__play {
    opacity: 0.6;
    pointer-events: none;
}

@keyframes pulse-ring {
    0% { opacity: 0.6; }
    50% { opacity: 0.3; }
    100% { opacity: 0.6; }
}

.audio-player.loading .audio-player__play::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid currentColor;
    animation: pulse-ring 1s ease infinite;
}

/* ==========================================================================
   Hero Player Variant (light background)
   ========================================================================== */

.hero__player {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-lg);
    margin-top: var(--space-sm);
}

.hero__player .audio-item {
    width: 100%;
}

.audio-player--hero {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(196, 87, 58, 0.15);
    border-radius: var(--radius-full);
    padding: 0.5rem 0.75rem 0.5rem 0.5rem;
    box-shadow: 0 2px 12px rgba(45, 42, 50, 0.06);
}

.audio-player--hero:hover {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(196, 87, 58, 0.25);
    box-shadow: 0 4px 20px rgba(45, 42, 50, 0.1);
}

.audio-player--hero.playing {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(196, 87, 58, 0.3);
    box-shadow: 0 4px 20px rgba(196, 87, 58, 0.12);
}

.audio-player--hero .audio-player__play {
    width: 38px;
    height: 38px;
    background: var(--color-accent);
    box-shadow: 0 2px 8px rgba(196, 87, 58, 0.3);
}

.audio-player--hero .audio-player__title {
    color: var(--color-text);
}

.audio-player--hero .audio-player__waveform {
    background: rgba(45, 42, 50, 0.06);
    height: 28px;
    border-radius: var(--radius-full);
}

.audio-player--hero .audio-player__waveform-bar {
    background: rgba(45, 42, 50, 0.15);
}

.audio-player--hero .audio-player__waveform-bar.played {
    background: var(--color-accent);
}

.audio-player--hero .audio-player__progress {
    background: rgba(196, 87, 58, 0.06);
    border-radius: var(--radius-full);
}

.audio-player--hero .audio-player__time {
    color: var(--color-text-muted);
    font-size: 0.75rem;
}

/* Download button */
.hero-player__download {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--color-text-muted);
    transition: all var(--transition-fast);
    text-decoration: none;
}

.hero-player__download:hover {
    color: var(--color-accent);
    transform: scale(1.1);
}
