/**
 * Audio Player Styles
 *
 * Sticky footer audio player with glassmorphism, play button,
 * track info, and visualizer bar animations.
 *
 * @package Blackout
 */

/* === AUDIO PLAYER CONTAINER === */
.audio-player {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 800px;
    height: 70px;
    z-index: 100;
    background: var(--glass-strong);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    gap: 2rem;
}

/* === PLAY BUTTON === */
.play-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--fg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--fg);
    font-size: 1rem;
    cursor: none;
    transition: all 0.2s;
    flex-shrink: 0;
}

.play-btn:hover {
    background: var(--fg);
    color: var(--bg);
}

.play-btn.playing {
    border-color: var(--accent);
    color: var(--accent);
}

/* === MINIMIZE TOGGLE === */
.player-minimize {
    display: none; /* Hidden on desktop by default */
    background: none;
    border: none;
    color: #555;
    font-size: 0.8rem;
    padding: 0.5rem;
    cursor: none;
    transition: color 0.2s;
    flex-shrink: 0;
}

.player-minimize:hover {
    color: var(--accent);
}

.player-minimize__icon {
    display: inline-block;
    transition: transform 0.2s ease;
    line-height: 1;
}

/* === TRACK INFO === */
.track-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.track-name {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
}

/* === VISUALIZER === */
.visualizer {
    display: flex;
    gap: 2px;
    height: 20px;
    align-items: flex-end;
    flex-shrink: 0;
}

.bar {
    width: 4px;
    background: #333;
    transition: height 0.1s;
}

.bar.active {
    background: var(--accent);
    animation: bounce 0.4s infinite alternate;
}

@keyframes bounce {
    0% { height: 4px; }
    100% { height: 20px; }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .audio-player {
        width: 92%;
        height: 60px;
        padding: 0 1rem;
        gap: 1rem;
        bottom: 12px;
    }

    .play-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        font-size: 0.7rem;
    }

    .track-name {
        font-size: 0.75rem;
    }

    .track-artist {
        font-size: 0.6rem;
    }

    .visualizer {
        gap: 1.5px;
    }

    .bar {
        width: 3px;
    }

    .player-minimize {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* === MINIMIZED STATE (mobile) === */
@media (max-width: 768px) {
    .audio-player.minimized {
        height: 32px;
        padding: 0 1rem;
        gap: 0.5rem;
        bottom: 8px;
    }

    .audio-player.minimized .track-info {
        flex-direction: row;
        gap: 0.5rem;
        align-items: center;
    }

    .audio-player.minimized .track-name {
        font-size: 0.6rem;
    }

    .audio-player.minimized .track-artist {
        display: none;
    }

    .audio-player.minimized .play-btn {
        width: 24px;
        height: 24px;
        min-width: 24px;
        font-size: 0.5rem;
    }

    .audio-player.minimized .visualizer {
        display: none;
    }

    .audio-player.minimized .player-minimize__icon {
        transform: rotate(180deg); /* Arrow points up when minimized */
    }
}

/* === BODY BOTTOM PADDING FOR PLAYER === */
body.has-audio-player {
    padding-bottom: 90px; /* 70px player height + 20px bottom offset */
}

@media (max-width: 768px) {
    body.has-audio-player {
        padding-bottom: 80px; /* 60px player height + 12px bottom offset + 8px buffer */
    }

    body.has-audio-player.player-minimized {
        padding-bottom: 48px; /* 32px minimized height + 8px bottom + 8px buffer */
    }
}
