/* ================================================
   MUSIC PLAYER — Slide-out Panel Styles
   ================================================ */

/* ── Nav Button ── */

.mp-nav-btn {
    color: white;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: inherit;
}

.mp-nav-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}

.mp-nav-btn .mp-icon {
    font-size: 1.3rem;
}

/* ── Overlay ── */

.mp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mp-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ── Panel ── */

.mp-panel {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    height: 100vh;
    z-index: 9999;
    background: linear-gradient(180deg, #1a0940 0%, #2a0e5a 40%, #1a0940 100%);
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.5);
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
}

.mp-panel.open {
    right: 0;
}

/* ── Panel Header ── */

.mp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.mp-header-title {
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    opacity: 0.9;
}

.mp-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.mp-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ── Cover Art ── */

.mp-cover-art {
    position: relative;
    width: calc(100% - 40px);
    margin: 16px 20px 12px;
    aspect-ratio: 16 / 10;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

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

.mp-cover-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, 0.7) 100%);
}

.mp-cover-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 42px;
    height: 42px;
    background: rgba(106, 47, 160, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.mp-cover-title {
    position: absolute;
    bottom: 10px;
    left: 12px;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* ── Now Playing ── */

.mp-now-playing {
    padding: 8px 20px 4px;
    flex-shrink: 0;
}

.mp-song-title {
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-song-artist {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

/* ── Progress Bar ── */

.mp-progress-wrap {
    padding: 10px 20px 4px;
    flex-shrink: 0;
}

.mp-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.mp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #a855f7, #f5576c);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
}

.mp-progress-fill::after {
    content: '';
    position: absolute;
    right: -5px;
    top: -4px;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s;
}

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

.mp-time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

/* ── Controls ── */

.mp-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 8px 20px 12px;
    flex-shrink: 0;
}

.mp-ctrl-btn {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.1rem;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mp-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.08);
}

.mp-ctrl-btn.mp-play-pause {
    width: 56px;
    height: 56px;
    font-size: 1.4rem;
    background: linear-gradient(135deg, #a855f7, #7c3aed);
}

.mp-ctrl-btn.mp-play-pause:hover {
    background: linear-gradient(135deg, #c084fc, #8b5cf6);
    transform: scale(1.1);
}

/* ── Volume ── */

.mp-volume {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 12px;
    flex-shrink: 0;
}

.mp-volume-icon {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    cursor: pointer;
}

.mp-volume-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    outline: none;
}

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

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

/* ── Playlist ── */

.mp-playlist-label {
    padding: 4px 20px 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.mp-playlist {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px 16px;
}

.mp-playlist::-webkit-scrollbar {
    width: 6px;
}

.mp-playlist::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.mp-playlist::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.mp-track {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 2px;
}

.mp-track:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mp-track.active {
    background: rgba(168, 85, 247, 0.25);
    border: 1px solid rgba(168, 85, 247, 0.4);
}

.mp-track-num {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    min-width: 20px;
    text-align: center;
}

.mp-track.active .mp-track-num {
    color: #a855f7;
}

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

.mp-track-title {
    color: white;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-track.active .mp-track-title {
    color: #c084fc;
}

.mp-track-duration {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* ── Empty State ── */

.mp-empty {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.mp-empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.4;
}

.mp-empty-text {
    font-size: 0.95rem;
}

/* ── Loading State ── */

.mp-loading {
    display: none;
    text-align: center;
    padding: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.mp-loading.visible {
    display: block;
}

/* ── Responsive ── */

@media (max-width: 768px) {
    .mp-panel {
        width: 100%;
        right: -100%;
    }

    .mp-nav-btn .mp-label {
        display: none;
    }

    .mp-nav-btn {
        padding: 0.5rem 0.7rem;
    }
}

@media (max-width: 480px) {
    .mp-cover-art {
        margin: 12px 16px 8px;
        width: calc(100% - 32px);
    }

    .mp-controls {
        gap: 12px;
    }

    .mp-ctrl-btn.mp-play-pause {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}
