/* Icecast AZ1 status and admin pages.
 * Shared by the public pages (webroot) and the admin pages (adminroot), which link it as /style.css.
 * Light and dark themes follow the browser's colour scheme preference.
 */

:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-2: #f0f2f5;
    --border: #dfe3e8;
    --text: #1b1f24;
    --muted: #5f6b7a;
    --accent: #0b6bcb;
    --accent-hover: #0957a6;
    --accent-soft: #e6f0fb;
    --danger: #c62828;
    --danger-soft: #fdecec;
    --ok: #1e7d3c;
    --ok-soft: #e7f5ec;
    --header-bg: #14181d;
    --header-text: #f2f4f7;
    --header-muted: #a3adb9;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
    --radius: 10px;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1216;
        --surface: #171b21;
        --surface-2: #1e232b;
        --border: #2a313b;
        --text: #e6e9ed;
        --muted: #98a2b0;
        --accent: #5aa9f5;
        --accent-hover: #86c0f8;
        --accent-soft: #15283c;
        --danger: #f07070;
        --danger-soft: #3a1b1d;
        --ok: #5fcf86;
        --ok-soft: #16301f;
        --header-bg: #0a0c0f;
        --shadow: 0 1px 2px rgba(0, 0, 0, .4);
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

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

/* ---------------------------------------------------------------- header */

.topbar {
    background: var(--header-bg);
    color: var(--header-text);
}
.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 24px;
    min-height: 56px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--header-text);
    font-weight: 650;
    font-size: 17px;
    letter-spacing: .2px;
}
.brand:hover { color: var(--header-text); text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.brand small {
    color: var(--header-muted);
    font-weight: 500;
    font-size: 13px;
}
.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-left: auto;
}
.nav a {
    color: var(--header-muted);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}
.nav a:hover, .nav a.active {
    color: var(--header-text);
    background: rgba(255, 255, 255, .08);
    text-decoration: none;
}

/* ---------------------------------------------------------------- layout */

.main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}
.page-title {
    margin: 0 0 20px;
    font-size: 22px;
    font-weight: 650;
}
.page-title small {
    color: var(--muted);
    font-weight: 500;
    font-size: 15px;
    margin-left: 6px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}
.card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}
.card-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 650;
    word-break: break-all;
}
.card-header .sub {
    color: var(--muted);
    font-size: 13px;
}
.card-body { padding: 16px 18px; }
.card-body > :first-child { margin-top: 0; }
.card-body > :last-child { margin-bottom: 0; }

.empty {
    color: var(--muted);
    text-align: center;
    padding: 40px 16px;
}

/* ---------------------------------------------------------------- now playing / pills */

.now-playing {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 14px;
    word-break: break-word;
}
.now-playing .label {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 2px;
}

.pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: var(--surface-2);
    color: var(--muted);
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.off { background: var(--danger-soft); color: var(--danger); }

/* ---------------------------------------------------------------- stat tiles */

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.tile {
    background: var(--surface-2);
    border-radius: 8px;
    padding: 10px 14px;
}
.tile .v {
    font-size: 22px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}
.tile .k {
    color: var(--muted);
    font-size: 12px;
}

/* ---------------------------------------------------------------- key/value lists */

.kv {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.kv th, .kv td {
    text-align: left;
    vertical-align: top;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
}
.kv tr:last-child th, .kv tr:last-child td { border-bottom: 0; }
.kv th {
    width: 220px;
    padding-right: 16px;
    color: var(--muted);
    font-weight: 500;
}
.kv td {
    word-break: break-word;
    font-variant-numeric: tabular-nums;
}
.kv.compact th { width: 190px; font-family: var(--mono); font-size: 13px; }

details.more { margin-top: 12px; }
details.more summary {
    cursor: pointer;
    color: var(--accent);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

/* ---------------------------------------------------------------- data tables */

.table-wrap { overflow-x: auto; }
.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.data th, .data td {
    text-align: left;
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data th {
    color: var(--muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .4px;
    background: var(--surface-2);
}
.data td.wrap { white-space: normal; word-break: break-word; min-width: 220px; }
.data tr:last-child td { border-bottom: 0; }
.data tbody tr:hover td { background: var(--surface-2); }

/* ---------------------------------------------------------------- buttons and links */

.links, .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.btn, input[type="submit"], button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.3;
}
.btn:hover, input[type="submit"]:hover, button:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}
.btn.primary, input[type="submit"].primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn.primary:hover, input[type="submit"].primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.btn.small { padding: 4px 10px; font-size: 12px; }

/* ---------------------------------------------------------------- forms */

.form-grid {
    display: grid;
    gap: 14px;
    max-width: 520px;
}
.field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}
.field input[type="text"], .field input[type="password"] {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
}
.field input:focus {
    outline: 2px solid var(--accent-soft);
    border-color: var(--accent);
}
.check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

/* ---------------------------------------------------------------- messages, logs */

.notice {
    padding: 12px 16px;
    border-radius: 8px;
    background: var(--accent-soft);
    border: 1px solid var(--border);
    margin-bottom: 20px;
}
.notice.ok { background: var(--ok-soft); }
.notice.error { background: var(--danger-soft); }

.log-frame {
    display: block;
    width: 100%;
    height: 420px;
    border: 0;
    background: var(--surface-2);
}
pre.log {
    margin: 0;
    padding: 12px 14px;
    font: 12px/1.55 var(--mono);
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-all;
}
body.log-body { background: var(--surface-2); }

.footer {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px 32px;
    color: var(--muted);
    font-size: 13px;
}

/* ---------------------------------------------------------------- small screens */

@media (max-width: 640px) {
    .topbar-inner { padding-top: 8px; padding-bottom: 8px; }
    .nav { margin-left: -12px; }
    .kv th { width: 42%; }
    .kv.compact th { width: 48%; }
    .page-title { font-size: 19px; }
}
