/* ============================================
   GLOBAL MUSIC PLAYER - Q-PLAY
   Yellow: #FFD700
   ============================================ */

.global-player {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, #0a0704, #1a0a00);
    border-top: 2px solid rgba(255, 255, 0, 0.2);
    padding: 10px 20px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
}

.player-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* --- Track Info --- */
.player-track-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 180px;
    flex: 0 0 auto;
}

.player-cover {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 0, 0.15);
}

.player-track-info h4 {
    color: #FFD700;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.player-track-info p {
    color: #888;
    font-size: 12px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

/* --- Controls --- */
.player-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.player-btn {
    background: transparent;
    border: none;
    color: #888;
    font-size: 16px;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-btn:hover {
    color: #FFD700;
    background: rgba(255, 255, 0, 0.08);
}

.player-btn.active {
    color: #FFD700;
}

.player-btn-play {
    background: linear-gradient(135deg, #d4af37, #FFD700);
    color: #1a0a00;
    width: 40px;
    height: 40px;
    font-size: 18px;
}

.player-btn-play:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 255, 0, 0.3);
    color: #1a0a00;
}

/* --- Progress --- */
.player-progress {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 150px;
}

.player-time {
    color: #888;
    font-size: 12px;
    min-width: 35px;
    font-variant-numeric: tabular-nums;
}

.player-progress-bar {
    flex: 1;
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
    min-width: 80px;
}

.player-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #d4af37, #FFD700);
    border-radius: 4px;
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
}

.player-progress-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #FFD700;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(255, 255, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.player-progress-bar:hover .player-progress-fill::after {
    opacity: 1;
}

#playerProgressInput {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

/* --- Volume --- */
.player-volume {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.player-volume input[type="range"] {
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}

.player-volume input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #FFD700;
    cursor: pointer;
}

.player-volume input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #FFD700;
    cursor: pointer;
}

/* --- Mobile --- */
@media (max-width: 768px) {
    .global-player {
        padding: 8px 12px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    }
    .player-container {
        gap: 8px;
        flex-wrap: nowrap;
    }
    .player-track-info {
        min-width: 120px;
    }
    .player-cover {
        width: 36px;
        height: 36px;
    }
    .player-track-info h4 {
        font-size: 12px;
        max-width: 80px;
    }
    .player-track-info p {
        display: none;
    }
    .player-btn {
        font-size: 14px;
        padding: 6px 8px;
    }
    .player-btn-play {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    .player-progress {
        min-width: 80px;
    }
    .player-volume input[type="range"] {
        width: 50px;
    }
    .player-volume {
        display: none;
    }
}

@media (max-width: 480px) {
    .player-track-info {
        min-width: 80px;
    }
    .player-cover {
        width: 28px;
        height: 28px;
    }
    .player-track-info h4 {
        max-width: 50px;
        font-size: 10px;
    }
    .player-controls {
        gap: 2px;
    }
    .player-btn {
        padding: 4px 6px;
        font-size: 12px;
    }
    .player-btn-play {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    .player-progress {
        min-width: 60px;
    }
    .player-time {
        font-size: 10px;
        min-width: 25px;
    }
    #playerShuffle,
    #playerRepeat {
        display: none;
    }
}

.queue-add-btn,
.js-queue-track.queue-add-btn {
    background: rgba(255, 215, 0, 0.12);
    border: 1px solid rgba(255, 215, 0, 0.28);
    color: #FFD700;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.queue-add-btn:hover {
    background: #FFD700;
    color: #000;
}

.queue-add-btn.is-queued,
.js-queue-track.is-queued,
.js-queue-tracks.is-queued {
    background: #FFD700;
    color: #000;
    border-color: #FFD700;
    opacity: 1;
}

.player-queue-toast {
    position: fixed;
    right: 20px;
    bottom: calc(var(--global-player-offset, 80px) + 16px);
    z-index: 1100;
    background: #1a140f;
    color: #fff;
    border: 1px solid rgba(255, 215, 0, 0.35);
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.player-queue-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}
