/* ============================================================
   WA Radio Studio V2 — Global Base Styles
   Scope: all pages under /v2/
   Includes: reset, design tokens, typography, utility classes,
             button system, form inputs, modals, shared cards
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
    /* Backgrounds */
    --bg:       #0c0f14;
    --panel:    #12161e;
    --panel-2:  #181d27;
    --panel-3:  #1e2333;

    /* Borders */
    --border:   #1f2635;
    --border-2: #293044;

    /* Text */
    --text:       #e8edf5;
    --text-muted: #8a99ab;
    --text-dim:   #4f5f70;

    /* Live / on-air */
    --red-live:   #e00c0c;
    --red-danger: #ff4d4f;

    /* Status */
    --amber:      #ffc53d;
    --green:      #52c41a;
    --blue:       #3b9eff;

    /* Deck A — blue */
    --deck-a:      #3b9eff;
    --deck-a-dim:  rgba(59, 158, 255, 0.10);
    --deck-a-glow: rgba(59, 158, 255, 0.28);

    /* Deck B — purple */
    --deck-b:      #b57bff;
    --deck-b-dim:  rgba(181, 123, 255, 0.10);
    --deck-b-glow: rgba(181, 123, 255, 0.28);

    /* Carts */
    --jingle:      #52c41a;
    --jingle-dim:  rgba(82, 196, 26, 0.10);
    --jingle-glow: rgba(82, 196, 26, 0.30);
    --bed:         #ffc53d;
    --bed-dim:     rgba(255, 197, 61, 0.10);
    --bed-glow:    rgba(255, 197, 61, 0.30);
    --sfx:         #ff7875;
    --sfx-dim:     rgba(255, 120, 117, 0.10);
    --sfx-glow:    rgba(255, 120, 117, 0.30);

    /* VU meter gradient stops */
    --vu-green: #24b34f;
    --vu-amber: #ffb13a;
    --vu-red:   #e83d3d;

    /* Layout */
    --gap:       12px;
    --gap-lg:    20px;
    --radius:    12px;
    --radius-sm: 8px;
    --shadow:    0 4px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.50);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { color-scheme: dark; -webkit-font-smoothing: antialiased; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
}
img, svg { display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { margin: 0 0 0.5em; font-weight: 700; line-height: 1.2; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    appearance: none;
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    background: var(--panel-2);
    color: var(--text);
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, transform 0.1s, box-shadow 0.12s;
    white-space: nowrap;
    user-select: none;
}
.btn:hover:not(:disabled) {
    background: var(--panel-3);
    border-color: var(--border-2);
    transform: translateY(-1px);
}
.btn:active:not(:disabled) {
    transform: translateY(0);
}
.btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
}
.btn:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

/* Button size variants */
.btn-sm  { padding: 5px 10px; font-size: 13px; }
.btn-xs  { padding: 3px 8px;  font-size: 12px; border-radius: 6px; }
.btn-lg  { padding: 11px 20px; font-size: 16px; }

/* Button colour variants */
.btn-primary { background: var(--blue);       border-color: var(--blue);       color: #fff; }
.btn-primary:hover:not(:disabled) { background: #5aadff; border-color: #5aadff; }

.btn-danger  { background: var(--red-danger); border-color: var(--red-danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #ff6b6b; border-color: #ff6b6b; }

.btn-start   { background: #1a3a22; border-color: #2a5a34; color: #7edd9d; }
.btn-start:hover:not(:disabled) { background: #1f4429; border-color: #3a7044; }

.btn-end     { background: #3a1515; border-color: #5a2020; color: #ff8484; }
.btn-end:hover:not(:disabled) { background: #481a1a; border-color: #6a2a2a; }

.btn-ghost   { background: transparent; border-color: var(--border); color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { background: var(--panel-2); color: var(--text); border-color: var(--border-2); }

/* Play/Stop variants for decks */
.btn-play  { background: #0f3d24; border-color: #1e6638; color: #6ddda0; }
.btn-play:hover:not(:disabled)  { background: #144830; border-color: #2a7848; color: #88edb4; }
.btn-pause { background: #2e2610; border-color: #554510; color: #d4a827; }
.btn-pause:hover:not(:disabled) { background: #3a3014; border-color: #6a5514; color: #e8bf40; }
.btn-stop  { background: #2e1010; border-color: #541c1c; color: #f08080; }
.btn-stop:hover:not(:disabled)  { background: #3a1414; border-color: #682424; color: #ff9a9a; }
.btn-next  { background: var(--panel-2); border-color: var(--border-2); color: var(--text-muted); }
.btn-next:hover:not(:disabled)  { background: var(--panel-3); color: var(--text); }
.btn-load  { background: transparent; border-color: var(--border); color: var(--text-dim); }
.btn-load:hover:not(:disabled)  { background: var(--panel-2); color: var(--text-muted); }

/* ---------- Inputs ---------- */
.text-input {
    width: 100%;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.12s;
}
.text-input:focus { border-color: var(--blue); }
.text-input::placeholder { color: var(--text-dim); }

/* ---------- Shared Cards ---------- */
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-dim);
}

/* ---------- Modals ---------- */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    z-index: 1000;
    padding: 16px;
}
.modal:not([hidden]) { display: flex; }
.modal-body {
    background: var(--panel-2);
    border: 1px solid var(--border-2);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 20px;
    width: 560px;
    max-width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}
.modal-body--narrow { width: 400px; }
.modal-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}
.modal-list {
    margin: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 360px;
    overflow-y: auto;
}
.modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    justify-content: flex-end;
}

/* Track/Show list rows inside modals */
.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--panel);
}
.list-row:hover { background: var(--panel-2); }
.list-row-title { font-weight: 700; font-size: 14px; }
.list-row-sub   { font-size: 13px; color: var(--text-muted); }

/* ---------- Site Footer ---------- */
.site-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 13px;
}
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--text-muted); }

/* ---------- Utilities ---------- */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
.hint { color: var(--text-muted); font-size: 13px; }
.placeholder-msg {
    color: var(--text-dim);
    font-size: 14px;
    padding: 16px 12px;
    text-align: center;
}

/* ---------- Setup / no-config banner ---------- */
.setup-banner {
    background: #221e0a;
    border: 1px solid #5a4a12;
    border-radius: var(--radius-sm);
    color: #d4a827;
    padding: 10px 14px;
    font-size: 13px;
    margin: 12px 16px 0;
}
.setup-banner strong { color: #f5c842; }
