/* iVibe Music - shared styles for the control panel and the public pages. */
:root {
  --brand: #7c4dff;
  --brand-2: #00d4ff;
  --bg: #0e0c16;
  --bg-2: #16132444;
  --panel: #191527;
  --panel-2: #211b33;
  --line: #2e2745;
  --text: #f3f1fb;
  --muted: #a49dc4;
  --ok: #35d29a;
  --warn: #ffb340;
  --bad: #ff5c7a;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 500px at 12% -10%, #7c4dff22, transparent 60%),
    radial-gradient(800px 450px at 92% 0%, #00d4ff18, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.2; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- shell -- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 20px;
  background: #0e0c16ee;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.logo {
  font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em;
  background: linear-gradient(92deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap;
}
.logo small { display: block; font-size: .6rem; letter-spacing: .22em; color: var(--muted); -webkit-text-fill-color: var(--muted); }
.topbar nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.topbar nav a { color: var(--muted); padding: 6px 12px; border-radius: 999px; font-size: .9rem; }
.topbar nav a.active, .topbar nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.topbar .who { color: var(--muted); font-size: .85rem; white-space: nowrap; }

main.app { padding: 24px 0 80px; }

/* ---------------------------------------------------------------- cards -- */

.card {
  background: linear-gradient(180deg, var(--panel), #17132a);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
}
.card > h3 { display: flex; align-items: center; gap: 10px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.stat .n { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; }
.stat .l { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; }

/* ------------------------------------------------------------- controls -- */

button, .btn {
  font: inherit; font-weight: 600;
  background: linear-gradient(92deg, var(--brand), #9b6bff);
  color: #fff; border: 0; border-radius: 10px;
  padding: 9px 16px; cursor: pointer;
}
button:hover { filter: brightness(1.1); }
button:disabled { opacity: .5; cursor: not-allowed; filter: none; }
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
button.ghost:hover { background: var(--panel-2); }
button.danger { background: linear-gradient(92deg, #d33a5c, var(--bad)); }
button.sm { padding: 5px 10px; font-size: .82rem; border-radius: 8px; }

input, select, textarea {
  font: inherit; width: 100%;
  background: #100d1c; color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
label { display: block; font-size: .8rem; color: var(--muted); margin: 0 0 4px; text-transform: uppercase; letter-spacing: .08em; }
.field { margin-bottom: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 0 0 auto; }
.row .grow { flex: 1 1 200px; }

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

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 600; }
tbody tr:hover { background: #ffffff06; }
.scroll { overflow-x: auto; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.pill.on { background: #35d29a22; color: var(--ok); }
.pill.off { background: #ff5c7a22; color: var(--bad); }
.pill.live { background: #ff5c7a; color: #fff; }
.pill.warn { background: #ffb34022; color: var(--warn); }
.pill.info { background: #00d4ff1a; color: var(--brand-2); }

/* ------------------------------------------------------------ on-air bar -- */

.onair { display: flex; gap: 16px; align-items: center; }
.onair img { width: 92px; height: 92px; border-radius: 12px; object-fit: cover; background: var(--panel-2); flex: none; }
.onair .meta { min-width: 0; flex: 1; }
.onair .meta h2 { margin: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onair .meta .reason { font-size: .8rem; color: var(--muted); }
.bar { height: 5px; background: var(--panel-2); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: linear-gradient(92deg, var(--brand), var(--brand-2)); transition: width .5s linear; }

/* --------------------------------------------------------------- public -- */

body.public .hero {
  padding: 56px 0 40px;
  background: linear-gradient(160deg, #7c4dff33, transparent 70%);
  border-bottom: 1px solid var(--line);
}
body.public .hero.small { padding: 28px 0 22px; }
body.public .brand { display: inline-block; margin-bottom: 14px; color: var(--muted); font-weight: 700; letter-spacing: -.01em; }
body.public .tagline { color: var(--muted); }
body.public main { padding: 28px 0 60px; }

.player-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 26px; }
.np { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.np-art { width: 104px; height: 104px; border-radius: 12px; object-fit: cover; background: var(--panel-2); flex: none; }
.np-label { font-size: .68rem; letter-spacing: .18em; color: var(--brand); font-weight: 800; }
.np-meta h2 { margin: 3px 0; }
.np-meta p { margin: 0; color: var(--muted); }
.listeners { font-size: .85rem; }
audio { width: 100%; margin-bottom: 12px; }
.links { display: flex; gap: 8px; flex-wrap: wrap; }
.links a { font-size: .82rem; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.links a:hover { border-color: var(--brand); color: var(--text); text-decoration: none; }

ol.history, ul.tracklist { list-style: none; padding: 0; margin: 0; }
ol.history li, ul.tracklist li {
  display: flex; gap: 12px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--line);
}
ol.history img, ul.tracklist img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--panel-2); flex: none; }
ol.history div, ul.tracklist div { flex: 1; min-width: 0; }
ol.history strong, ul.tracklist strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
ol.history span, ul.tracklist span { color: var(--muted); font-size: .86rem; }
ol.history time { color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }

ul.stations { list-style: none; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
ul.stations a { display: block; padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); }
ul.stations a:hover { border-color: var(--brand); text-decoration: none; }
ul.stations strong { display: block; font-size: 1.1rem; }
ul.stations span { color: var(--muted); font-size: .85rem; }
ul.stations em { display: block; margin-top: 8px; font-style: normal; font-size: .8rem; color: var(--brand-2); }

.search { margin-bottom: 14px; }
.status { color: var(--muted); font-size: .85rem; }

/* --------------------------------------------------------------- notices -- */

.notice { padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 12px; font-size: .9rem; }
.notice.warn { border-color: #ffb34055; background: #ffb34012; }
.notice.bad { border-color: #ff5c7a55; background: #ff5c7a12; }
.notice.ok { border-color: #35d29a55; background: #35d29a12; }
.notice.info { border-color: #00d4ff44; background: #00d4ff0e; }

.toast { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 8px; }
.toast div { background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--brand); padding: 11px 15px; border-radius: 10px; max-width: 380px; font-size: .9rem; }
.toast div.bad { border-left-color: var(--bad); }
.toast div.ok { border-left-color: var(--ok); }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button { background: none; color: var(--muted); border-radius: 8px 8px 0 0; padding: 9px 14px; font-weight: 600; }
.tabs button.active { color: var(--text); background: var(--panel); border-bottom: 2px solid var(--brand); }

code, pre { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .85em; }
pre { background: #0b0914; border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow-x: auto; }
code.inline { background: #0b0914; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }

.center-form { max-width: 420px; margin: 8vh auto; }
.empty { padding: 34px; text-align: center; color: var(--muted); }
