/* musicPlayer.css - Reusable list player (Deezer 30s preview) */

/* ---- Player modal layout (flex column so the queue can flex-grow) ---- */
.mp-modal-dialog { max-width: 720px; }
.mp-modal-content { max-height: 92vh; }
.mp-body { min-height: 0; flex: 1 1 auto; overflow: hidden; }

/* Top header bar — close button lives here, never overlaps the stage */
.mp-header {
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
    background: #111;
}

/* ---- Player stage ---- */
.mp-stage {
    background: #111;
    flex-shrink: 0;
}

/* Compact stage: art | title/artist + scrub | transport */
.mp-deezer-stage {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.625rem 0.875rem;
    background: #111;
}
.mp-deezer-art {
    width: 56px; height: 56px; border-radius: 4px;
    object-fit: cover; flex-shrink: 0;
    background: #222;
}
.mp-deezer-info { flex-grow: 1; min-width: 0; }
.mp-deezer-info .mp-now-title  { font-weight: 600; color: #fff; font-size: 0.95rem; line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-deezer-info .mp-now-artist { color: rgba(255,255,255,0.6); font-size: 0.8125rem; line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-deezer-progress {
    display: flex; align-items: center; gap: 0.5rem;
    margin-top: 0.35rem;
}
/* Inline transport controls beside the deezer info */
.mp-deezer-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.mp-deezer-bar {
    flex-grow: 1;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
}
.mp-deezer-bar-fill {
    height: 100%;
    background: #EF5466;
    width: 0%;
    transition: width 0.1s linear;
}
.mp-deezer-time {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    min-width: 70px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ---- Coverage banner ---- */
.mp-coverage-banner {
    background: rgba(255,193,7,0.12);
    color: rgba(255,255,255,0.78);
    border-top: 1px solid rgba(255,255,255,0.06);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 0.75rem;
    padding: 0.25rem 0.875rem;
    flex-shrink: 0;
}

/* ---- Queue (grows to fill remaining space) ---- */
.mp-queue {
    overflow-y: auto;
    border-top: 1px solid rgba(255,255,255,0.1);
    flex-grow: 1;
    min-height: 0;
}
.mp-queue-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    color: rgba(255,255,255,0.7);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.mp-queue-item:hover { background: rgba(255,255,255,0.06); }
.mp-queue-item.mp-active {
    background: rgba(13,110,253,0.25);
    color: #fff;
}
.mp-queue-item.mp-unplayable {
    opacity: 0.45;
    cursor: not-allowed;
}
.mp-queue-num {
    width: 28px; text-align: center; flex-shrink: 0;
    font-size: 0.8125rem; opacity: 0.6;
    font-variant-numeric: tabular-nums;
}
.mp-active .mp-queue-num { opacity: 1; }
.mp-queue-art {
    width: 32px; height: 32px; border-radius: 4px;
    object-fit: cover; flex-shrink: 0;
    background: #222;
}
.mp-queue-text {
    flex-grow: 1; min-width: 0;
    overflow: hidden;
}
.mp-queue-title {
    font-size: 0.875rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mp-queue-artist {
    font-size: 0.75rem; opacity: 0.65;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mp-queue-tag {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.55);
    flex-shrink: 0;
}
.mp-queue-dur {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.55);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
    min-width: 2.5rem;
    text-align: right;
}

/* Per-row actions (rating badge + Add-to-list button). Sits between the
   title/artist text and the duration column. */
.mp-queue-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}
.mp-queue-list-btn {
    padding: 0.15rem 0.45rem;
    line-height: 1;
}

/* Artist name links (queue rows + now-playing stage). Inherit color from the
   surrounding row so the link doesn't break the muted-text look, but
   underline on hover so it reads as clickable. */
.mp-queue-artist-link,
.mp-now-artist-link {
    color: inherit;
    text-decoration: none;
}
.mp-queue-artist-link:hover,
.mp-now-artist-link:hover {
    color: #fff;
    text-decoration: underline;
}

/* ---- Player transport controls ---- */
.mp-ctrl-side {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    line-height: 1;
}
.mp-ctrl-main {
    width: 48px;
    height: 48px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.6rem;
    line-height: 1;
}

/* ---- Trigger button (when attached to a list toolbar) ---- */
.mp-trigger-btn {
    /* uses Bootstrap btn-sm btn-outline-success for now — keep for future tweaks */
}

/* ---- Mobile: stack the deezer stage so transport controls get their own row ---- */
@media (max-width: 540px) {
    .mp-modal-content { max-height: 100vh; }

    /* Spotify large embed shrinks slightly on narrow screens */
    .mp-stage iframe { height: 300px; }

    .mp-deezer-stage {
        flex-wrap: wrap;
        padding: 0.625rem 0.875rem;
        gap: 0.625rem;
    }
    .mp-deezer-art { width: 48px; height: 48px; }
    .mp-deezer-info { flex: 1 1 0; min-width: 0; }
    .mp-deezer-controls {
        flex: 1 1 100%;
        justify-content: center;
        gap: 1rem;
        margin-top: 0.25rem;
    }

    /* Hide duration tag in queue on very narrow screens to keep titles readable */
    .mp-queue-dur { min-width: auto; }
}

/* Light mode overrides */
[data-bs-theme="light"] .mp-chooser-btn {
    background: #fff;
    color: #212529;
    border-color: #dee2e6;
}
[data-bs-theme="light"] .mp-chooser-btn:hover { background: #f8f9fa; }
[data-bs-theme="light"] .mp-chooser-text .mp-chooser-meta { color: #6c757d; }
