/* Donkere layout (leidend) met paarse accenten; typografie zoals radiofrl.com:
   Poppins voor titels, Montserrat voor labels, Roboto voor tekst. */
:root {
  --purple: #8f3df0;
  --purple-light: #b07cff;
  --purple-dark: #5a2590;
  /* Knoppen precies zoals op radiofrl.com (ProRadio: btn-bg-one → btn-bg-two, 215deg; hover effen paars) */
  --grad: linear-gradient(215deg, #ff0f59 0%, #8224e3 100%);
  --btn-hover: #e0628c; /* indrukken/hover: roze, zelfde als de rand om het actieve station */
  --purple-1: #2b1247;
  --purple-2: #5a2590;
  --purple-3: #7b3fb8;
  --bg: #141213;
  --surface: #1f1c1e;
  --surface-2: #2a2629;
  --text: #f3efed;
  --muted: #a59e99;
  --border: #322d30;
  --pink: #e0628c;   /* tekstkleur uit de eerdere app */
  --link: var(--pink);
  --player-h: 104px;
  --font-text: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: Poppins, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-label: Montserrat, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
[hidden] { display: none !important; }

body {
  font: 400 15px/1.45 var(--font-text);
  background: var(--bg);
  color: var(--text);
  padding-bottom: calc(var(--player-h) + env(safe-area-inset-bottom, 0px) + 16px);
}
body.now-open { overflow: hidden; }

button, select { font: inherit; color: inherit; }
svg { display: block; }

/* ---------- Header: zwart met wit logo en menuknop ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 64px 10px;
  /* Achtergrond uit het neonlogo (donkerblauw met paarse gloed), zonder het logo zelf */
  background: #050215 url("../icons/header-bg.jpg?v=2") center / cover no-repeat;
  border-bottom: 3px solid var(--purple); /* zelfde paars als de rand om het actieve station */
}
.logo { height: 48px; width: auto; max-width: 100%; display: block; }
/* H1 voor zoekmachines: zelfde weergave als alleen het logo */
.site-title { margin: 0; font-size: inherit; line-height: 0; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Korte tekst "Over RadioFRL" onderaan */
.about p { margin: 0 4px 10px; color: var(--muted); font-size: 14px; }
.about strong { color: var(--text); }
.about a { color: var(--pink); }
.copyright { margin: 8px 4px 0; text-align: center; color: var(--muted); font-size: 12px; }
.menu-btn {
  position: absolute;
  right: 12px;
  bottom: 12px; /* verticaal midden naast het logo: 10px padding + (48px logo - 44px knop) / 2 */
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .8);
  background: transparent;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.menu-btn:hover { border-color: var(--pink); color: var(--pink); }

.notice {
  margin: 12px 16px 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  border-left: 4px solid var(--purple);
}

.content { max-width: 720px; margin: 0 auto; padding: 0 16px; }

h2 {
  font: 600 13px/1.3 var(--font-label);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--pink);
  margin: 24px 4px 10px;
}

.hint { color: var(--muted); font-size: 13px; margin: 12px 4px; }
.placeholder { color: var(--muted); padding: 16px 4px; }

/* ---------- Metadata: station → titel (vet) → onderste regel ---------- */
.meta { display: flex; flex-direction: column; min-width: 0; gap: 2px; text-align: left; }
.m-station {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 600 12px/1.3 var(--font-label);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.m-station-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-title { font: 700 16px/1.3 var(--font-head); letter-spacing: -0.02em; color: var(--text); }
.m-lines { font-weight: 400; color: var(--muted); font-size: 14px; }
.m-line { display: block; }

.badge-live {
  flex: none;
  font: 600 10px/1 var(--font-label);
  letter-spacing: .06em;
  color: #fff;
  background: var(--grad);
  border-radius: 6px;
  padding: 3px 6px;
}

/* Equalizer op het station dat speelt */
.eq { display: none; gap: 2px; align-items: flex-end; height: 14px; flex: none; }
.eq i { width: 3px; background: var(--purple-light); border-radius: 1px; animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; }
.eq i:nth-child(3) { animation-delay: -.6s; }
.station[data-state="playing"] .eq { display: flex; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }

/* Klikbaar telefoonnummer */
.phone {
  background: none;
  border: 0;
  padding: 0;
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* ---------- Stationlijst ---------- */
.station-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }

.station {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
}
.station.active { border-color: var(--purple); box-shadow: 0 0 0 1px var(--purple); }
.station:has(.studio-btns) { flex-wrap: wrap; }

/* WhatsApp/bel-knoppen op FRL1 / 24/7: klein en rustig, onder de tekst; knopkleur van de site bij hover */
.studio-btns { flex-basis: 100%; display: flex; gap: 6px; padding-left: 76px; margin-top: -4px; }
.studio-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 50px;
  background: var(--surface-2);
  color: var(--muted);
  text-decoration: none;
  font: 600 12px/1 var(--font-text);
}
.studio-btn i { font-size: 13px; color: var(--pink); }
.studio-btn:hover, .studio-btn:active { background: var(--grad); border-color: transparent; color: #fff; }
.studio-btn:hover i, .studio-btn:active i { color: #fff; }
.station .meta { flex: 1; }
.station .m-title, .station .m-line { overflow-wrap: anywhere; }

.station-art {
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 10px;
  object-fit: cover;
  background: #000;
}

/* ---------- Afspeelknoppen ---------- */
.toggle {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: var(--grad);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.toggle:hover { background: var(--btn-hover); }
.toggle svg { width: 18px; height: 18px; fill: #fff; grid-area: 1 / 1; }
.toggle .icon-pause, .toggle .spinner { display: none; }
[data-state="playing"] .toggle .icon-play { display: none; }
[data-state="playing"] .toggle .icon-pause { display: block; }
[data-state="loading"] .toggle .icon-play,
[data-state="reconnecting"] .toggle .icon-play { display: none; }
[data-state="loading"] .toggle .spinner,
[data-state="reconnecting"] .toggle .spinner { display: block; }

.spinner {
  grid-area: 1 / 1;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

button:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid var(--purple-light);
  outline-offset: 2px;
}

/* ---------- Reeds gedraaid ---------- */
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.history li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 8px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.history img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex: none; background: #000; }
.history-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.history-text strong { font: 700 14px/1.3 var(--font-head); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.history-text span { color: var(--muted); font-size: 13px; }
.history time { flex: none; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

/* ---------- Social media ---------- */
.follow { margin-bottom: 8px; }
.socials { display: flex; flex-wrap: wrap; gap: 10px; }
.socials a {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  text-decoration: none;
  transition: background .25s, color .25s;
}
.socials a:hover { background: var(--btn-hover); color: #fff; border-color: transparent; }

/* ---------- Player-balk ---------- */
.player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--player-h);
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, .3);
}
.player-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.player-art { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; background: #000; }
.player .meta { gap: 3px; }
.player .m-title, .player .m-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .m-lines .m-line + .m-line { display: none; }
.player .toggle { width: 46px; height: 46px; margin-right: 14px; }
.station .play-btn { margin-right: 12px; }
.player .toggle svg { width: 22px; height: 22px; }
.player .toggle .spinner { width: 22px; height: 22px; }

@media (min-width: 720px) {
  .player { justify-content: center; }
  .player-open { flex: 0 1 560px; }
}

/* ---------- Grote paarse player ---------- */
.now {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow-y: auto;
  color: #fff;
  /* Zelfde effect als de achtergrond van het logo (en de header): bijna zwart met schuine lichtstrepen,
     blauw links en paars/roze rechts, met fijne korrel. Kleuren gemeten uit het logo. */
  background:
    url("../icons/grain.png?v=1") repeat,
    linear-gradient(162deg, transparent 38%, rgba(150, 30, 150, .22) 46%, transparent 54%),
    linear-gradient(162deg, transparent 56%, rgba(110, 20, 140, .30) 64%, transparent 73%),
    linear-gradient(162deg, transparent 70%, rgba(60, 50, 190, .28) 78%, transparent 86%),
    radial-gradient(60% 35% at 0% 82%, rgba(30, 30, 140, .65), transparent 70%),
    radial-gradient(55% 30% at 100% 40%, rgba(70, 8, 90, .55), transparent 70%),
    radial-gradient(70% 40% at 60% 95%, rgba(60, 10, 100, .6), transparent 70%),
    #02010f;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 20px calc(env(safe-area-inset-bottom, 0px) + 24px);
}
.now-inner { max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.now-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.now-label { font: 600 13px/1 var(--font-label); letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.now-cast { display: flex; align-items: center; gap: 4px; min-width: 44px; justify-content: flex-end; }

.icon-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.icon-btn svg { width: 24px; height: 24px; }

google-cast-launcher {
  display: none;
  width: 28px;
  height: 28px;
  margin: 8px;
  cursor: pointer;
  --disconnected-color: #fff;
  --connected-color: var(--purple-light);
}
.cast-ready google-cast-launcher { display: inline-block; }

.now-art {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 18px;
  background: #000;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
}
.now-meta { text-align: center; align-items: center; gap: 4px; }
.now-meta .m-station { color: rgba(255, 255, 255, .8); font-size: 13px; }
.now-meta .m-title { font-size: 24px; line-height: 1.2; color: #fff; letter-spacing: -0.04em; }
.now-meta .m-lines { color: rgba(255, 255, 255, .85); font-size: 15px; text-align: center; }
.now .phone { color: #fff; }
.now-status { text-align: center; min-height: 1.4em; color: #fff; opacity: .85; font-size: 14px; }

.now-controls { display: flex; align-items: center; justify-content: center; gap: 28px; }
.toggle.big { width: 62px; height: 62px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
.toggle.big:hover { background: var(--btn-hover); }
.toggle.big svg { width: 28px; height: 28px; }
.toggle.big .spinner { width: 26px; height: 26px; }

/* ---------- Volume ---------- */
.volume { display: flex; align-items: center; gap: 10px; }
.volume[hidden] { display: none; }
.now-volume { width: 100%; max-width: 360px; margin: 0 auto; }
.player-volume { flex: 0 0 170px; }
@media (max-width: 719px) { .player-volume { display: none !important; } }
.vol-mute {
  flex: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--pink);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.vol-mute svg { width: 22px; height: 22px; }
.vol-mute .icon-muted, .volume.muted .vol-mute .icon-vol { display: none; }
.volume.muted .vol-mute .icon-muted { display: block; }
.vol-value { flex: none; width: 40px; text-align: right; font: 600 12px/1 var(--font-label); color: rgba(255, 255, 255, .8); font-variant-numeric: tabular-nums; }
.vol-range {
  --fill: 50%;
  flex: 1;
  min-width: 0;
  height: 6px;
  margin: 0;
  border-radius: 3px;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(to right, var(--pink) var(--fill), rgba(255, 255, 255, .22) var(--fill));
  cursor: pointer;
}
.vol-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
}
.vol-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
}
.vol-range:focus-visible { outline: 2px solid var(--purple); outline-offset: 4px; }

.now-history h3 { font: 600 13px/1.3 var(--font-label); letter-spacing: .08em; text-transform: uppercase; margin: 6px 0 10px; opacity: .85; }
.now-history .history li { background: rgba(0, 0, 0, .22); border-color: rgba(255, 255, 255, .12); }
.now-history .history-text span, .now-history .history time { color: rgba(255, 255, 255, .75); }

/* ---------- Menu ---------- */
.site-menu {
  border: 0;
  padding: 0;
  margin: 0 0 0 auto;
  width: min(340px, 88vw);
  height: 100%;
  max-height: none;
  background: linear-gradient(180deg, #000 0%, var(--purple-1) 100%);
  color: #fff;
}
.site-menu::backdrop { background: rgba(0, 0, 0, .6); }
.site-menu-inner { display: flex; flex-direction: column; gap: 22px; padding: calc(env(safe-area-inset-top, 0px) + 16px) 20px 24px; }
.site-menu-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.site-menu-logo { height: 40px; width: auto; max-width: 75%; }
.site-links { display: flex; flex-direction: column; }
.site-links a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  color: #fff;
  text-decoration: none;
  font: 600 14px/1 var(--font-label);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.site-links a i { width: 20px; text-align: center; color: var(--pink); }
.site-links a span { flex: 1; }
.site-links a i.ext { width: auto; font-size: 11px; color: rgba(255, 255, 255, .45); }
.site-links a:hover { color: var(--pink); }
.site-menu-note { margin: -8px 0 0; font-size: 12px; color: rgba(255, 255, 255, .55); }
.site-menu .socials a { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .15); color: #fff; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--player-h) + env(safe-area-inset-bottom, 0px) + 12px);
  z-index: 40;
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 16px;
  border-radius: 12px;
  background: #000;
  border-left: 4px solid var(--purple);
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .4);
}

/* ---------- Telefoonmenu ---------- */
.phone-menu {
  border: 0;
  border-radius: 16px;
  padding: 0;
  width: min(360px, calc(100% - 32px));
  background: var(--surface);
  color: var(--text);
}
.phone-menu::backdrop { background: rgba(0, 0, 0, .6); }
.phone-menu-inner { display: flex; flex-direction: column; gap: 8px; padding: 18px; }
.phone-menu-title { margin: 0 0 6px; text-align: center; font-family: var(--font-head); }
.phone-option {
  display: block;
  padding: 12px;
  border: 0;
  border-radius: 50px;
  background: var(--grad);
  color: #fff;
  text-align: center;
  text-decoration: none;
  font: 600 13px/1.2 var(--font-head);
  text-transform: uppercase;
  cursor: pointer;
}
.phone-option:hover { background: var(--btn-hover); }
.phone-option.cancel { background: transparent; color: var(--text); border: 2px solid rgba(255, 255, 255, .6); }

@media (prefers-reduced-motion: reduce) {
  .eq i, .spinner { animation-duration: 3s; }
}
