/* ====================================================================== */
/* PERSISTENT AUDIO PLAYER STYLES */
/* ====================================================================== */

#persistent-audio-player {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    max-width: 80%;
    width: 80%;
    min-width: 400px;
    background: #ebf4fb; /* Light blue background */
    color: #333;
    padding: 15px 20px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 20px;
    height: 80px;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px 8px 0 0;
    transition: transform 0.3s ease;
}

#persistent-audio-player.visible {
    transform: translateX(-50%) translateY(0) !important;
}

.player-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
}

#progress-bar {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    outline: none;
    cursor: pointer;
}

#progress-bar::-webkit-slider-track {
    background: rgba(0,0,0,0.1);
    height: 6px;
}

#progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #AC2125;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -4px;
}

#progress-bar::-moz-range-track {
    background: rgba(0,0,0,0.1);
    height: 6px;
}

#progress-bar::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #AC2125;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.player-info {
    flex: 1;
    min-width: 0;
    padding: 0 20px;
}

#current-title {
    display: block;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
}

.time-display {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* Player info section removed */

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

/* Close button */
.close-player {
    background: rgba(0, 0, 0, 0.2);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
    font-size: 24px;
    line-height: 1;
    padding: 0;
    margin-left: 10px;
}

.close-player:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: scale(1.1);
}

.close-player:focus {
    outline: 2px solid #005177;
    outline-offset: 2px;
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
}

.volume-btn {
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    width: 40px;
    height: 40px;
}

.volume-btn:hover {
    background: #005177;
    transform: scale(1.05);
}

.volume-btn img {
    width: 100%;
    height: 100%;
    filter: brightness(0) invert(1);
}

.volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(0,0,0,0.2);
    outline: none;
    cursor: pointer;
    border-radius: 2px;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #0073aa;
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #0073aa;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.player-controls button {
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    min-width: 40px;
    height: 40px;
}

.player-controls button img {
    width: 100%;
    height: 100%;
    filter: brightness(0) invert(1); /* Make SVGs white */
}

/* Ensure persistent player icons are always white */
#persistent-audio-player .player-controls button img {
    filter: brightness(0) invert(1) !important; /* Force white color */
}

.player-controls button:hover {
    background: #005177;
    transform: scale(1.05);
}

/* Keep icons white on hover */
#persistent-audio-player .player-controls button:hover img {
    filter: brightness(0) invert(1) !important; /* Stay white on hover */
}

.player-controls button:active {
    transform: scale(0.95);
}

/* Play/Pause button is larger */
#play-pause-btn {
    background: #AC2125;
    width: 50px;
    height: 50px;
}

#play-pause-btn:hover {
    background: #8B1A1D;
}

/* Rewind/Forward buttons with text */
#rewind-btn svg,
#forward-btn svg {
    position: relative;
}

#rewind-btn text,
#forward-btn text {
    font-size: 8px;
    font-weight: bold;
}

/* Queue panel styles */
.queue-panel {
    position: fixed;
    right: -300px;
    top: 0;
    bottom: 0;
    width: 300px;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.2);
    transition: right 0.3s ease;
    z-index: 10000;
    display: flex;
    flex-direction: column;
}

.queue-panel.active {
    right: 0;
}

.queue-header {
    padding: 15px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.queue-items {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.queue-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s ease;
}

.queue-item:hover {
    background: #f5f5f5;
}

.queue-item.active {
    background: #e3f2fd;
    font-weight: 600;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #persistent-audio-player {
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        transform: translateX(0) translateY(100%);
        gap: 10px;
        padding: 10px 15px;
        height: 70px;
        min-width: unset;
    }
    
    #persistent-audio-player.visible {
        transform: translateX(0) translateY(0) !important;
    }
    
    #current-title {
        font-size: 12px;
    }
    
    .player-controls button {
        padding: 6px;
        min-width: 36px;
        height: 36px;
    }
    
    #play-pause-btn {
        width: 44px;
        height: 44px;
    }
    
    .player-info {
        padding: 0 10px;
    }
    
    .close-player {
        width: 30px;
        height: 30px;
        font-size: 20px;
        margin-left: 5px;
    }
    
    .volume-control {
        display: none; /* Hide volume on mobile to save space */
    }
}

/* Accessibility */
.player-controls button:focus {
    outline: 2px solid #005177;
    outline-offset: 2px;
}

/* Loading state */
#persistent-audio-player.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Error state */
#persistent-audio-player.error #current-title {
    color: #d32f2f;
}