/* ==========================================================================
   Your Music Zone (#/me)

   Uses the existing app tokens rather than introducing new colours, so this
   page follows the theme along with everything else.
   ========================================================================== */

.mz-page {
    padding: 24px 0 120px;
    max-width: 900px;
}

.mz-page h1 {
    font-size: clamp(1.8rem, 5vw, 2.6rem);
    margin: 0 0 6px;
    letter-spacing: -0.02em;
}

.mz-sub {
    color: var(--text-secondary, #b3b3b3);
    margin: 0 0 28px;
    font-size: 0.92rem;
}

.mz-note {
    color: var(--text-secondary, #b3b3b3);
    font-size: 0.85rem;
    margin: 10px 0 0;
}

/* ── summary cards ─────────────────────────────────────────────────────── */

.mz-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.mz-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px;
    border-radius: 10px;
    background: var(--bg-elevated, #181818);
}

.mz-card-value {
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    /* Digits line up across the four cards. */
    font-variant-numeric: tabular-nums;
}

.mz-card-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary, #b3b3b3);
}

/* ── sections ──────────────────────────────────────────────────────────── */

.mz-section { margin-top: 40px; }

.mz-section h2 {
    font-size: 1.15rem;
    margin: 0 0 14px;
}

.mz-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.mz-section-head h2 { margin: 0; }

/* ── song rows ─────────────────────────────────────────────────────────── */

.mz-list {
    display: flex;
    flex-direction: column;
}

.mz-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.mz-row:hover { background: var(--bg-elevated, #181818); }

.mz-row.is-removed {
    opacity: 0.4;
    /* Kept in place rather than removed: a row vanishing under the cursor makes
       the next click land on something the user did not aim at. */
    pointer-events: none;
}

.mz-rank {
    width: 22px;
    text-align: right;
    color: var(--text-secondary, #b3b3b3);
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.mz-row img {
    width: 44px;
    height: 44px;
    border-radius: 5px;
    object-fit: cover;
    flex-shrink: 0;
}

.mz-row-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.mz-row-title,
.mz-row-sub {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mz-row-sub {
    font-size: 0.8rem;
    color: var(--text-secondary, #b3b3b3);
}

.mz-row-stat {
    font-size: 0.8rem;
    color: var(--text-secondary, #b3b3b3);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.mz-skip-rate { color: var(--warning, #e0a458); }

/* Holds the column width where a row has no remove button, so the stat column
   does not jump between rows. */
.mz-row-spacer {
    width: 32px;
    flex-shrink: 0;
}

/* ── artist chips ──────────────────────────────────────────────────────── */

.mz-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mz-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--border, #2a2a2a);
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

.mz-chip:hover { background: var(--bg-elevated, #181818); }

.mz-chip span {
    color: var(--text-secondary, #b3b3b3);
    font-variant-numeric: tabular-nums;
}

/* ── 30-day activity ───────────────────────────────────────────────────── */

.mz-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 90px;
    padding: 8px;
    border-radius: 10px;
    background: var(--bg-elevated, #181818);
}

.mz-bar {
    flex: 1;
    min-height: 2px;
    height: var(--h, 2%);
    border-radius: 2px 2px 0 0;
    background: var(--accent, #1db954);
}

.mz-bar.is-empty {
    background: var(--border, #2a2a2a);
    height: 2px;
}

/* ── attribution on playlist rows ──────────────────────────────────────── */

.added-by {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary, #b3b3b3);
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid var(--border, #2a2a2a);
    white-space: nowrap;
    flex-shrink: 0;
}

/* The badge rides in .song-row-main so it can reuse that flex row; pushing it
   to the far edge keeps it in one lane down the list instead of butting up
   against titles of every different length. */
.song-row-main .added-by {
    margin-left: auto;
}

@media (max-width: 640px) {
    /* The playlist row is already tight on a phone; the label is a nicety. */
    .added-by { display: none; }

    .mz-cards { grid-template-columns: repeat(2, 1fr); }
    .mz-card-value { font-size: 1.4rem; }
    .mz-bars { height: 64px; }
}

@media (prefers-reduced-motion: reduce) {
    .mz-row { transition: none; }
}

/* ── drag-to-reorder ───────────────────────────────────────────────────── */

.song-row.draggable {
    /* grab, not move: the row is picked up, and the cursor is the only hint
       that it can be, since a drag handle would cost a grid column. */
    cursor: grab;
}

.song-row.dragging {
    opacity: 0.4;
    cursor: grabbing;
}

/* ── undo toast ────────────────────────────────────────────────────────── */

.notification.undo-toast {
    display: flex;
    align-items: center;
    gap: 14px;
}

.undo-toast .undo-btn {
    background: none;
    border: 1px solid var(--border, #2a2a2a);
    border-radius: 999px;
    color: var(--text-primary, #fff);
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}

.undo-toast .undo-btn:hover {
    border-color: var(--text-primary, #fff);
}

@media (prefers-reduced-motion: reduce) {
    .song-row.dragging { opacity: 0.6; }
}
