/* Exit Music — Global Mini Player (Apple/Exit style) */
.mini-player {
    position: fixed;
    z-index: 250;
    bottom: 12px;
    left: 12px;
    right: 12px;
    background: rgba(20,20,22,0.78);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 18px;
    box-shadow: 0 12px 40px -12px rgba(0,0,0,0.6), 0 1px 0 rgba(255,255,255,0.04) inset;
    padding: 10px 12px;
    display: none;
    align-items: center;
    gap: 12px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    letter-spacing: -0.005em;
    color: #fff;
    transition: opacity .2s cubic-bezier(0.16, 1, 0.3, 1), transform .28s cubic-bezier(0.16, 1, 0.3, 1);
}
.mini-player.visible { display: flex; }
.mini-player.hidden { opacity: 0; transform: translateY(20px); pointer-events: none; }

@media (min-width: 1024px) {
    .mini-player { left: 252px; right: 12px; bottom: 12px; }
    body.side-nav-collapsed .mini-player { left: 84px; }
}
@media (max-width: 1023px) {
    .mini-player {
        bottom: calc(64px + 8px + env(safe-area-inset-bottom));
        left: 8px; right: 8px;
        padding: 9px 10px;
        gap: 10px;
        border-radius: 16px;
    }
}

/* Cover */
.mp-cover {
    width: 44px; height: 44px;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.30);
    font-size: 16px;
    flex-shrink: 0;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255,255,255,0.06);
}
.mp-cover.has-art i { display: none; }
.mp-cover.has-art { border-color: transparent; background-color: transparent; }

/* Info column */
.mp-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mp-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}
.mp-artist {
    font-size: 11.5px;
    color: rgba(255,255,255,0.55);
    letter-spacing: -0.005em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* Progress — large hit area, visible bar 4px, always grabbable */
.mp-progress {
    position: relative;
    height: 22px;
    margin-top: 2px;
    cursor: pointer;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    display: flex;
    align-items: center;
}
.mp-progress::before {
    content: "";
    position: absolute;
    left: 0; right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    background: rgba(255,255,255,0.12);
    border-radius: 999px;
    transition: height .15s cubic-bezier(0.16, 1, 0.3, 1);
}
.mp-progress-fill {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    width: 0%;
    background: rgba(255,255,255,0.85);
    border-radius: 999px;
    transition: width .1s linear, height .15s cubic-bezier(0.16, 1, 0.3, 1), background .15s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}
.mp-progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 12px; height: 12px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.5), 0 0 0 0 rgba(255,255,255,0);
    transform: translate(-50%, -50%) scale(0.85);
    opacity: 0;
    transition: opacity .15s cubic-bezier(0.16, 1, 0.3, 1), transform .15s cubic-bezier(0.16, 1, 0.3, 1), box-shadow .15s cubic-bezier(0.16, 1, 0.3, 1), left .1s linear;
    pointer-events: none;
}
.mp-progress:hover .mp-progress-thumb,
.mp-progress.mp-dragging .mp-progress-thumb {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.mp-progress.mp-dragging::before { height: 6px; }
.mp-progress.mp-dragging .mp-progress-fill { height: 6px; background: #fff; }
.mp-progress.mp-dragging .mp-progress-thumb {
    transform: translate(-50%, -50%) scale(1.4);
    box-shadow: 0 2px 10px rgba(0,0,0,0.6), 0 0 0 8px rgba(255,255,255,0.10);
}

/* On mobile keep thumb visible to make it obvious it's draggable */
@media (max-width: 1023px) {
    .mp-progress-thumb { opacity: 1; transform: translate(-50%, -50%) scale(0.9); }
}

.mp-time {
    display: flex;
    justify-content: space-between;
    font-size: 10.5px;
    color: rgba(255,255,255,0.40);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.005em;
    line-height: 1;
    margin-top: 1px;
}

/* Controls */
.mp-controls {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
.mp-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: background .15s cubic-bezier(0.16, 1, 0.3, 1), transform .15s cubic-bezier(0.16, 1, 0.3, 1), color .15s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-tap-highlight-color: transparent;
}
.mp-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.mp-btn:active { transform: scale(0.92); }
.mp-play-btn {
    background: #fff;
    color: #000;
    width: 40px; height: 40px;
    font-size: 14px;
}
.mp-play-btn:hover { background: #f2f2f2; color: #000; }
.mp-play-btn:active { transform: scale(0.94); }
.mp-close {
    color: rgba(255,255,255,0.45);
    font-size: 13px;
}
.mp-close:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

/* Body padding when player visible — make sure bottom-nav and player don't overlap content */
body.has-mini-player { padding-bottom: 92px; }
@media (max-width: 1023px) {
    body.has-mini-player { padding-bottom: 152px; }
}

/* Loading state on play button */
.mp-play-btn.loading i { animation: mp-spin .8s linear infinite; }
@keyframes mp-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
