/* ============================================================
   ŽIVÉ VYSIELANIE
   Stavia na premenných zo style.css (--accent, --border, --surface,
   --radius, --accent-ink, --accent-rgb), takže sa mení spolu s témou
   aj s farbou, ktorú si používateľ zvolí v accent.js.
   ============================================================ */

:root {
  --live: #e0393e;                 /* jediná farba mimo palety – „naživo“ musí byť jednoznačné */
  --live-soft: rgba(224, 57, 62, .12);
}

.live-dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--live);
  margin-right: 7px;
  flex: 0 0 auto;
  animation: live-pulse 2s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .45; }
}
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }


/* ============================================================
   1. PREPÍNAČ ZÁLOŽIEK V KONZOLE
   Štyri záložky sa do 360 px v jednom riadku nezmestia. Namiesto
   stláčania textu dáme ikonu nad popis – vyzerá to zámerne
   a ostane čitateľné aj na malom telefóne.
   ============================================================ */

@media (max-width: 600px) {
  #console .seg {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    width: 100%;
    padding: 5px;
    border-radius: 18px;
    margin-bottom: 18px;
  }
  #console .seg button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 56px;
    padding: 8px 2px;
    font-size: .72rem;
    line-height: 1.15;
    letter-spacing: -.01em;
    border-radius: 13px;
    white-space: normal;
    text-align: center;
  }
  #console .seg button .ico {
    width: 20px; height: 20px;
    vertical-align: 0;
  }
  #console .seg button.active { color: var(--accent-ink, #000); }
}

@media (max-width: 340px) {
  #console .seg button { font-size: .66rem; min-height: 52px; }
  #console .seg button .ico { width: 18px; height: 18px; }
}


/* ============================================================
   2. PANEL „VYSIELAŠ“ – iba počas vysielania
   Je to najdôležitejšia vec na obrazovke, nech to tak aj vyzerá.
   ============================================================ */

.live-onair {
  border: 1px solid var(--live);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--live-soft), transparent 60%), var(--surface);
  padding: 18px 20px;
  margin: 14px 0;
}
.live-onair.hidden { display: none; }

.live-onair-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.live-onair-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px 4px 9px;
  border-radius: 999px;
  background: var(--live);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
}
.live-onair-badge .live-dot { background: #fff; margin-right: 6px; }
.live-onair-name {
  font-weight: 600;
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.live-stats { display: flex; gap: 26px; margin: 15px 0 13px; }
.live-stat-label {
  display: block;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.live-stat-value {
  font-size: 1.55rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.live-meter {
  position: relative;
  height: 10px;
  border-radius: 5px;
  background: var(--surface-hover);
  overflow: hidden;
}
.live-meter i {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width .06s linear;
}
.live-meter u {                       /* špička – padá pomaly, dá sa prečítať */
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--text-secondary);
  transition: left .06s linear;
}
.live-meter.clip i { background: var(--live); }
.live-meter.clip { box-shadow: inset 0 0 0 1px var(--live); }

.live-meter-hint { font-size: .78rem; color: var(--text-muted); margin: 7px 0 0; }
.live-meter-hint.clip { color: var(--live); font-weight: 600; }

.live-gain {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
  font-size: .85rem;
  color: var(--text-secondary);
}
.live-gain input[type=range] { flex: 1; min-width: 0; }
.live-gain output { font-variant-numeric: tabular-nums; min-width: 46px; text-align: right; }

.live-onair-actions { margin-top: 16px; }
.live-onair-actions .btn { width: 100%; }


/* ============================================================
   3. FORMULÁR NOVÉHO VYSIELANIA
   ============================================================ */

.live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 14px;
  margin: 14px 0;
  align-items: start;          /* inak sa polia natiahnu na vysku najvyssieho */
}

.live-field { display: block; min-width: 0; }
.live-field > span {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}
.live-field input,
.live-field select { width: 100%; margin: 0; }

/* Typ vysielania: dve karty namiesto rozbaľovacieho zoznamu,
   aby bolo hneď vidieť, čím sa líšia. */
.live-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.live-choice button {
  display: block;
  text-align: left;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.live-choice button:hover { background: var(--surface-hover); }
.live-choice button.active {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), .10);
}
.live-choice b { display: block; font-size: .95rem; margin-bottom: 2px; }
.live-choice i { font-style: normal; font-size: .78rem; color: var(--text-muted); }

.live-eur { position: relative; }
.live-eur input { padding-right: 30px; }
.live-eur span {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.live-toggle {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 13px;
  cursor: pointer;
}
/* style.css nastavuje `input { width:100%; padding:12px 16px }` a to plati aj
   pre checkbox - bez tohto z neho bude siroky obdlznik cez cele pole a text
   sa zalomi do uzkeho stlpca vedla neho. */
.live-toggle input[type="checkbox"] {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}
.live-toggle > span { flex: 1 1 auto; min-width: 0; }
.live-toggle b { display: block; font-size: .9rem; font-weight: 600; }
.live-toggle i {
  display: block;
  font-style: normal;
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.live-note { font-size: .82rem; color: var(--text-muted); margin: 0 0 14px; }
.live-note:empty { display: none; }


/* ============================================================
   4. ZOZNAM VYSIELANÍ
   ============================================================ */

.live-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.live-row:last-child { border-bottom: none; padding-bottom: 2px; }

.live-row-main { flex: 1 1 220px; min-width: 0; }
.live-row-title { display: flex; align-items: center; font-weight: 600; }
.live-row-title .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-row.on .live-row-title { color: var(--live); }
.live-row-meta { font-size: .82rem; margin-top: 3px; }

.live-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-hover);
  flex: 0 0 auto;
}

.live-row-actions { display: flex; gap: 8px; flex: 0 0 auto; }

/* Dĺžka vysielania ako pilulky – rýchlejšie na dotyk než select */
.live-dur { display: flex; flex-wrap: wrap; gap: 7px; margin: 2px 0 16px; }
.live-dur button {
  padding: 7px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  font: inherit;
  font-size: .84rem;
  cursor: pointer;
}
.live-dur button.active {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), .12);
  color: var(--text);
  font-weight: 600;
}

/* Údaje pre OBS / BUTT / Mixxx */
.live-rtmp {
  flex-basis: 100%;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-light);
}
.live-rtmp.hidden { display: none; }
.live-rtmp p { margin: 0 0 10px; }

.live-copy { display: block; margin: 10px 0; }
.live-copy > span {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}
.live-copy-row { display: flex; gap: 8px; }
.live-copy-row input {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .8rem;
}


/* ============================================================
   5. MOBIL
   ============================================================ */

@media (max-width: 620px) {
  .live-grid { grid-template-columns: 1fr; }
  .live-choice { grid-template-columns: 1fr; }

  .live-row { align-items: flex-start; gap: 10px; }
  .live-row-actions { width: 100%; }
  .live-row-actions .btn { flex: 1; }

  .live-stats { gap: 20px; }
  .live-stat-value { font-size: 1.35rem; }

  .live-copy-row { flex-wrap: wrap; }
  .live-copy-row input { flex-basis: 100%; }
  .live-copy-row .btn { flex: 1; }

  .live-onair { padding: 16px; }
}


/* ============================================================
   6. STRANA POSLUCHÁČA (/app)
   ============================================================ */

.live-strip { margin: 0 0 22px; }
.live-strip.hidden { display: none; }

.live-strip-title {
  display: flex;
  align-items: center;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.live-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.live-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px;
  text-align: left;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--live);
  border-radius: var(--radius);
  color: inherit;
  font: inherit;
}
.live-card:hover { background: var(--surface-hover); }
.live-card.playing { border-color: var(--accent); border-left-color: var(--live); }
.live-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.live-card-cover {
  flex: 0 0 auto;
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--surface-light);
  overflow: hidden;
  font-size: 1.3rem;
}
.live-card-cover img { width: 100%; height: 100%; object-fit: cover; }

.live-card-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.live-card-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-card-sub, .live-card-meta {
  font-size: .82rem;
  color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.live-card-meta { color: var(--live); }

@media (max-width: 620px) { .live-cards { grid-template-columns: 1fr; } }

/* Prehrávač počas živého vysielania: posúvač nemá čo pretáčať. */
body.is-live #player-seek,
body.is-live #modal-seek { display: none; }

body.is-live #player-duration,
body.is-live #modal-duration {
  color: var(--live);
  font-weight: 600;
  letter-spacing: .02em;
}

body.is-live #player-next,
body.is-live #player-prev,
body.is-live #player-shuffle,
body.is-live #player-repeat { opacity: .35; pointer-events: none; }