:root {
  --bg: #121212;
  --surface: #1e1e1e;
  --surface-2: #2a2a2a;
  --border: #333;
  --accent: #ff4500;
  --text: #eee;
  --muted: #999;
}

* { box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Roboto', system-ui, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

body { padding-top: 64px; }

.custom-navbar {
  background: #0a0a0a !important;
  border-bottom: 1px solid var(--border);
}
.custom-navbar .navbar-brand { color: var(--text); }
.custom-navbar .navbar-brand i { color: var(--accent); }

/* ============== GRID ============== */
#channel-container {
  padding: 24px 16px !important;
  margin: 0 !important;
}

.chanitem {
  flex: 0 0 260px;
  max-width: 260px;
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  margin: 0 12px 24px;
  transition: transform .15s, box-shadow .15s;
  cursor: pointer;
  border: 1px solid var(--border);
}
.chanitem:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,.5);
  border-color: var(--accent);
}

.chanitem .thumb {
  aspect-ratio: 16/9;
  background-size: cover !important;
  position: relative;
}
.chanitem .thumb a {
  display: block;
  width: 100%;
  height: 100%;
}
.chanitem .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  transition: opacity .2s;
}
.chanitem:hover .thumb img { opacity: .85; }

.chanitem .meta {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  gap: 10px;
  min-height: 66px;
}
.chanitem .meta img.logo {
  height: 40px;
  width: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.chanitem .text-div {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.chanitem .text-div strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chanitem .progress {
  height: 4px;
  margin-top: 6px;
  background: #333;
  border-radius: 2px;
}
.chanitem .progress-bar-custom {
  background: var(--accent);
  transition: width .3s;
}

.badge-fav {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,.6);
  color: #ffc107;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}
.badge-fav:hover { background: rgba(0,0,0,.9); }
.badge-fav.active { color: #ffc107; }

/* ============== PLAYER ============== */
#video { padding: 20px 0 60px; }

.player-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}
#player {
  width: 100%;
  max-height: 75vh;
  background: #000;
  border-radius: 10px;
  display: block;
}

#epg {
  max-width: 1200px;
  color: var(--text);
}
#epg h2 {
  color: var(--accent);
  font-weight: 500;
  margin: 0 0 6px;
  font-size: 22px;
}
#epg .epg-time {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 16px;
}
#epg .epg-next {
  background: var(--surface);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  border-radius: 6px;
  margin-top: 12px;
}

/* ============== LOADER ============== */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
}

/* ============== RESPONSIVE ============== */
@media (max-width: 600px) {
  .chanitem { flex: 0 0 calc(50% - 24px); max-width: none; }
}
@media (max-width: 400px) {
  .chanitem { flex: 0 0 100%; }
}

/* Уклони scroll lock кад је modal активан */
body.no-scroll { overflow: hidden; }