/* ── Design tokens ──────────────────────────────────────────────────────────── */
:root {
    --accent:       #2563eb;
    --accent-hover: #1d4ed8;
    --danger:       #dc2626;
    --bg:           #f1f5f9;
    --surface:      #ffffff;
    --border:       #e2e8f0;
    --text:         #1e293b;
    --text-muted:   #64748b;
    --header-bg:    #1e293b;
    --radius:       8px;
    --shadow-sm:    0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
    --shadow-hover: 0 4px 12px rgba(0,0,0,.12);
    --font:         system-ui, -apple-system, sans-serif;
}

/* ── Base ───────────────────────────────────────────────────────────────────── */
html {
    overflow-y: scroll;       /* fallback: always reserve scrollbar space */
    scrollbar-gutter: stable; /* modern: reserve space without showing track */
}

body {
    font-family: var(--font);
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
}

h1 { margin-top: 0; }

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */
header {
    background: var(--header-bg);
    color: #fff;
    padding: 0.75rem 1rem;
    text-align: center;
}

header h1 {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0 0 0.5rem;
}

header h2 {
    font-size: 1rem;
    font-weight: 400;
    margin: 0.2rem 0;
    color: rgba(255,255,255,0.75);
}

/* ── Container ──────────────────────────────────────────────────────────────── */
.container {
    max-width: 800px;
    margin: 1.5rem auto;
    padding: 0 1rem 2rem;
}

.container--wide {
    max-width: 1200px;
}

/* ── Admin button component ─────────────────────────────────────────────────── */
.btn { display:inline-block; padding:.35rem .8rem; border-radius:4px; border:1px solid #ccc;
       background:#fff; cursor:pointer; font-size:.85rem; text-decoration:none; color:#333; }
.btn-primary { background:#0d6efd; color:#fff; border-color:#0d6efd; }
.btn-danger  { background:#dc3545; color:#fff; border-color:#dc3545; }
.btn-sm { padding:.2rem .55rem; font-size:.78rem; }
.btn:disabled { opacity:.35; cursor:default; pointer-events:none; }

/* ── Season headings ────────────────────────────────────────────────────────── */
.season-heading {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 2rem 0 0.75rem;
    padding-left: 0.6rem;
    border-left: 3px solid var(--accent);
}

/* ── Concert cards (homepage) ───────────────────────────────────────────────── */
.concert-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.concert-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    color: var(--text);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.concert-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    text-decoration: none;
    color: var(--text);
}

.concert-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.concert-card-title {
    font-weight: 600;
    font-size: 0.975rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.concert-card-meta {
    font-size: 0.825rem;
    color: var(--text-muted);
}

.concert-card-arrow {
    color: var(--text-muted);
    font-size: 1rem;
    flex-shrink: 0;
    margin-left: 1rem;
    transition: color 0.15s;
}

.concert-card:hover .concert-card-arrow {
    color: var(--accent);
}

.concert-card--placeholder {
    opacity: 0.55;
    cursor: default;
}

.concert-card--placeholder .concert-card-title {
    font-style: italic;
}

/* ── Track cards (concert page) ─────────────────────────────────────────────── */
.track-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 1.25rem 0;
}

.track-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 0.85rem 1rem;
}

.track-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.track-card audio {
    width: 100%;
    display: block;
}

/* ── Buttons / Nav ──────────────────────────────────────────────────────────── */
.back-button,
.nav-button {
    display: inline-block;
    padding: 0.45rem 1rem;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s;
}

.back-button:hover,
.nav-button:hover {
    background: var(--accent-hover);
    text-decoration: none;
    color: #fff;
}

.concert-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.75rem 0;
    gap: 0.5rem;
}

.concert-nav .nav-button:only-child {
    margin-left: auto;
}

.download-button {
    display: block;
    text-align: center;
    padding: 0.6rem 1.25rem;
    border: 2px solid var(--accent);
    color: var(--accent);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.download-button:hover {
    background: var(--accent);
    color: #fff;
    text-decoration: none;
}

/* ── Search bar in header ───────────────────────────────────────────────────── */
.search-bar {
    margin-top: 0.6rem;
}

.search-bar input {
    width: 100%;
    max-width: 480px;
    padding: 0.45rem 1rem;
    font-size: 0.9rem;
    font-family: var(--font);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius);
    background: rgba(255,255,255,0.1);
    color: #fff;
    outline: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.search-bar input::placeholder {
    color: rgba(255,255,255,0.5);
}

.search-bar input:focus {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.4);
}

/* ── Search modal overlay ───────────────────────────────────────────────────── */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8vh;
}

.search-modal.hidden {
    display: none;
}

.search-modal-content {
    background: var(--surface);
    border-radius: var(--radius);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-hover);
}

.search-modal-header {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    gap: 0.5rem;
}

.search-modal-header input {
    flex: 1;
    font-size: 1.05rem;
    font-family: var(--font);
    padding: 0.4rem;
    border: none;
    outline: none;
    color: var(--text);
}

.search-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 0.25rem;
    line-height: 1;
    transition: color 0.15s;
}

.search-close:hover {
    color: var(--text);
}

/* ── Search results ─────────────────────────────────────────────────────────── */
#search-results {
    overflow-y: auto;
    padding: 0.5rem 1rem 1rem;
}

.search-section-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 1rem 0 0.5rem;
    font-weight: 600;
}

.search-result-item {
    padding: 0.6rem 0.75rem;
    border-radius: calc(var(--radius) - 2px);
    margin-bottom: 2px;
}

.search-result-item:hover {
    background: var(--bg);
}

a.search-result-item {
    display: block;
    color: inherit;
    text-decoration: none;
}

a.search-result-item:hover {
    text-decoration: none;
}

.search-result-title {
    font-weight: 500;
    color: var(--text);
}

.search-result-meta {
    font-size: 0.825rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.search-result-meta a {
    color: var(--accent);
}

.search-result-id3 {
    font-style: italic;
    color: var(--text-muted);
}

.search-no-results {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem 0;
}

/* ── Track result layout ────────────────────────────────────────────────────── */
.search-result-track-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.search-result-track-info {
    flex: 1;
    min-width: 0;
}

/* ── Play button ────────────────────────────────────────────────────────────── */
.search-play-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    transition: background 0.15s;
}

.search-play-btn:hover {
    background: var(--accent-hover);
}

.search-play-btn.playing {
    background: var(--danger);
}

/* ── Match highlighting ─────────────────────────────────────────────────────── */
mark {
    background: #fef9c3;
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}

/* ── Loading spinner ────────────────────────────────────────────────────────── */
.search-loading {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

.search-loading.hidden {
    display: none;
}

.search-loading::after {
    content: '';
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: search-spin 0.6s linear infinite;
}

@keyframes search-spin {
    to { transform: rotate(360deg); }
}

/* ── Utility ────────────────────────────────────────────────────────────────── */
.hidden {
    display: none;
}
