/* ==========================================================================
   GRAFTAGE PERSISTENT AUDIO PLAYER STYLES
   Floating Bottom Docked Player & Playlist Drawer
   ========================================================================== */

.player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(8, 11, 18, 0.94);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-bright);
    z-index: 999;
    padding: 0.65rem 1.5rem;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(71, 199, 222, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    transition: var(--transition-smooth);
}

.player-bar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 260px;
    max-width: 320px;
}

.player-cover-wrap {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.player-cover-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-track-info {
    overflow: hidden;
}

.player-track-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-track-album {
    font-size: 0.78rem;
    color: var(--cyan);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Center Controls & Scrubber */
.player-bar-center {
    flex: 1;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.player-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
}

.player-btn:hover {
    color: #ffffff;
    transform: scale(1.1);
}

.player-btn.active {
    color: var(--cyan);
    text-shadow: 0 0 8px var(--cyan);
}

.player-btn-main {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--cyan) 0%, #1e879b 100%);
    color: #06080d;
    font-size: 1.15rem;
    box-shadow: 0 0 16px var(--cyan-glow);
}

.player-btn-main:hover {
    background: linear-gradient(135deg, #6ae7fe 0%, #30a9c0 100%);
    color: #000000;
    box-shadow: 0 0 22px rgba(71, 199, 222, 0.7);
    transform: scale(1.08);
}

.player-progress-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.player-time {
    font-family: var(--font-cyber);
    font-size: 0.72rem;
    color: var(--text-muted);
    min-width: 35px;
}

.player-progress-container {
    flex: 1;
    height: 5px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-full);
    position: relative;
    cursor: pointer;
    transition: height 0.2s ease;
}

.player-progress-container:hover {
    height: 8px;
}

.player-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #1e879b 0%, var(--cyan) 100%);
    border-radius: var(--radius-full);
    box-shadow: 0 0 10px var(--cyan-glow);
}

/* Right Controls */
.player-bar-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    min-width: 240px;
    justify-content: flex-end;
}

/* Sound Wave Visualizer */
.player-visualizer {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 20px;
}

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

.player-visualizer.playing .wave-bar:nth-child(1) { animation: wave 1.1s ease-in-out infinite; }
.player-visualizer.playing .wave-bar:nth-child(2) { animation: wave 0.8s ease-in-out infinite 0.2s; }
.player-visualizer.playing .wave-bar:nth-child(3) { animation: wave 1.4s ease-in-out infinite 0.4s; }
.player-visualizer.playing .wave-bar:nth-child(4) { animation: wave 0.9s ease-in-out infinite 0.1s; }

@keyframes wave {
    0%, 100% { height: 4px; }
    50% { height: 18px; }
}

/* Volume Control */
.player-volume-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.player-volume-slider {
    -webkit-appearance: none;
    width: 75px;
    height: 4px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.15);
    outline: none;
    cursor: pointer;
}

.player-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 6px var(--cyan);
    cursor: pointer;
}

.player-action-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.player-action-btn:hover {
    background: var(--cyan);
    color: #000;
    border-color: var(--cyan);
}

/* Playlist Drawer */
.playlist-drawer {
    position: fixed;
    bottom: 78px;
    right: 1.5rem;
    width: 380px;
    max-height: 460px;
    background: rgba(12, 16, 25, 0.97);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-lg);
    box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(71, 199, 222, 0.2);
    backdrop-filter: blur(20px);
    z-index: 998;
    overflow: hidden;
    display: none;
    flex-direction: column;
    animation: drawerSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.playlist-drawer.open {
    display: flex;
}

@keyframes drawerSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.playlist-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    font-family: var(--font-cyber);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #ffffff;
}

.playlist-drawer-list {
    list-style: none;
    overflow-y: auto;
    max-height: 380px;
}

.playlist-drawer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.playlist-drawer-item:hover {
    background: rgba(71, 199, 222, 0.08);
}

.playlist-drawer-item.active {
    background: rgba(71, 199, 222, 0.15);
    border-left: 3px solid var(--cyan);
}

.playlist-drawer-item.active .playlist-item-title {
    color: var(--cyan);
}

.playlist-item-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.playlist-item-num {
    font-family: var(--font-cyber);
    font-size: 0.75rem;
    color: var(--text-muted);
    width: 18px;
}

.playlist-item-play {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
}

.playlist-item-info {
    display: flex;
    flex-direction: column;
}

.playlist-item-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.playlist-item-album {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.playlist-item-badge {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.06);
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

/* Responsive Player */
@media (max-width: 900px) {
    .player-visualizer {
        display: none;
    }
    .player-volume-wrap {
        display: none;
    }
    .player-bar-left {
        min-width: 200px;
    }
    .player-bar-right {
        min-width: auto;
    }
}

@media (max-width: 640px) {
    .player-bar {
        padding: 0.5rem 0.85rem;
        flex-wrap: wrap;
        gap: 0.4rem;
        box-sizing: border-box;
    }

    .player-bar-left {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding-right: 85px;
        box-sizing: border-box;
    }

    .player-cover-wrap {
        width: 44px;
        height: 44px;
    }

    .player-track-title {
        font-size: 0.95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 200px;
    }

    .player-track-album {
        font-size: 0.82rem;
    }

    .player-bar-center {
        width: 100%;
        max-width: 100%;
    }

    .player-controls {
        gap: 0.85rem;
        margin-bottom: 0.2rem;
    }

    .player-btn {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }

    .player-btn-main {
        width: 42px;
        height: 42px;
        font-size: 1.05rem;
    }

    .player-bar-right {
        position: absolute;
        top: 0.55rem;
        right: 0.85rem;
        gap: 0.4rem;
    }

    .player-action-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.82rem;
    }

    .playlist-drawer {
        width: calc(100% - 1.5rem);
        right: 0.75rem;
        bottom: 115px;
        max-height: 55vh;
    }
}
