/* =============================================
   NexGameHub - Audio Player
   Lecteur de musique gaming flottant
   ============================================= */

/* ===== MINI PLAYER FLOTTANT ===== */
.music-player {
    position: fixed;
    bottom: 100px;
    left: 20px;
    width: 320px;
    background: var(--bg-secondary, #141938);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 9998;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color, #1e293b);
}

.music-player.minimized {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
}

.music-player.minimized .player-content {
    display: none;
}

.music-player.minimized .player-mini-icon {
    display: flex;
}

.music-player.hidden {
    transform: translateX(-400px);
    opacity: 0;
    pointer-events: none;
}

/* ===== HEADER DU PLAYER ===== */
.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--bg-tertiary, #1e293b);
    border-bottom: 1px solid var(--border-color, #334155);
}

.player-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #fff);
}

.player-title i {
    color: var(--primary, #4f46e5);
}

.player-controls-header {
    display: flex;
    gap: 5px;
}

.player-btn-header {
    background: none;
    border: none;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    padding: 5px;
    font-size: 14px;
    transition: color 0.2s;
}

.player-btn-header:hover {
    color: var(--primary, #4f46e5);
}

/* ===== MINI ICON (quand minimisé) ===== */
.player-mini-icon {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary, #4f46e5);
    animation: pulse-icon 2s infinite;
}

@keyframes pulse-icon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.music-player.playing .player-mini-icon {
    animation: bounce-icon 0.5s infinite;
}

@keyframes bounce-icon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* ===== CONTENU DU PLAYER ===== */
.player-content {
    padding: 15px;
}

/* Info de la piste */
.track-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.track-cover {
    width: 50px;
    height: 50px;
    background: var(--gradient-primary, linear-gradient(135deg, #4f46e5, #06b6d4));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.track-cover i {
    font-size: 20px;
    color: #fff;
}

.track-cover.playing i {
    animation: spin-disc 3s linear infinite;
}

@keyframes spin-disc {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.track-details {
    flex: 1;
    min-width: 0;
}

.track-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.track-artist {
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== BARRE DE PROGRESSION ===== */
.progress-container {
    margin-bottom: 12px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary, #1e293b);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary, linear-gradient(135deg, #4f46e5, #06b6d4));
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

.progress-bar:hover .progress-fill {
    background: var(--primary, #4f46e5);
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted, #94a3b8);
    margin-top: 5px;
}

/* ===== CONTRÔLES PRINCIPAUX ===== */
.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}

.player-btn {
    background: none;
    border: none;
    color: var(--text-secondary, #cbd5e1);
    cursor: pointer;
    font-size: 18px;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
}

.player-btn:hover {
    color: var(--primary, #4f46e5);
    background: rgba(79, 70, 229, 0.1);
}

.player-btn.active {
    color: var(--primary, #4f46e5);
}

.player-btn-play {
    width: 45px;
    height: 45px;
    background: var(--gradient-primary, linear-gradient(135deg, #4f46e5, #06b6d4));
    color: #fff !important;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-btn-play:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 20px var(--glow-color, rgba(79, 70, 229, 0.4));
}

/* ===== CONTRÔLE DU VOLUME ===== */
.volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-top: 1px solid var(--border-color, #1e293b);
}

.volume-btn {
    background: none;
    border: none;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    font-size: 14px;
    padding: 5px;
}

.volume-btn:hover {
    color: var(--primary, #4f46e5);
}

.volume-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-tertiary, #1e293b);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--primary, #4f46e5);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--primary, #4f46e5);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* ===== PLAYLIST ===== */
.playlist-toggle {
    display: flex;
    justify-content: center;
    padding-top: 10px;
    border-top: 1px solid var(--border-color, #1e293b);
}

.playlist-toggle-btn {
    background: none;
    border: none;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    transition: color 0.2s;
}

.playlist-toggle-btn:hover {
    color: var(--primary, #4f46e5);
}

.playlist-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.playlist-panel.open {
    max-height: 200px;
}

.playlist-list {
    padding: 10px 0;
    max-height: 180px;
    overflow-y: auto;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}

.playlist-item:hover {
    background: var(--bg-tertiary, #1e293b);
}

.playlist-item.active {
    background: rgba(79, 70, 229, 0.2);
}

.playlist-item-number {
    width: 20px;
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
    text-align: center;
}

.playlist-item.active .playlist-item-number {
    color: var(--primary, #4f46e5);
}

.playlist-item.active .playlist-item-number::before {
    content: "▶";
    font-size: 10px;
}

.playlist-item.active .playlist-item-number span {
    display: none;
}

.playlist-item-info {
    flex: 1;
    min-width: 0;
}

.playlist-item-title {
    font-size: 13px;
    color: var(--text-primary, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item-artist {
    font-size: 11px;
    color: var(--text-muted, #94a3b8);
}

/* ===== CRÉDITS (licence) ===== */
.player-credits {
    padding: 8px 10px;
    background: var(--bg-tertiary, #1e293b);
    border-top: 1px solid var(--border-color, #334155);
    font-size: 10px;
    color: var(--text-muted, #94a3b8);
    text-align: center;
}

.player-credits a {
    color: var(--primary, #4f46e5);
    text-decoration: none;
}

.player-credits a:hover {
    text-decoration: underline;
}

/* ===== BOUTON D'OUVERTURE (quand fermé) ===== */
.music-player-toggle {
    position: fixed;
    bottom: 100px;
    left: 20px;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary, linear-gradient(135deg, #4f46e5, #06b6d4));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9997;
    box-shadow: 0 5px 20px rgba(79, 70, 229, 0.4);
    transition: all 0.3s;
    border: none;
    color: #fff;
    font-size: 20px;
}

.music-player-toggle:hover {
    transform: scale(1.1);
}

.music-player-toggle.hidden {
    display: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .music-player {
        width: calc(100% - 40px);
        left: 20px;
        right: 20px;
        bottom: 80px;
    }
    
    .music-player.minimized {
        width: 50px;
        height: 50px;
        left: 20px;
        right: auto;
    }
}

/* ===== SCROLLBAR CUSTOM ===== */
.playlist-list::-webkit-scrollbar {
    width: 4px;
}

.playlist-list::-webkit-scrollbar-track {
    background: var(--bg-tertiary, #1e293b);
}

.playlist-list::-webkit-scrollbar-thumb {
    background: var(--primary, #4f46e5);
    border-radius: 2px;
}
