/* =========================
   RESET & BAZA
========================= */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

:root{
  --bg1:#1a1f2a;
  --bg2:#070a0f;
  --card1:#141925;
  --card2:#0b0f14;
  --line: rgba(255,255,255,.08);

  --red:#c30000;
  --green:#16a34a;

  --radius:20px;

  --bar-h: 86px;
  --bar-h-mobile: 96px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

body{
  background: radial-gradient(1200px 600px at top left, var(--bg1), var(--bg2));
  color:#e5e7eb;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  overflow: hidden;
}

/* =========================
   APP LAYOUT
========================= */
.app{
  height: 100vh;
  display:flex;
  flex-direction:column;
  min-height:0;
  padding-bottom: calc(var(--bar-h) + var(--safe-bottom));
}

/* =========================
   NEWS BAR
========================= */
.news-bar{
  flex: 0 0 auto;
  display:flex;
  align-items:center;
  gap:14px;
  padding:10px 16px;
  background: linear-gradient(90deg, #1c0d10, #0b0f14);
  border-bottom: 1px solid var(--line);
}

.news-badge{
  background: var(--red);
  color:#fff;
  font-weight:900;
  padding:8px 14px;
  border-radius: 14px;
  font-size: 13px;
  letter-spacing:.3px;
}

.news-ticker{ flex:1; overflow:hidden; white-space:nowrap; }

.news-track{
  display:inline-flex;
  gap:22px;
  padding-left:100%;
  will-change:transform;
  animation: newsTicker 60s linear infinite;
}

@keyframes newsTicker{
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

@media (prefers-reduced-motion: reduce){
  .news-track{ animation:none; padding-left:0; }
}

.news-bar a{ color:#e5e7eb; text-decoration:none; font-weight:800; }
.news-bar a:hover{ opacity:.9; }

/* =========================
   MAIN
========================= */
.main{
  flex: 1 1 auto;
  min-height:0;

  display:grid;
  grid-template-columns: minmax(320px, 1fr) minmax(300px, 420px);
  gap:18px;

  padding:18px;
  overflow:hidden;
}

/* =========================
   PLAYER CARD
========================= */
.player-card{
  min-height:0;
  display:flex;
  flex-direction:column;
  background: linear-gradient(180deg, var(--card1), var(--card2));
  border-radius: var(--radius);
  padding:18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  overflow:hidden;
}

.cover-wrap{
  width:100%;
  max-width:560px;
  aspect-ratio: 1 / 1;
  margin:0 auto;
  border-radius: 16px;
  overflow:hidden;
  background:#111;
  border: 1px solid rgba(255,255,255,.06);
  position:relative;
}

.cover-wrap img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

/* VISUALIZER: dissolve sus + blur accent la baza */
.cover-viz{
  position:absolute;
  left:0; right:0; bottom:0;
  height:24%;
  pointer-events:none;

  background: linear-gradient(
    to top,
    rgba(8,10,14,.72) 0%,
    rgba(8,10,14,.50) 38%,
    rgba(8,10,14,.18) 72%,
    rgba(8,10,14,0) 100%
  );

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  display:flex;
  align-items:stretch;
  justify-content:stretch;
}

#waveCanvas{
  width:100%;
  height:100%;
  display:block;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.45));
}

.track-info{ margin-top:14px; }
.station-name{ font-size:14px; font-weight:900; opacity:.85; }
.track-title{ font-size:22px; font-weight:900; margin-top:6px; line-height:1.15; }
.track-artist{ font-size:15px; opacity:.82; margin-top:2px; }

/* =========================
   STREAMS PANEL
========================= */
.streams-panel{
  min-height:0;
  display:flex;
  flex-direction:column;
  background: linear-gradient(180deg, var(--card1), var(--card2));
  border-radius: var(--radius);
  padding:14px;
  overflow:hidden;
}

.streams-header{ margin-bottom:10px; }

.stream-search{
  width:100%;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
  padding:10px 12px;
  color:#fff;
  outline:none;
}
.stream-search::placeholder{ color: rgba(255,255,255,.55); }

.streams-list{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  padding-right:6px;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--bar-h) + 18px);
}

.streams-list::-webkit-scrollbar{ width:8px; }
.streams-list::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.15);
  border-radius:8px;
}

.stream-item{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 12px;
  border-radius:14px;
  cursor:pointer;
  transition: background .18s ease;
  border:1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.02);
  margin-bottom:10px;
}
.stream-item:hover{ background: rgba(255,255,255,.06); }
.stream-item.active{
  background: linear-gradient(90deg, rgba(195,0,0,.33), rgba(195,0,0,.08));
  border-color: rgba(195,0,0,.35);
}

.stream-item img{
  width:42px;
  height:42px;
  object-fit:contain;
  border-radius:10px;
  background:#111;
  flex:0 0 auto;
}

.stream-name{
  flex:1;
  min-width:0;
  font-weight:900;
  font-size:14px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.stream-fav{
  flex:0 0 auto;
  opacity:.65;
  font-size:18px;
  user-select:none;
}
.stream-fav.active{ color: gold; opacity:1; }

/* =========================
   SUNO BAR (FARA PROGRESS)
========================= */
.suno-bar{
  position:fixed;
  left:0; right:0; bottom:0;
  height: var(--bar-h);
  padding: 10px 18px calc(10px + var(--safe-bottom));

  display:grid;
  grid-template-columns: 1fr auto 1fr;
  align-items:center;
  column-gap:16px;

  background: linear-gradient(180deg, rgba(18,18,20,.72), rgba(8,8,10,.92));
  border-top: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  z-index:200;
}

/* LEFT */
.suno-left{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}

.suno-cover{
  width:56px;
  height:56px;
  object-fit:cover;
  border-radius: 0; /* colturi drepte */
  background:#111;
  border:1px solid rgba(255,255,255,.10);
  flex:0 0 auto;
}

.suno-meta{ min-width:0; }

.suno-live{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:4px;
}

.live-dot{
  width:8px;
  height:8px;
  border-radius:999px;
  background: rgba(255,255,255,.35);
}
body.is-playing .live-dot{ background: var(--green); }

.live-text{
  font-size:12px;
  font-weight:900;
  letter-spacing:.6px;
  opacity:.85;
}

.suno-title{
  font-size:14px;
  font-weight:900;
  color:#fff;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width: 46vw;
}

.suno-sub{
  font-size:12px;
  opacity:.70;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width: 46vw;
}

/* CENTER */
.suno-center{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
}

.suno-iconbtn{
  width:40px;
  height:40px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  display:grid;
  place-items:center;
  cursor:pointer;
  transition: transform .08s ease, background .18s ease, border-color .18s ease;
  outline:none;
}
.suno-iconbtn:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.18);
}
.suno-iconbtn:active{ transform: scale(.98); }

.suno-iconbtn svg{
  width:18px;
  height:18px;
  fill: rgba(255,255,255,.92);
}

.suno-play{
  width:54px;
  height:54px;
  border-radius:999px;
  border:0;
  background:#fff;
  cursor:pointer;
  box-shadow: 0 12px 26px rgba(0,0,0,.45);
  transition: transform .08s ease;
  display:grid;
  place-items:center;
  outline:none;
}
.suno-play:active{ transform: scale(.98); }

.suno-play svg{
  width:22px;
  height:22px;
  fill:#0b0f14;
}

.suno-play .ic-pause{ display:none; }
body.is-playing .suno-play .ic-play{ display:none; }
body.is-playing .suno-play .ic-pause{ display:block; }

/* RIGHT */
.suno-right{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
}

/* Volume popover */
.vol-wrap{
  position:relative;
  display:flex;
  align-items:center;
}

.vol-pop{
  position:absolute;
  right: 0;
  bottom: 56px;
  width: 40px;
  height: 140px;

  display:none;
  align-items:center;
  justify-content:center;

  padding: 10px 0;
  border-radius: 14px;
  background: rgba(18,18,20,.88);
  border: 1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
}

.vol-wrap.open .vol-pop{ display:flex; }

.vol-slider{
  -webkit-appearance: none;
  appearance: none;
  width: 110px;
  height: 4px;
  background: rgba(255,255,255,.20);
  border-radius: 999px;
  outline: none;

  transform: rotate(-90deg);
}

.vol-slider::-webkit-slider-thumb{
  -webkit-appearance:none;
  appearance:none;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 10px 20px rgba(0,0,0,.35);
}

.vol-slider::-moz-range-thumb{
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 0;
  background: #fff;
}

/* daca vol = 0, ascundem "waves" */
body.vol-muted .vol-waves,
body.vol-muted .vol-waves2{ display:none; }

/* =========================
   MOBILE
========================= */
@media (max-width: 900px){
  .app{ padding-bottom: calc(var(--bar-h-mobile) + var(--safe-bottom)); }
  .main{ grid-template-columns: 1fr; grid-template-rows: auto 1fr; }

  .player-card{ max-height: 42vh; padding:14px; }
  .cover-wrap{ width: min(68vw, 240px); max-width:240px; }
  .track-info{ display:none; }

  .streams-list{ padding-bottom: calc(var(--bar-h-mobile) + 22px); }

  .suno-bar{
    height: var(--bar-h-mobile);
    padding: 10px 12px calc(10px + var(--safe-bottom));
  }

  .suno-title, .suno-sub{ max-width: 56vw; }
  .cover-viz{ height: 22%; }
}

@media (max-width: 520px){
  .player-card{ max-height: 40vh; }
  .cover-wrap{ width: min(70vw, 220px); max-width: 220px; }
  .cover-viz{ height: 20%; }
}
