/* music.css — the waveform player and track list in the music section of /more.
   Same layout as the old qjimbo.com player (one shared player fed by a track
   list) restyled into this site's purple glow: translucent panels, a violet
   sheen on the waveform, and the accent picked up from --accent so the section
   stays in step with the rest of the page.

   The wavesurfer canvas colours cannot come from CSS (it paints a canvas, not
   DOM), so they are passed as options in scripts/music.js. Keep the two in
   sync: --mp-wave / --mp-progress below are the same values. */

.more-sec--music {
    --mp-glow:     rgba(176, 124, 245, 0.45);
    --mp-wave:     rgba(255, 255, 255, 0.24);
    --mp-progress: #b07cf5;
    --mp-cursor:   #e879f9;
}

/* =====================  THE PLAYER  ===================== */
.mplayer {
    position: relative;
    border: 1px solid rgba(176, 124, 245, 0.32);
    border-top: 2px solid var(--accent);
    border-radius: 12px;
    padding: 18px 22px 14px;
    margin: 0 0 20px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 45%),
        radial-gradient(120% 140% at 50% 0%, rgba(176, 124, 245, 0.20) 0%, rgba(176, 124, 245, 0) 65%),
        rgba(18, 12, 26, 0.72);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5),
                0 0 26px -6px var(--mp-glow),
                inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.mplayer-head {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mplayer-cover {
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
    object-fit: cover;
    border-radius: 9px;
    border: 1px solid rgba(176, 124, 245, 0.35);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 14px -4px var(--mp-glow);
    background: rgba(0, 0, 0, 0.4);
}

.mplayer-meta { flex: 1 1 auto; min-width: 0; }

.mplayer-kicker {
    font-family: var(--font-body);
    font-size: 8.5pt;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--accent);
}
.mplayer-name {
    font-family: var(--font-display);
    font-size: 19pt;
    color: #fff;
    line-height: 1.2;
    /* Long titles truncate rather than pushing the play button off the row. */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mplayer-sub {
    font-family: var(--font-body);
    font-size: 10pt;
    color: var(--text-soft);
}

/* Play / pause. Filled with the accent so it reads as the one control here. */
.mplayer-toggle {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14pt;
    color: #fff;
    border: 1px solid rgba(176, 124, 245, 0.6);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 55%),
        linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), 0 0 18px -4px var(--mp-glow);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.mplayer-toggle:hover { transform: scale(1.06); filter: brightness(1.1); }
.mplayer-toggle:active { transform: scale(0.97); }
/* Nothing loaded yet: visibly inert rather than a control that does nothing. */
.mplayer-toggle[disabled] { opacity: 0.45; cursor: default; transform: none; filter: none; }
/* The play glyph is optically off-centre in a circle; nudge it back. */
.mplayer-toggle .fa-play { margin-left: 3px; }

/* The waveform itself. wavesurfer paints a canvas in here; the glow underneath
   is ours, so it reads as lit rather than drawn flat on the panel. */
.mplayer-wave {
    position: relative;
    margin-top: 14px;
    min-height: 72px;
    border-radius: 8px;
    padding: 4px 2px;
    background:
        linear-gradient(180deg, rgba(176, 124, 245, 0.10) 0%, rgba(176, 124, 245, 0.03) 100%);
    box-shadow: inset 0 0 22px -6px var(--mp-glow);
    cursor: pointer;
}
/* wavesurfer sets an inline height on its wrapper; keep the canvases from
   overflowing the rounded corners. */
.mplayer-wave wave { overflow: hidden !important; border-radius: 6px; }

.mplayer-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    font-family: var(--font-body);
    font-size: 9.5pt;
    color: var(--text-soft);
}
.mplayer-time { font-variant-numeric: tabular-nums; }
.mplayer-dl {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--accent);
    text-decoration: none;
}
.mplayer-dl:hover { color: #fff; }

/* =====================  THE TRACK LIST  ===================== */
.mtracks {
    list-style: none;
    margin: 0 0 16px 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.mtrack {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-family: var(--font-body);
    color: var(--text-soft);
    border: 1px solid var(--panel-edge);
    background:
        linear-gradient(180deg, var(--sheen) 0%, rgba(255,255,255,0) 40%),
        rgba(18, 12, 26, 0.55);
    transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.mtrack:hover {
    transform: translateY(-2px);
    border-color: rgba(176, 124, 245, 0.55);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), 0 0 20px -8px var(--mp-glow);
}
/* music.js marks the loaded row so the list and the player agree. */
.mtrack.is-active {
    border-color: var(--accent);
    box-shadow: 0 0 22px -6px var(--mp-glow);
    background:
        linear-gradient(180deg, rgba(176, 124, 245, 0.16) 0%, rgba(176, 124, 245, 0.03) 100%),
        rgba(18, 12, 26, 0.65);
}

.mtrack-cover {
    position: relative;
    flex: 0 0 auto;
    width: 62px;
    height: 62px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--panel-edge);
    background: rgba(0, 0, 0, 0.4);
}
.mtrack-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Play overlay, revealed on hover or while this row is the loaded one. */
.mtrack-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 15pt;
    background: rgba(20, 10, 32, 0.62);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.mtrack:hover .mtrack-play,
.mtrack.is-active .mtrack-play { opacity: 1; }

.mtrack-text { display: block; min-width: 0; }
.mtrack-name {
    display: block;
    font-size: 13pt;
    font-weight: 600;
    color: #fff;
}
.mtrack-sub {
    display: block;
    font-size: 9pt;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--accent);
    margin-top: 1px;
}
.mtrack-desc {
    display: block;
    font-size: 10.5pt;
    line-height: 1.55;
    margin-top: 7px;
}

.mtrack-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 9px;
}
.mtrack-tool {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px 3px 4px;
    border-radius: 999px;
    font-size: 8.5pt;
    color: var(--text-soft);
    border: 1px solid var(--panel-edge);
    background: rgba(255, 255, 255, 0.05);
}
.mtrack-tool img { width: 16px; height: 16px; border-radius: 3px; }

.mlicense {
    font-size: 9.5pt;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}
.mlicense a { color: var(--accent); }
.mlicense a:hover { color: #fff; }

@media (max-width: 700px) {
    .mplayer { padding: 14px 15px 12px; }
    .mplayer-name { font-size: 16pt; }
    .mplayer-cover { width: 46px; height: 46px; }
    .mtrack { padding: 12px; gap: 12px; }
    .mtrack-cover { width: 50px; height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
    .mtrack, .mplayer-toggle, .mtrack-play { transition: none; }
    .mtrack:hover, .mplayer-toggle:hover { transform: none; }
}
