/* =============================================================================
   Beach Country Radio
   Coastal, minimal, one orange accent. Works light + dark, mobile-first.
   ========================================================================== */

:root {
    --accent: #f76c3a;
    --accent-soft: rgba(247, 108, 58, .14);
    --ink: #10222e;
    --ink-2: #3d5566;
    --muted: #7d939f;
    --line: #e2e8ec;
    --bg: #f7f9fa;
    --card: #ffffff;
    --deep: #0e2230;
    --deep-2: #17384b;
    --radius: 18px;
    --shadow: 0 10px 30px rgba(16, 34, 46, .10);
    --font: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ink: #eef4f7;
        --ink-2: #b9cbd6;
        --muted: #8ba2ae;
        --line: #24404f;
        --bg: #0b1a24;
        --card: #102532;
        --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    }
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

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

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

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

.site-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding: 1rem clamp(1rem, 4vw, 3rem);
    background: var(--deep); color: #fff;
}

.brand { display: flex; align-items: center; gap: .75rem; color: #fff; }
.brand:hover { text-decoration: none; }

.brand-mark {
    width: 34px; height: 34px; border-radius: 50%;
    background: radial-gradient(circle at 50% 38%, var(--accent) 0 42%, transparent 43%),
                linear-gradient(180deg, #2b5b74 0 55%, #143b4f 55% 100%);
    box-shadow: 0 0 0 2px rgba(255,255,255,.18);
    flex: 0 0 auto;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.02rem; letter-spacing: .01em; }
.brand-text small { color: #9fbccc; font-size: .78rem; }

.site-nav { display: flex; gap: 1.25rem; font-size: .92rem; }
.site-nav a { color: #cfe1ea; }
.site-nav a:hover { color: #fff; text-decoration: none; }

/* ------------------------------------------------------------------ player */

main { max-width: 980px; margin: 0 auto; padding: clamp(1rem, 4vw, 2.5rem) clamp(1rem, 4vw, 2rem) 3rem; }

.player {
    display: grid;
    grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
    gap: clamp(1.25rem, 4vw, 2.5rem);
    align-items: center;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(1.25rem, 4vw, 2rem);
}

@media (max-width: 720px) {
    .player { grid-template-columns: 1fr; text-align: center; }
    .controls { justify-content: center; }
    .times { max-width: 420px; margin-inline: auto; }
}

.player-art { position: relative; }

.player-art img {
    width: 100%; aspect-ratio: 1/1; object-fit: cover;
    border-radius: 14px; display: block;
    background: linear-gradient(160deg, var(--deep-2), var(--deep));
    box-shadow: 0 12px 28px rgba(16,34,46,.22);
}

.onair-badge {
    position: absolute; top: 12px; left: 12px;
    display: inline-flex; align-items: center; gap: .45rem;
    background: rgba(14, 34, 48, .82); color: #fff;
    font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    padding: .34rem .6rem; border-radius: 999px; backdrop-filter: blur(6px);
}

.onair-badge .dot {
    width: 8px; height: 8px; border-radius: 50%; background: #47d17c;
    box-shadow: 0 0 0 0 rgba(71, 209, 124, .7);
    animation: pulse 2s infinite;
}

.onair-badge.offline .dot { background: #c9d3d9; animation: none; box-shadow: none; }
.onair-badge.live .dot { background: var(--accent); }

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(71,209,124,.65); }
    70%  { box-shadow: 0 0 0 9px rgba(71,209,124,0); }
    100% { box-shadow: 0 0 0 0 rgba(71,209,124,0); }
}

.eyebrow {
    margin: 0 0 .35rem; color: var(--muted);
    font-size: .82rem; letter-spacing: .02em;
}

.player-body h1 {
    margin: 0 0 .3rem; font-size: clamp(1.5rem, 4.2vw, 2.15rem);
    line-height: 1.15; letter-spacing: -.015em;
}

.np-meta { margin: 0 0 1.1rem; color: var(--ink-2); font-size: 1rem; }
.np-meta .sep { color: var(--muted); margin: 0 .25rem; }

.progress {
    height: 5px; border-radius: 999px; background: var(--line);
    overflow: hidden; margin-bottom: .35rem;
}

.progress-bar {
    height: 100%; width: 0%; border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), #ffa878);
    transition: width .9s linear;
}

.times {
    display: flex; justify-content: space-between;
    font-size: .78rem; color: var(--muted); margin: 0 0 1.25rem;
    font-variant-numeric: tabular-nums;
}

.controls { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }

.play-btn {
    display: inline-flex; align-items: center; gap: .6rem;
    background: var(--accent); color: #fff; border: 0;
    padding: .8rem 1.4rem; border-radius: 999px;
    font-size: 1rem; font-weight: 600; font-family: inherit;
    cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, background .12s;
    box-shadow: 0 6px 16px rgba(247,108,58,.35);
}

.play-btn:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(247,108,58,.42); }
.play-btn:active { transform: translateY(0); }
.play-btn svg { fill: currentColor; }
.play-btn.loading { opacity: .75; cursor: progress; }

.volume { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); }
.volume svg { fill: currentColor; }

.volume input[type=range] {
    width: 110px; accent-color: var(--accent); cursor: pointer;
}

.listeners { display: inline-flex; align-items: center; gap: .4rem; color: var(--ink-2); font-size: .92rem; }
.listeners svg { fill: var(--muted); }
.listeners strong { font-variant-numeric: tabular-nums; }

.quality-note { margin: 1rem 0 0; font-size: .82rem; color: var(--muted); }

/* ------------------------------------------------------------ recent plays */

.recent { margin-top: 2.5rem; }
.recent h2 { font-size: 1.05rem; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); margin: 0 0 .9rem; }

.recent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }

.recent-list li {
    display: grid;
    grid-template-columns: 44px minmax(0, 1.4fr) minmax(0, 1fr) auto;
    align-items: center; gap: .9rem;
    background: var(--card); border-radius: 12px; padding: .55rem .8rem;
    border: 1px solid var(--line);
}

.recent-list li.empty { display: block; color: var(--muted); text-align: center; padding: 1.2rem; }
.recent-list img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.rl-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-album { color: var(--muted); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-list time { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }

@media (max-width: 620px) {
    .recent-list li { grid-template-columns: 40px minmax(0,1fr) auto; }
    .rl-album { display: none; }
}

/* -------------------------------------------------------------- catalogue */

.catalogue-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.catalogue-table th, .catalogue-table td { padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--line); font-size: .93rem; }
.catalogue-table th { background: var(--deep); color: #fff; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.catalogue-table tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.pill.heavy { background: var(--accent-soft); color: var(--accent); }
.pill.medium { background: rgba(64,145,160,.16); color: #2f7f8d; }
.pill.light { background: rgba(125,147,159,.16); color: var(--muted); }
.pill.ids { background: rgba(90,160,120,.16); color: #3d8a63; }

/* ------------------------------------------------------------------ admin */

.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.75rem; }

.stat-card {
    background: var(--card); border-radius: 14px; padding: 1.1rem 1.2rem;
    border: 1px solid var(--line); box-shadow: var(--shadow);
}

.stat-card .label { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; margin: 0 0 .3rem; }
.stat-card .value { font-size: 1.85rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-card .sub { color: var(--muted); font-size: .8rem; margin-top: .3rem; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.5rem; box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 .9rem; font-size: 1rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

.btn {
    display: inline-flex; align-items: center; gap: .4rem;
    background: var(--accent); color: #fff; border: 0; border-radius: 10px;
    padding: .55rem 1rem; font-size: .9rem; font-weight: 600; font-family: inherit; cursor: pointer;
}
.btn:hover { filter: brightness(1.05); text-decoration: none; }
.btn.secondary { background: transparent; color: var(--ink-2); border: 1px solid var(--line); }
.btn.small { padding: .35rem .7rem; font-size: .8rem; }

.flash { background: var(--accent-soft); border: 1px solid var(--accent); color: var(--ink); padding: .7rem 1rem; border-radius: 10px; margin-bottom: 1.25rem; font-size: .92rem; }

.admin-nav { display: flex; gap: .6rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.admin-nav a { padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); font-size: .88rem; }
.admin-nav a.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.admin-nav a:hover { text-decoration: none; }

.login-card { max-width: 380px; margin: 3rem auto; background: var(--card); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); border: 1px solid var(--line); }
.login-card h1 { margin: 0 0 1.25rem; font-size: 1.3rem; }
.field { display: block; margin-bottom: 1rem; }
.field span { display: block; font-size: .82rem; color: var(--muted); margin-bottom: .3rem; }
.field input { width: 100%; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 10px; font-size: 1rem; font-family: inherit; background: var(--bg); color: var(--ink); }
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.error-text { color: #d0342c; font-size: .88rem; margin: 0 0 1rem; }

.search-row { display: flex; gap: .6rem; margin-bottom: 1rem; flex-wrap: wrap; }
.search-row input { flex: 1 1 220px; padding: .55rem .8rem; border: 1px solid var(--line); border-radius: 10px; font-family: inherit; background: var(--bg); color: var(--ink); }

canvas.chart { width: 100%; height: 220px; display: block; }

/* ----------------------------------------------------------------- footer */

.site-footer {
    border-top: 1px solid var(--line); padding: 1.75rem clamp(1rem, 4vw, 3rem);
    text-align: center; color: var(--ink-2); font-size: .9rem;
}
.site-footer p { margin: .2rem 0; }
.site-footer .muted { color: var(--muted); font-size: .82rem; }

/* --------------------------------------------------------- embedded widget */

body.embed { background: transparent; }
body.embed main { padding: 0; max-width: none; }

.embed-player {
    display: flex; align-items: center; gap: .9rem;
    background: var(--deep); color: #fff; padding: .8rem 1rem; border-radius: 14px;
}
.embed-player img { width: 62px; height: 62px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; }
.embed-info { min-width: 0; flex: 1; }
.embed-info .e-station { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); font-weight: 700; }
.embed-info .e-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.embed-info .e-artist { font-size: .82rem; color: #9fbccc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.embed-play { background: var(--accent); border: 0; color: #fff; width: 46px; height: 46px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; flex: 0 0 auto; }
.embed-play svg { fill: #fff; }
