/* =====================================================================
   WISE Radio Moods — Dark Tech / Glassmorphism
   Culoarea de accent vine din app.js (CONFIG.stations[].accent)
   ===================================================================== */

:root {
  --accent: #00E5FF;
  --accent-rgb: 0, 229, 255;

  --bg: #05060a;
  --bg-2: #0a0c14;
  --text: #eef1f7;
  --text-2: #a9b0c2;
  --text-3: #6b7287;

  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(255, 255, 255, 0.085);
  --glass-border: rgba(255, 255, 255, 0.10);
  --glass-hi: rgba(255, 255, 255, 0.18);

  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7), 0 2px 0 rgba(255, 255, 255, 0.03) inset;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, "Liberation Mono", monospace;

  --ease: cubic-bezier(.2, .8, .2, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: env(safe-area-inset-bottom);
}

h1, h2, p { margin: 0; }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

.mono { font-family: var(--mono); letter-spacing: .02em; }
.muted { color: var(--text-2); }

.ico {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  flex: none;
}
.ico-fill { fill: currentColor; stroke: none; }

/* ---------- Fundal ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(1200px 800px at 70% -10%, var(--bg-2), var(--bg)); }

.bg-art {
  position: absolute; inset: -10%;
  background-size: cover; background-position: center;
  filter: blur(80px) saturate(140%);
  opacity: .28;
  transform: scale(1.1);
  transition: background-image .8s var(--ease), opacity .8s var(--ease);
}

.bg-blob {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: .35;
  transition: background 1s var(--ease);
}
.bg-blob.b1 {
  width: 55vmax; height: 55vmax; left: -15vmax; top: -20vmax;
  background: radial-gradient(circle, rgba(var(--accent-rgb), .55), transparent 65%);
  animation: drift1 22s ease-in-out infinite alternate;
}
.bg-blob.b2 {
  width: 45vmax; height: 45vmax; right: -15vmax; bottom: -20vmax;
  background: radial-gradient(circle, rgba(var(--accent-rgb), .35), transparent 65%);
  animation: drift2 28s ease-in-out infinite alternate;
}
@keyframes drift1 { to { transform: translate(12vmax, 8vmax) scale(1.1); } }
@keyframes drift2 { to { transform: translate(-10vmax, -6vmax) scale(1.15); } }

.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
}

.bg-noise {
  position: absolute; inset: 0; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Glass ---------- */
.glass {
  background: linear-gradient(180deg, var(--glass-strong), var(--glass));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1440px; margin: 0 auto;
  padding: 20px 24px 8px;
  padding-top: max(20px, env(safe-area-inset-top));
}

.brand { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.brand-logo { display: block; height: 44px; width: auto; }
.brand-tag {
  display: inline-flex; align-items: center;
  height: 24px; padding: 0 10px 0 14px;
  border-left: 1px solid var(--glass-hi);
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  letter-spacing: .32em; text-transform: uppercase;
  color: var(--accent);
  transition: color .6s var(--ease);
}

@keyframes eq {
  0%, 100% { height: 30%; }
  25% { height: 95%; }
  50% { height: 55%; }
  75% { height: 80%; }
}

.topbar-meta { display: flex; gap: 8px; align-items: center; }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 12px;
  border-radius: 999px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .06em;
  background: var(--glass); border: 1px solid var(--glass-border);
  color: var(--text-2);
}
.chip .ico { width: 15px; height: 15px; }
.chip-sm { height: 24px; padding: 0 9px; font-size: 10px; }
.chip-live { color: #ff5a6e; border-color: rgba(255, 90, 110, .35); background: rgba(255, 90, 110, .08); }
.chip-live .dot { background: #ff5a6e; box-shadow: 0 0 0 0 rgba(255, 90, 110, .6); animation: ping 1.8s infinite; }

.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(255, 90, 110, .55); }
  70% { box-shadow: 0 0 0 8px rgba(255, 90, 110, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 90, 110, 0); }
}

/* ---------- Layout ---------- */
.layout {
  max-width: 1440px; margin: 0 auto;
  padding: 16px 24px 24px;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 14px;
}
.panel-head h2 {
  font-size: 12px; font-family: var(--mono); font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--text-2);
}

/* ---------- Stații ---------- */
.stations { padding: 18px; position: sticky; top: 16px; }

.station-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.station {
  --s-accent: var(--accent);
  --s-rgb: var(--accent-rgb);
  position: relative;
  display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  text-align: left; cursor: pointer;
  transition: background .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.station:hover { background: rgba(255, 255, 255, .045); border-color: var(--glass-border); }
.station:active { transform: scale(.985); }
.station:focus-visible { outline: 2px solid rgb(var(--s-rgb)); outline-offset: 2px; }

.station[aria-selected="true"] {
  background: linear-gradient(90deg, rgba(var(--s-rgb), .16), rgba(var(--s-rgb), .04));
  border-color: rgba(var(--s-rgb), .40);
  box-shadow: 0 0 30px -10px rgba(var(--s-rgb), .6);
}

.station-icon {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 12px;
  color: rgb(var(--s-rgb));
  background: rgba(var(--s-rgb), .12);
  border: 1px solid rgba(var(--s-rgb), .28);
}
.station-icon .ico { width: 21px; height: 21px; }

.station-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.station-text strong { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.station-text span { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.station-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.station-listeners { font-family: var(--mono); font-size: 11px; color: var(--text-3); display: inline-flex; align-items: center; gap: 4px; }
.station-listeners .ico { width: 12px; height: 12px; }

.mini-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; opacity: 0; transition: opacity .3s; }
.mini-eq i { width: 3px; height: 30%; border-radius: 1px; background: rgb(var(--s-rgb)); animation: eq 1s ease-in-out infinite; }
.mini-eq i:nth-child(2) { animation-delay: -.35s; }
.mini-eq i:nth-child(3) { animation-delay: -.7s; }
body.is-playing .station[aria-selected="true"] .mini-eq { opacity: 1; }

.station.is-offline .station-icon { filter: grayscale(1); opacity: .5; }
.station.is-offline .station-text span::before { content: "● "; color: #ff5a6e; }

/* ---------- Player ---------- */
.player { padding: 26px; display: flex; flex-direction: column; gap: 20px; overflow: hidden; }

.player-top { display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); gap: 26px; align-items: center; }

.art-wrap {
  position: relative; aspect-ratio: 1; width: 100%;
  border-radius: 20px; overflow: hidden;
  background: #0b0d16;
  box-shadow: 0 30px 70px -25px rgba(var(--accent-rgb), .55), 0 0 0 1px rgba(255, 255, 255, .08);
  transition: box-shadow .8s var(--ease);
}
.art, .art-fallback { position: absolute; inset: 0; width: 100%; height: 100%; }
.art { object-fit: cover; opacity: 0; transition: opacity .6s var(--ease); }
.art.is-loaded { opacity: 1; }

.art-fallback {
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 30% 25%, rgba(var(--accent-rgb), .55), transparent 55%),
    radial-gradient(circle at 75% 80%, rgba(var(--accent-rgb), .25), transparent 60%),
    linear-gradient(135deg, #10131f, #070810);
  color: rgba(255, 255, 255, .9);
}
.art-fallback .ico { width: 34%; height: 34%; stroke-width: 1.2; filter: drop-shadow(0 0 18px rgba(var(--accent-rgb), .8)); }

.art-ring {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, .18), transparent 35%);
}

.meta { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.meta-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; border-radius: 999px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  background: var(--glass); border: 1px solid var(--glass-border); color: var(--text-2);
}
.badge .ico { width: 13px; height: 13px; }
.badge-mood {
  color: #05060a; font-weight: 700;
  background: var(--accent); border-color: transparent;
  box-shadow: 0 0 20px rgba(var(--accent-rgb), .45);
  transition: background .6s var(--ease), box-shadow .6s var(--ease);
}
.badge-status { color: #33d17a; }
.badge-status.is-offline { color: #ff5a6e; }

.station-name { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); transition: color .6s var(--ease); }
.title {
  font-size: clamp(24px, 3.2vw, 40px); line-height: 1.08; font-weight: 750; letter-spacing: -.02em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.artist { font-size: clamp(16px, 1.6vw, 20px); font-weight: 500; color: var(--text); opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.progress { margin-top: 14px; }
.progress-bar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.progress-bar span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), .6), var(--accent));
  box-shadow: 0 0 12px rgba(var(--accent-rgb), .8);
  transition: width .3s linear;
}
.progress-times { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--text-3); }

.viz { width: 100%; height: 110px; display: block; }

/* ---------- Controale ---------- */
.controls { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-grid; place-items: center;
  border: 0; background: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .2s var(--ease), background .2s var(--ease), box-shadow .3s var(--ease), color .2s;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn:active { transform: scale(.93); }

.btn-ghost {
  width: 48px; height: 48px; border-radius: 50%;
  color: var(--text-2);
  background: var(--glass); border: 1px solid var(--glass-border);
}
.btn-ghost:hover { color: var(--text); background: var(--glass-strong); }
.btn-sm { width: 40px; height: 40px; }

.btn-play {
  position: relative;
  width: 76px; height: 76px; border-radius: 50%;
  color: #05060a;
  background: radial-gradient(circle at 30% 25%, #fff, var(--accent) 55%);
  box-shadow: 0 0 0 6px rgba(var(--accent-rgb), .12), 0 12px 40px -6px rgba(var(--accent-rgb), .75);
}
.btn-play:hover { box-shadow: 0 0 0 9px rgba(var(--accent-rgb), .16), 0 14px 50px -6px rgba(var(--accent-rgb), .9); }
.btn-play .ico { width: 30px; height: 30px; grid-area: 1 / 1; }
.btn-play .i-pause { display: none; }
body.is-playing .btn-play .i-play { display: none; }
body.is-playing .btn-play .i-pause { display: block; }

.spinner {
  grid-area: 1 / 1;
  width: 86px; height: 86px; border-radius: 50%;
  border: 2px solid transparent; border-top-color: var(--accent); border-right-color: var(--accent);
  opacity: 0; pointer-events: none;
  position: absolute; left: -5px; top: -5px;
}
body.is-loading .spinner { opacity: 1; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.volume { display: flex; align-items: center; gap: 10px; margin-left: 10px; }
.volume .i-mute { display: none; }
body.is-muted .volume .i-vol { display: none; }
body.is-muted .volume .i-mute { display: block; color: #ff5a6e; }
.volume .fillable { fill: currentColor; stroke: none; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 130px; height: 24px; background: transparent; cursor: pointer;
  --val: 80%;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent) var(--val), rgba(255, 255, 255, .12) var(--val));
}
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .12); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; margin-top: -5px; border-radius: 50%;
  background: #fff; border: 0; box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .25), 0 0 12px rgba(var(--accent-rgb), .9);
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 0; box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .25), 0 0 12px rgba(var(--accent-rgb), .9);
}
input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

body.no-volume .volume input { display: none; }

.status { text-align: center; font-size: 12px; color: var(--text-3); min-height: 18px; }
.status.is-error { color: #ff7a8a; }
.station-desc { text-align: center; font-size: 13px; max-width: 640px; margin: -6px auto 0; }

/* ---------- Side ---------- */
.side { display: flex; flex-direction: column; gap: 20px; }
.panel { padding: 18px; }

.track { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; min-width: 0; }
.track-art {
  width: 52px; height: 52px; border-radius: 12px; overflow: hidden;
  background:
    radial-gradient(circle at 30% 30%, rgba(var(--accent-rgb), .45), transparent 60%),
    #10131f;
  border: 1px solid var(--glass-border);
}
.track-art img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; }
.track-art img.is-loaded { opacity: 1; }
.track-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.track-text strong { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-text span { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.track-next { padding: 10px; border-radius: var(--radius-sm); background: rgba(var(--accent-rgb), .07); border: 1px dashed rgba(var(--accent-rgb), .35); }
#upNextPanel.is-empty .track-next { opacity: .5; }

.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.history li { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 6px; border-radius: 12px; transition: background .2s; }
.history li:hover { background: rgba(255, 255, 255, .04); }
.history .when { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); white-space: nowrap; }
.history .empty { display: block; color: var(--text-3); font-size: 13px; padding: 8px 4px; }

/* ---------- Footer ---------- */
.footer {
  max-width: 1440px; margin: 0 auto; padding: 8px 24px 28px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 12px;
}
.noscript { text-align: center; padding: 20px; color: #ff7a8a; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 280px minmax(0, 1fr); }
  .side { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .topbar { padding: 14px 16px 4px; padding-top: max(14px, env(safe-area-inset-top)); }
  .brand { gap: 10px; }
  .brand-logo { height: 28px; }
  .brand-tag { height: 20px; padding: 0 0 0 10px; font-size: 10px; letter-spacing: .24em; }
  .layout { grid-template-columns: minmax(0, 1fr); padding: 12px 16px 16px; gap: 16px; }

  .stations { position: static; padding: 12px; min-width: 0; }
  .stations .panel-head { margin-bottom: 10px; }
  .station-list {
    flex-direction: row; overflow-x: auto; gap: 8px;
    scroll-snap-type: x mandatory; scrollbar-width: none;
    margin: 0 -4px; padding: 0 4px 2px;
  }
  .station-list::-webkit-scrollbar { display: none; }
  .station-list li { flex: 0 0 auto; scroll-snap-align: start; }
  .station { width: auto; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 9px 14px 9px 9px; min-width: 200px; max-width: 260px; }
  .station-icon { width: 36px; height: 36px; border-radius: 10px; }
  .station-side { display: none; }

  .player { padding: 18px; gap: 16px; }
  .player-top { grid-template-columns: 1fr; gap: 18px; justify-items: center; text-align: center; }
  .art-wrap { width: min(72vw, 320px); }
  .meta { width: 100%; align-items: center; }
  .meta-badges { justify-content: center; }
  .artist, .album { max-width: 100%; }
  .progress { width: 100%; }
  .viz { height: 80px; }

  .controls { gap: 12px; }
  .volume { width: 100%; justify-content: center; margin: 4px 0 0; }
  input[type="range"] { width: min(60vw, 240px); }

  .side { grid-template-columns: 1fr; gap: 16px; }
  .footer { justify-content: center; text-align: center; }
  .kbd-hints { display: none; }
}

@media (max-width: 380px) {
  .btn-play { width: 68px; height: 68px; }
  .spinner { width: 78px; height: 78px; }
  .btn-ghost { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgba(16, 19, 31, .92); }
}
