.music-player {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 18px;
    background: rgba(26, 20, 16, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(201, 168, 76, 0.4); 
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    font-family: 'Cinzel', serif;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 450px;
}

/* Minimize logic */
.minimize-btn {
    background: none;
    border: none;
    color: var(--gold);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    padding: 0 5px;
}

.minimize-btn:hover {
    opacity: 1;
}

.music-player.minimized {
    padding: 8px 15px;
    max-width: 100px;
}

.music-player.minimized .music-info,
.music-player.minimized .player-controls {
    display: none;
}

/* Keep visualizer visible even when minimized to show playing state */
.music-player.minimized .visualizer {
    display: flex;
}

[data-theme="light"] .music-player {
    background: rgba(244, 235, 217, 0.95);
    border-color: rgba(122, 92, 47, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}


.music-player:hover {
    transform: translateY(-5px);
    border-color: rgba(201, 168, 76, 0.7);
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-btn {
    background: none;
    border: none;
    color: var(--gold);
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(201, 168, 76, 0.1);
}

#play-pause-btn {
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
    background: rgba(201, 168, 76, 0.2);
}

.player-btn:hover {
    transform: scale(1.1);
    background: rgba(201, 168, 76, 0.3);
    color: var(--parchment);
}

.music-info {
    display: flex;
    flex-direction: column;
    min-width: 100px;
    max-width: 150px;
}

.track-name {
    font-size: 0.7rem;
    color: var(--gold);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.track-status {
    font-size: 0.6rem;
    color: rgba(201, 168, 76, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.track-status.loading {
    animation: loading-pulse 1.5s infinite ease-in-out;
}

@keyframes loading-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Visualizer */
.visualizer {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
}

.bar {
    width: 2px;
    background: var(--gold);
    transition: height 0.2s ease;
    border-radius: 1px;
    height: 3px;
}

.playing .bar {
    animation: bounce 1.2s infinite ease-in-out;
}

.playing .bar:nth-child(2) { animation-delay: 0.2s; }
.playing .bar:nth-child(3) { animation-delay: 0.4s; }
.playing .bar:nth-child(4) { animation-delay: 0.6s; }

@keyframes bounce {
    0%, 100% { height: 3px; }
    50% { height: 12px; }
}

/* Volume control */
.volume-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.music-player:not(.minimized):hover .volume-wrapper,
.volume-wrapper.force-show {
    width: 80px;
    opacity: 1;
    margin-left: 5px;
    pointer-events: auto;
}

.volume-slider {
    width: 70px;
    height: 4px;
    -webkit-appearance: none;
    background: rgba(201, 168, 76, 0.2);
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--gold);
    border: 2px solid var(--ink);
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

/* Responsive fixes */
@media (max-width: 600px) {
    .music-player {
        bottom: 100px;
        right: 15px;
        left: 15px;
        max-width: none;
        padding: 8px 12px;
        justify-content: space-between;
    }

    .music-player.minimized {
        left: auto;
        width: auto;
        max-width: 80px;
        bottom: 150px; /* Un peu plus haut quand réduit sur mobile */
    }

    .music-info {
        min-width: 0;
        flex: 1;
        margin: 0 10px;
    }

    .track-name {
        max-width: 100px;
    }

    .player-btn {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }

    #play-pause-btn {
        width: 36px;
        height: 36px;
    }

    .volume-wrapper.force-show {
        position: absolute;
        bottom: 60px;
        right: 15px;
        background: rgba(26, 20, 16, 0.95);
        padding: 10px;
        border-radius: 20px;
        border: 1px solid var(--gold-dim);
        width: 120px;
        height: 40px;
        justify-content: center;
        box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    }
}


