/* css/trend-music.css - Trend Music. Dark by design (slate-900, like /preturi); Shorts red = top places
   and "new", emerald = climbing, rose = falling. */

:root {
    --st-bg: #0f172a;
    --st-panel: #1e293b;
    --st-panel-2: #253147;
    --st-border: #334155;
    --st-text: #e2e8f0;
    --st-muted: #94a3b8;
    --st-red: #ff3355;
    --st-red-soft: rgba(255, 51, 85, .14);
    --st-violet: #a78bfa;
    --st-violet-soft: rgba(167, 139, 250, .14);
    --st-green: #10b981;
    --st-green-soft: rgba(16, 185, 129, .14);
    --st-rose: #fb7185;
}

/* clip, not hidden: the site-wide `body { overflow-x: hidden }` would make <body> a dead scroll container */
.st-body, body.st-body#page-top, body.st-body.dark-theme {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--st-bg); color: var(--st-text); min-height: 100vh; overflow-x: clip;
}
.st-body #mainNav { background: rgba(15, 23, 42, .92); }
.st-body a { color: #fda4af; }
.st-body a:hover { color: #fff; }

.st-main { flex: 1; padding-top: 96px; padding-bottom: 64px; }
.st-main > .container { max-width: 880px; }

/* ── header ─────────────────────────────────────────────────────────────────────────── */
.st-header { padding: 18px 0 8px; }
.st-title-row { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.st-logo {
    flex: 0 0 auto; width: 56px; height: 56px; display: grid; place-items: center;
    font-size: 1.6rem; color: #fff; border-radius: 14px;
    background: linear-gradient(135deg, #ff0033, #7c3aed);
    box-shadow: 0 0 24px rgba(255, 0, 51, .3);
}
.st-header h1 { margin: 2px 0 6px; font-size: 2rem; font-weight: 800; letter-spacing: -.02em; color: #fff; }
.st-lead { margin: 0; color: var(--st-muted); font-size: .95rem; line-height: 1.55; }

.st-tab-rows { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.st-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--st-panel); border: 1px solid var(--st-border); }
.st-tab {
    border: 0; border-radius: 9px; padding: 7px 14px; background: transparent; color: var(--st-muted);
    font-weight: 700; font-size: .9rem; cursor: pointer;
}
.st-tab.is-active { background: var(--st-red); color: #fff; }
.st-tab[data-sursa="tiktok"].is-active { background: linear-gradient(135deg, #25f4ee, #fe2c55); color: #fff; }
.st-tabs[hidden], .st-admin-fields label[hidden] { display: none; }
.st-tab:focus-visible, .st-chip:focus-visible, .st-act:focus-visible, .st-btn:focus-visible { outline: 2px solid var(--st-violet); outline-offset: 2px; }

.st-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.st-search {
    flex: 1 1 240px; display: flex; align-items: center; gap: 10px; padding: 0 14px; margin: 0;
    border: 1px solid var(--st-border); border-radius: 12px; background: var(--st-panel); color: var(--st-muted);
}
.st-search:focus-within { border-color: var(--st-violet); }
.st-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--st-text); padding: 10px 0; font-size: .95rem; }
.st-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.st-chip {
    border: 1px solid var(--st-border); border-radius: 999px; padding: 6px 12px; background: var(--st-panel);
    color: var(--st-text); font-size: .85rem; font-weight: 600; cursor: pointer;
}
.st-chip.is-active { border-color: var(--st-violet); background: var(--st-violet-soft); color: #fff; }
.st-day { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--st-muted); font-size: .85rem; }
.st-day select, .st-admin select, .st-admin input[type="date"] {
    border: 1px solid var(--st-border); border-radius: 10px; padding: 7px 10px; background: var(--st-panel); color: var(--st-text);
    color-scheme: dark;
}
.st-meta-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.st-meta { margin: 0; color: var(--st-muted); font-size: .85rem; }
.st-meta-row [hidden] { display: none; }
.st-note { margin: 6px 0 0; color: var(--st-muted); font-size: .8rem; line-height: 1.5; }
.st-note:empty { display: none; }

/* ── the player: bottom-right card on a computer, full-width strip on a phone ───────────── */
.st-player {
    position: fixed; right: 16px; bottom: 16px; z-index: 1400; width: 380px; max-width: calc(100% - 32px);
    border-radius: 16px; overflow: hidden; background: #0b1120; border: 1px solid var(--st-border);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .5);
}
.st-player[hidden] { display: none; }
.st-player-video { position: relative; width: 100%; aspect-ratio: 16 / 9; min-height: 200px; background: #000; }
.st-player-video iframe, .st-player-video > div { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.st-player-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.st-player-info { flex: 1; min-width: 0; }
.st-player-title { font-weight: 700; color: #fff; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-player-artist { color: var(--st-muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-player-ctrl { display: flex; gap: 4px; }
body.st-playing .st-main { padding-bottom: 340px; }
body.st-playing .st-toast { bottom: 330px; }

.st-info.is-playable { cursor: pointer; }
.st-act-play { border-color: rgba(255, 51, 85, .55); background: var(--st-red-soft); color: #fff; }
.st-song.is-playing { border-color: var(--st-red); box-shadow: 0 0 0 1px var(--st-red) inset; }
.st-song.is-playing .st-act-play { background: var(--st-red); }

/* ── the chart ──────────────────────────────────────────────────────────────────────── */
.st-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.st-song {
    display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 14px; background: var(--st-panel); border: 1px solid var(--st-border);
}
.st-song.is-top { border-color: rgba(255, 51, 85, .45); background: linear-gradient(90deg, rgba(255, 51, 85, .10), var(--st-panel) 55%); }
.st-rank { display: grid; justify-items: center; gap: 2px; font-size: 1.35rem; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.st-song.is-top .st-rank { color: var(--st-red); }
.st-move { font-size: .7rem; font-weight: 800; color: var(--st-muted); line-height: 1; }
.st-move.is-new { color: #fff; background: var(--st-red); border-radius: 6px; padding: 2px 5px; }
.st-move.is-up { color: var(--st-green); }
.st-move.is-down { color: var(--st-rose); }
.st-info { min-width: 0; }
.st-song-title { font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-song-artist { color: var(--st-muted); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.st-tag:empty { display: none; }
.st-tag { font-size: .72rem; padding: 2px 7px; border-radius: 999px; background: var(--st-panel-2); color: var(--st-muted); }
.st-actions { display: flex; gap: 4px; }
.st-act {
    width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px;
    border: 1px solid var(--st-border); background: var(--st-panel-2); color: var(--st-text); cursor: pointer;
}
.st-body a.st-act { color: var(--st-text); }
.st-act:hover, .st-body a.st-act:hover { border-color: var(--st-red); color: #fff; }

.st-empty { margin-top: 14px; padding: 28px 18px; text-align: center; color: var(--st-muted); border: 1px dashed var(--st-border); border-radius: 14px; }
.st-source { margin: 18px 0 0; color: var(--st-muted); font-size: .8rem; line-height: 1.55; }

/* ── updating the chart ─────────────────────────────────────────────────────────────── */
.st-admin { margin-top: 28px; border-top: 1px solid var(--st-border); padding-top: 14px; }
.st-admin-toggle { border: 0; background: transparent; color: var(--st-muted); font-size: .85rem; padding: 4px 0; cursor: pointer; }
.st-admin-toggle:hover { color: #fff; }
.st-admin-body { margin-top: 10px; padding: 14px; border-radius: 14px; background: var(--st-panel); border: 1px solid var(--st-border); display: grid; gap: 12px; }
.st-hint { margin: 0; color: var(--st-muted); font-size: .82rem; line-height: 1.5; }
.st-admin-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.st-admin-fields label { display: grid; gap: 4px; margin: 0; color: var(--st-muted); font-size: .8rem; }
.st-account { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.st-who { font-size: .85rem; color: var(--st-muted); }
.st-who.is-admin { color: var(--st-green); }
.st-admin textarea {
    width: 100%; border: 1px solid var(--st-border); border-radius: 12px; padding: 10px 12px;
    background: var(--st-bg); color: var(--st-text); font: .85rem/1.45 ui-monospace, Consolas, monospace; resize: vertical;
}
.st-btn {
    display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--st-violet); border-radius: 10px;
    padding: 8px 14px; background: var(--st-violet-soft); color: #fff; font-weight: 700; font-size: .88rem; cursor: pointer; text-decoration: none;
}
.st-body a.st-btn { color: #fff; }
.st-btn-ghost { border-color: var(--st-border); background: var(--st-panel-2); }
.st-btn-primary { border-color: var(--st-red); background: var(--st-red); }
.st-btn:disabled { opacity: .55; cursor: progress; }
.st-file { position: relative; overflow: hidden; margin: 0; }
.st-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.st-preview-wrap { max-height: 420px; overflow: auto; border: 1px solid var(--st-border); border-radius: 12px; }
.st-preview { width: 100%; border-collapse: collapse; font-size: .85rem; }
.st-preview th { position: sticky; top: 0; background: var(--st-panel-2); color: var(--st-muted); text-align: left; padding: 6px 8px; font-weight: 600; }
.st-preview td { padding: 3px 6px; border-top: 1px solid var(--st-border); }
.st-preview td:first-child { color: var(--st-muted); text-align: right; width: 34px; }
.st-preview input { width: 100%; min-width: 90px; border: 1px solid transparent; border-radius: 6px; padding: 4px 6px; background: transparent; color: var(--st-text); }
.st-preview input:focus { border-color: var(--st-violet); outline: 0; background: var(--st-bg); }
.st-del { border: 0; background: transparent; color: var(--st-rose); font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 2px 6px; }

.st-toast {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1500; max-width: calc(100% - 32px);
    padding: 10px 16px; border-radius: 12px; background: #111827; color: #fff; border: 1px solid var(--st-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .4); font-size: .9rem;
}
.st-powered { text-align: center; margin: 32px 0 0; color: var(--st-muted); font-size: .8rem; }

@media (max-width: 575.98px) {
    .st-header h1 { font-size: 1.6rem; }
    .st-song { grid-template-columns: 40px 1fr; }
    .st-actions { grid-column: 1 / -1; justify-content: flex-end; }
    .st-act { width: 34px; height: 34px; }
    .st-player { right: 0; bottom: 0; width: 100%; max-width: 100%; border-radius: 16px 16px 0 0; }
    .st-player-video { aspect-ratio: auto; height: 200px; }
    body.st-playing .st-main { padding-bottom: 280px; }
    body.st-playing .st-toast { bottom: 270px; }
}
