:root {
  color-scheme: dark;
  font-family: Inter, system-ui, sans-serif;
  background: #080e1a;
  color: #edf3ff;
  --muted: #9eafc9;
  --border: #273750;
  --panel: #111c30;
  --blue: #2876ee;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }
button {
  border: 1px solid var(--border);
  border-radius: .55rem;
  padding: .65rem .85rem;
  color: inherit;
  background: #17263e;
  cursor: pointer;
}
button:hover:not(:disabled) { background: #243c5e; }
button:disabled { opacity: .5; cursor: default; }
button[aria-pressed="true"], .primary { background: #1758bc; border-color: #4b91fa; }
:focus-visible { outline: 3px solid #91c3ff; outline-offset: 2px; }
.bar {
  min-height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .65rem clamp(1rem, 4vw, 4rem);
  background: #101a2c;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; font-size: 1.25rem; font-weight: 850; white-space: nowrap; }
.brand > span:last-child { color: #8cbeff; margin-left: .25em; }
.symbol { color: white; background: #2367dd; border-radius: .45rem; font-size: .8rem; padding: .48rem; margin-right: .65rem; }
nav, .account, .actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
#player-update { justify-content: center; padding: .5rem 1rem; }
.account time, .heading span, small { color: var(--muted); font-size: .8rem; }
.login { min-height: calc(100dvh - 4.5rem); display: grid; place-items: center; padding: 1rem; background: radial-gradient(ellipse at 50% 20%, #152c50, transparent 62%); }
form { width: min(100%, 27rem); background: var(--panel); border: 1px solid var(--border); border-radius: 1rem; padding: 2rem; display: grid; gap: 1.1rem; }
form h1, form p { margin: 0; }
form label { display: grid; gap: .4rem; }
input { border: 1px solid #456085; border-radius: .5rem; padding: .75rem; color: inherit; background: #091323; }
#login-error { color: #ffb5bf; min-height: 1.3rem; }
#app { padding: 1.5rem clamp(1rem, 4vw, 4rem); max-width: 106rem; margin: auto; }
.heading { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1rem; }
.heading h1 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.4rem); }
.layout { display: grid; grid-template-columns: minmax(9rem, 1fr) minmax(12rem, 1.45fr) minmax(0, 3.35fr); gap: 1rem; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: .85rem; min-width: 0; }
.panel h2, .dialog-header h2 { font-size: 1rem; margin: 0; padding: 1rem; border-bottom: 1px solid var(--border); }
.panel h2 small { float: right; font-weight: 500; }
.list { display: grid; gap: .4rem; padding: .6rem; max-height: 57vh; overflow: auto; }
.list button { text-align: left; min-width: 0; }
.channel { display: flex; align-items: center; gap: .55rem; }
.mark { flex: 0 0 2.15rem; min-height: 1.8rem; display: grid; place-items: center; border-radius: .35rem; font-size: .7rem; font-weight: 800; }
.channel strong { overflow-wrap: anywhere; }
.channel small { margin-left: auto; }
.viewer { display: grid; gap: .7rem; min-width: 0; }
.screen { position: relative; overflow: hidden; aspect-ratio: 16/9; background: #030710; }
video { display: block; width: 100%; height: 100%; object-fit: contain; }
#screen-empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; background: radial-gradient(ellipse at center, #1a365c, #080f1d 70%); }
#screen-empty span { color: #8cbeff; font-size: 2rem; }
.screen-label { position: absolute; top: .75rem; left: .75rem; right: .75rem; display: flex; justify-content: space-between; gap: .5rem; pointer-events: none; }
.screen-label > * { background: #091322ed; border-radius: .4rem; padding: .4rem .6rem; }
#mode { color: #b5d9ff; font-size: .75rem; }
.guide-rows { padding: .65rem; color: var(--muted); }
.program { display: grid; grid-template-columns: 3.25rem 6.5rem 1fr; align-items: center; gap: .5rem; padding: .6rem; }
.program strong { color: #edf3ff; }
.program.current { background: #192f50; border-radius: .5rem; }
progress { display: block; width: 100%; height: .4rem; margin-top: .3rem; accent-color: #5baaff; }
#status { color: var(--muted); margin: 0; }
dialog { width: min(48rem, calc(100% - 1.5rem)); border: 1px solid var(--border); border-radius: .85rem; background: var(--panel); color: inherit; }
dialog::backdrop { background: #020610c9; }
.dialog-header { display: flex; justify-content: space-between; align-items: center; }
.dialog-header h2 { border: 0; }
@media (max-width: 850px) {
  .layout { grid-template-columns: 1fr 1.6fr; }
  .viewer { grid-column: 1 / -1; }
  .list { max-height: 33vh; }
}
@media (max-width: 510px) {
  .bar { flex-wrap: wrap; }
  nav { order: 1; }
  nav button { padding: .5rem; }
  .layout { gap: .55rem; }
  .program { grid-template-columns: 2.8rem 5.6rem 1fr; font-size: .8rem; }
}


/* TV BALKAN UI COMPACT V1 */

/* Ukloni mali naziv playliste uz Live TV */
#playlist-name {
    display: none !important;
}

/* Podigni glavni sadrzaj */
#app {
    padding-top: 0.4rem;
}

/* Smanji razmak ispod Live TV naslova */
.heading {
    margin-bottom: 0.6rem;
}

/* Ukloni naziv kanala preko video slike */
#playing {
    display: none !important;
}

/* TV BALKAN COMPACT V2 */

/* Ukloni ceo naslov Live TV iz glavnog sadrzaja */
#app > .heading {
    display: none !important;
}

/* Podigni kategorije, kanale i video */
#app {
    padding-top: 0.35rem !important;
}

/* Naziv kanala preko slike nije potreban */
.screen-label > :not(#mode) {
    display: none !important;
}

/* TV BALKAN UI V3 */

/* Sira kolona kanala */
@media (min-width: 1100px) {
  .layout {
    grid-template-columns:
      minmax(9rem, .9fr)
      minmax(20rem, 1.9fr)
      minmax(0, 3.2fr);
  }
}

/* Dugme odlozenog gledanja */
#catchup {
  min-width: 12rem;
  white-space: nowrap;
}

/* Natpis u listi kanala */
.channel small {
  font-size: .7rem;
  white-space: normal;
  text-align: right;
  max-width: 8rem;
}

/* Dugmad za izbor dana */
#archive-days button {
  min-width: 8rem;
}

/* TV BALKAN EPG LABEL SPACING */

/* Vise mesta za Trenutno i Sledeca */
.program {
  grid-template-columns: 5.8rem 7rem minmax(0, 1fr);
  column-gap: 0.8rem;
}

/* Prilagodjenje mobilnom prikazu */
@media (max-width: 510px) {
  .program {
    grid-template-columns: 5.5rem 5.8rem minmax(0, 1fr);
    column-gap: 0.4rem;
    font-size: 0.75rem;
  }
}
