/* ==========================================================
   Modern Persistent Player — styles
   Self-contained, dark glass dock fixed to the bottom of the
   viewport. Loaded automatically by player.js.
   ========================================================== */

#modern-player-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    max-width: 900px;
    margin: 0 auto;
    left: 12px;
    right: 12px;
    bottom: 12px;
    border-radius: 20px;
    background: rgba(17, 17, 22, 0.78);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 50px -16px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255,255,255,0.02) inset;
    color: #f4f4f6;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    padding: 10px 16px 14px;
    transform: translateY(140%);
    opacity: 0;
    transition: transform .35s cubic-bezier(.22,1,.36,1), opacity .3s ease;
    pointer-events: none;
}

#modern-player-dock.mp-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

#modern-player-dock.mp-hidden {
    display: none;
}

#modern-player-dock.mp-loading .mp-art-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    border: 2px solid transparent;
    border-top-color: rgba(255,255,255,0.85);
    animation: mp-spin .8s linear infinite;
}

@keyframes mp-spin { to { transform: rotate(360deg); } }

/* progress rail */
.mp-progress-rail {
    position: relative;
    width: 100%;
    height: 14px;
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 6px;
    touch-action: none;
}

.mp-progress-rail::before {
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.14);
}

.mp-progress-fill {
    position: absolute;
    left: 0;
    height: 4px;
    border-radius: 4px;
    width: 0%;
    background: linear-gradient(90deg, #a855f7, #60a5fa);
    transition: width .08s linear;
}

.mp-progress-handle {
    position: absolute;
    left: 0%;
    width: 12px;
    height: 12px;
    margin-left: -6px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    transform: scale(0.001);
    transition: transform .15s ease;
}

.mp-progress-rail:hover .mp-progress-handle,
.mp-progress-rail:active .mp-progress-handle {
    transform: scale(1);
}

/* row layout */
.mp-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mp-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}

.mp-art-wrap {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: #26262e;
}

.mp-art {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mp-art-eq {
    position: absolute;
    left: 6px;
    bottom: 6px;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
    opacity: 0;
    transition: opacity .2s ease;
}

.mp-art-eq.mp-eq-animate { opacity: 1; }

.mp-art-eq span {
    width: 3px;
    background: #ffffff;
    border-radius: 2px;
    animation: mp-eq-bounce 1s ease-in-out infinite;
}
.mp-art-eq span:nth-child(1) { height: 40%; animation-delay: 0s; }
.mp-art-eq span:nth-child(2) { height: 100%; animation-delay: .15s; }
.mp-art-eq span:nth-child(3) { height: 65%; animation-delay: .3s; }

@keyframes mp-eq-bounce {
    0%, 100% { transform: scaleY(0.4); }
    50% { transform: scaleY(1); }
}

.mp-text { min-width: 0; }

.mp-title {
    font-size: 13.5px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-cat {
    font-size: 11.5px;
    color: rgba(244,244,246,0.55);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* controls */
.mp-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 0 0 auto;
}

.mp-btn {
    background: transparent;
    border: none;
    color: #f4f4f6;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 999px;
    transition: transform .12s ease, background .15s ease, color .15s ease;
}

.mp-btn:active { transform: scale(0.9); }

.mp-btn-ghost {
    width: 34px;
    height: 34px;
    color: rgba(244,244,246,0.75);
    flex-direction: column;
    gap: 0;
}

.mp-btn-ghost:hover { background: rgba(255,255,255,0.08); color: #fff; }

.mp-btn-label {
    font-size: 8px;
    font-weight: 800;
    margin-top: -2px;
}

.mp-btn-play {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #a855f7, #7c5cff);
    box-shadow: 0 6px 16px -4px rgba(124, 92, 255, 0.65);
}

.mp-btn-play:hover { filter: brightness(1.08); }

.mp-btn-sm { width: 28px; height: 28px; }

/* side: time + volume + close */
.mp-side {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    justify-content: flex-end;
    min-width: 0;
}

.mp-time {
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    color: rgba(244,244,246,0.65);
    min-width: 30px;
}

.mp-time-sep { color: rgba(244,244,246,0.3); font-size: 11px; }

.mp-volume {
    display: none;
    align-items: center;
    gap: 6px;
    margin-left: 4px;
}

.mp-volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 70px;
    height: 3px;
    border-radius: 3px;
    background: rgba(255,255,255,0.18);
    outline: none;
    cursor: pointer;
}

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

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

/* show volume control on wider screens only, keep dock lean on mobile */
@media (min-width: 640px) {
    .mp-volume { display: flex; }
}

@media (max-width: 480px) {
    .mp-title { font-size: 12.5px; }
    .mp-cat { font-size: 10.5px; }
    .mp-time { font-size: 10px; min-width: 24px; }
    .mp-time-sep { display: none; }
    .mp-side { gap: 5px; }
    .mp-btn-sm { width: 24px; height: 24px; }
    .mp-controls { gap: 4px; }
    /* Skip buttons are the least essential controls at this width — drop
       them so the time (and everything else in .mp-side) always has room
       instead of overflowing the dock and getting clipped by the page's
       overflow-x: hidden. Scrubbing is still available via the progress rail. */
    #mp-back15, #mp-fwd15 { display: none; }
    #modern-player-dock { left: 8px; right: 8px; bottom: 8px; padding: 8px 12px 12px; }
}

@media (max-width: 360px) {
    .mp-cat { display: none; }
}
