/* ========================================
   Music Player - musik latar dari folder "backsound" + daftar lagu +
   kontrol volume, dipakai di semua mode (Arena Cerdas, Petualang Kode, Quiz
   Kamera, Buru Gelembung, Jelajah Dunia). Yang terlihat: tombol bulat + panel
   kecil di pojok kanan bawah. Skrip: js/music-player.js
   ======================================== */

.mp-widget {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 350;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    font-family: 'Poppins', sans-serif;
}

.mp-toggle-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--border, #2a3456);
    background: linear-gradient(135deg, var(--bg-card, #1a1f3a) 0%, rgba(131, 56, 236, 0.3) 100%);
    color: var(--text-primary, #fff);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.4));
    transition: var(--transition, all 0.3s ease);
}

.mp-toggle-btn:hover {
    border-color: var(--accent, #00d9ff);
    transform: translateY(-2px);
}

.mp-toggle-btn.mp-playing {
    border-color: var(--accent, #00d9ff);
    animation: mpPulse 2.2s ease-in-out infinite;
}

@keyframes mpPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 217, 255, 0.35); }
    50% { box-shadow: 0 0 0 7px rgba(0, 217, 255, 0); }
}

.mp-panel {
    width: 290px;
    max-width: calc(100vw - 28px);
    background: linear-gradient(135deg, var(--bg-card, #1a1f3a) 0%, #241a42 100%);
    border: 2px solid var(--border-light, #3a4566);
    border-radius: 16px;
    padding: 16px 18px 16px;
    box-shadow: var(--shadow-lg, 0 16px 48px rgba(0, 0, 0, 0.5));
    animation: mpFadeIn 0.2s ease;
}

.mp-panel.hidden { display: none; }

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

.mp-panel-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted, #6b7494);
    margin-bottom: 10px;
}

/* judul lagu yang sedang diputar */
.mp-now {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary, #fff);
    line-height: 1.35;
    margin-bottom: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.mp-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.mp-ctrl-btn {
    flex: 0 0 auto;
    width: 40px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border-light, #3a4566);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary, #fff);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition-fast, all 0.15s ease);
}

.mp-ctrl-btn:hover:not(:disabled) {
    border-color: var(--accent, #00d9ff);
    transform: translateY(-1px);
}

.mp-ctrl-btn:disabled,
.mp-playpause-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.mp-playpause-btn {
    flex: 1;
    min-width: 0;
    padding: 10px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, var(--primary, #ff006e) 0%, var(--secondary, #8338ec) 100%);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: var(--transition-fast, all 0.15s ease);
    font-family: 'Poppins', sans-serif;
}

.mp-playpause-btn:hover:not(:disabled) { transform: translateY(-1px); }

.mp-seek-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.mp-seek-row input[type="range"] {
    flex: 1;
    min-width: 0;
    accent-color: var(--primary, #ff006e);
    cursor: pointer;
}

.mp-time {
    font-size: 10px;
    color: var(--text-muted, #6b7494);
    width: 30px;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.mp-time:last-child { text-align: right; }

.mp-volume-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.mp-volume-icon { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }

.mp-volume-row input[type="range"] {
    flex: 1;
    min-width: 0;
    accent-color: var(--accent, #00d9ff);
    cursor: pointer;
}

.mp-volume-value {
    font-size: 11px;
    color: var(--text-muted, #6b7494);
    width: 32px;
    text-align: right;
    flex-shrink: 0;
}

/* daftar lagu */
.mp-list-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-muted, #6b7494);
    margin-bottom: 6px;
}

.mp-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    max-height: 168px;
    overflow-y: auto;
    border: 1px solid var(--border, #2a3456);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.18);
    scrollbar-width: thin;
}

.mp-empty {
    padding: 12px;
    font-size: 11px;
    color: var(--text-muted, #6b7494);
}

.mp-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: transparent;
    color: var(--text-primary, #fff);
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
}

.mp-list li:last-child .mp-item { border-bottom: 0; }

.mp-item:hover { background: rgba(255, 255, 255, 0.07); }

.mp-item-num {
    flex: 0 0 18px;
    font-size: 10px;
    color: var(--text-muted, #6b7494);
    text-align: center;
}

.mp-item-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mp-item-eq {
    flex: 0 0 auto;
    font-size: 12px;
    opacity: 0;
    color: var(--accent, #00d9ff);
}

.mp-item--current {
    background: rgba(0, 217, 255, 0.12);
    box-shadow: inset 3px 0 0 var(--accent, #00d9ff);
}

.mp-item--current .mp-item-title { font-weight: 700; color: var(--accent, #00d9ff); }
.mp-item--current .mp-item-eq { opacity: 1; }

.mp-track-credit {
    font-size: 10px;
    color: var(--text-muted, #6b7494);
    line-height: 1.45;
    border-top: 1px solid var(--border, #2a3456);
    padding-top: 10px;
}

.mp-track-credit b { color: var(--text-secondary, #b8c0e0); }
.mp-track-credit a { color: var(--accent, #00d9ff); text-decoration: underline; text-underline-offset: 0.15em; }

@media (max-width: 480px) {
    .mp-widget { right: 14px; bottom: 14px; }
    .mp-panel { width: 262px; padding: 14px 14px 14px; }
    .mp-toggle-btn { width: 44px; height: 44px; font-size: 18px; }
}
