/* ── IPTV Channel Browser — channel-browser.css ── */
@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700;800&display=swap');

:root {
  --icb-red:      #e8343a;
  --icb-red-dk:   #b52429;
  --icb-bg:       #0a0a0b;
  --icb-surf:     #111214;
  --icb-surf2:    #18191e;
  --icb-surf3:    #1f2028;
  --icb-border:   rgba(255,255,255,.08);
  --icb-muted:    rgba(255,255,255,.45);
  --icb-font:     'Barlow', sans-serif;
}

/* ── TRIGGER BUTTON ─────────────────────────────────────────── */
.icb-wrap { display: inline-block; }

.icb-trigger {
  display:        inline-flex;
  align-items:    center;
  gap:            10px;
  padding:        13px 28px;
  border-radius:  50px;
  background:     var(--icb-red);
  color:          #fff;
  font-family:    var(--icb-font);
  font-size:      15px;
  font-weight:    700;
  letter-spacing: .5px;
  text-transform: uppercase;
  border:         none;
  cursor:         pointer;
  transition:     background .15s, transform .1s;
  line-height:    1;
}
.icb-trigger:hover  { background: var(--icb-red-dk); transform: translateY(-1px); }
.icb-trigger:focus  { outline: 2px solid var(--icb-red); outline-offset: 3px; }
.icb-trigger svg    { flex-shrink: 0; }

/* ── OVERLAY ────────────────────────────────────────────────── */
.icb-overlay {
  display:         none;
  position:        fixed;
  inset:           0;
  background:      rgba(0,0,0,.82);
  z-index:         999999;
  align-items:     center;
  justify-content: center;
  padding:         1rem;
}
.icb-overlay.icb-open {
  display:   flex;
  animation: icb-fade .2s ease;
}
@keyframes icb-fade { from { opacity:0; } to { opacity:1; } }

/* ── MODAL ──────────────────────────────────────────────────── */
.icb-modal {
  background:    var(--icb-surf);
  border-radius: 16px;
  border:        1px solid var(--icb-border);
  width:         min(980px, 100%);
  max-height:    90vh;
  display:       flex;
  flex-direction:column;
  overflow:      hidden;
  animation:     icb-up .22s ease;
  font-family:   var(--icb-font);
}
@keyframes icb-up {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── HEADER ─────────────────────────────────────────────────── */
.icb-header {
  padding:       22px 24px 0;
  flex-shrink:   0;
  border-bottom: 1px solid var(--icb-border);
}
.icb-header-top {
  display:         flex;
  align-items:     flex-start;
  justify-content: space-between;
  margin-bottom:   6px;
}
.icb-modal-title {
  font-size:      24px;
  font-weight:    800;
  color:          #fff;
  letter-spacing: -.3px;
  margin:         0 0 4px;
}
.icb-modal-sub {
  font-size: 13px;
  color:     var(--icb-muted);
  margin:    0 0 14px;
}
.icb-close {
  width:      34px;
  height:     34px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  border:     1px solid var(--icb-border);
  color:      var(--icb-muted);
  cursor:     pointer;
  display:    flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, color .15s;
  margin-top: 2px;
}
.icb-close:hover { background: rgba(255,255,255,.14); color: #fff; }

/* ── SEARCH ─────────────────────────────────────────────────── */
.icb-search-wrap { position: relative; margin-bottom: 14px; }
.icb-search-icon {
  position:  absolute;
  left:      14px;
  top:       50%;
  transform: translateY(-50%);
  color:     var(--icb-muted);
  display:   flex;
  pointer-events: none;
}
.icb-search {
  width:         100%;
  padding:       10px 14px 10px 40px;
  background:    var(--icb-surf3);
  border:        1px solid var(--icb-border);
  border-radius: 50px;
  color:         #fff;
  font-family:   var(--icb-font);
  font-size:     14px;
  outline:       none;
  transition:    border-color .15s;
}
.icb-search::placeholder { color: rgba(255,255,255,.25); }
.icb-search:focus         { border-color: var(--icb-red); }

/* ── CONTINENT TABS ─────────────────────────────────────────── */
.icb-continent-tabs {
  display:    flex;
  gap:        0;
  overflow-x: auto;
  scrollbar-width: none;
  margin:     0 -24px;
  padding:    0 24px;
}
.icb-continent-tabs::-webkit-scrollbar { display: none; }
.icb-ctab {
  padding:        10px 18px;
  font-size:      12px;
  font-weight:    700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color:          var(--icb-muted);
  background:     none;
  border:         none;
  border-bottom:  2px solid transparent;
  margin-bottom:  -1px;
  cursor:         pointer;
  white-space:    nowrap;
  transition:     color .15s;
  font-family:    var(--icb-font);
}
.icb-ctab:hover         { color: rgba(255,255,255,.75); }
.icb-ctab.icb-tab-active { color: #fff; border-bottom-color: var(--icb-red); }

/* ── BODY ───────────────────────────────────────────────────── */
.icb-body {
  display:    flex;
  flex:       1;
  overflow:   hidden;
  min-height: 0;
}

/* Sidebar */
.icb-sidebar {
  width:      190px;
  flex-shrink: 0;
  background: var(--icb-surf2);
  border-right: 1px solid var(--icb-border);
  overflow-y: auto;
  padding:    10px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
.icb-sidebar::-webkit-scrollbar       { width: 4px; }
.icb-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

.icb-country {
  padding:      9px 18px;
  font-size:    13px;
  font-weight:  500;
  color:        var(--icb-muted);
  cursor:       pointer;
  border-left:  2px solid transparent;
  transition:   background .12s, color .12s;
  text-transform: capitalize;
  white-space:  nowrap;
  overflow:     hidden;
  text-overflow: ellipsis;
}
.icb-country:hover         { background: rgba(255,255,255,.05); color: #fff; }
.icb-country.icb-country-active {
  color:        #fff;
  background:   rgba(232,52,58,.1);
  border-left-color: var(--icb-red);
}

/* Channel panel */
.icb-panel {
  flex:       1;
  overflow-y: auto;
  padding:    18px 20px;
  background: var(--icb-bg);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
.icb-panel::-webkit-scrollbar       { width: 4px; }
.icb-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

/* Count bar */
.icb-count-bar {
  font-size:    12px;
  color:        var(--icb-muted);
  margin-bottom: 14px;
  display:      flex;
  align-items:  center;
  gap:          8px;
  font-family:  var(--icb-font);
}
.icb-count-num {
  color:         #fff;
  font-weight:   700;
  background:    var(--icb-red);
  padding:       1px 8px;
  border-radius: 20px;
  font-size:     11px;
}

/* Category group */
.icb-cat-group    { margin-bottom: 20px; }
.icb-cat-label {
  display:        inline-flex;
  align-items:    center;
  font-size:      10px;
  font-weight:    800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color:          #fff;
  background:     var(--icb-red);
  padding:        4px 12px;
  border-radius:  4px;
  margin-bottom:  10px;
  font-family:    var(--icb-font);
}

/* Channel grid */
.icb-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap:                   6px;
}
.icb-ch {
  padding:       7px 12px;
  background:    var(--icb-surf2);
  border:        1px solid var(--icb-border);
  border-radius: 8px;
  font-size:     12px;
  font-weight:   500;
  color:         rgba(255,255,255,.65);
  cursor:        pointer;
  transition:    background .12s, color .12s, border-color .12s;
  white-space:   nowrap;
  overflow:      hidden;
  text-overflow: ellipsis;
  display:       flex;
  align-items:   center;
  gap:           6px;
  font-family:   var(--icb-font);
}
.icb-ch:hover {
  background:    rgba(232,52,58,.12);
  border-color:  rgba(232,52,58,.4);
  color:         #fff;
}
.icb-dot {
  width:       6px;
  height:      6px;
  border-radius: 50%;
  background:  var(--icb-red);
  flex-shrink: 0;
  opacity:     .6;
}

/* Loading / empty */
.icb-loading {
  display:     flex;
  align-items: center;
  justify-content: center;
  gap:         10px;
  padding:     60px 20px;
  color:       var(--icb-muted);
  font-size:   13px;
  font-family: var(--icb-font);
}
.icb-spinner {
  width:        20px;
  height:       20px;
  border:       2px solid rgba(255,255,255,.1);
  border-top-color: var(--icb-red);
  border-radius: 50%;
  animation:    icb-spin .6s linear infinite;
  flex-shrink:  0;
}
@keyframes icb-spin { to { transform: rotate(360deg); } }

.icb-empty {
  text-align: center;
  padding:    60px 20px;
  color:      var(--icb-muted);
  font-size:  14px;
  font-family: var(--icb-font);
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .icb-modal   { max-height: 95vh; border-radius: 12px; }
  .icb-sidebar { width: 120px; }
  .icb-modal-title { font-size: 20px; }
  .icb-ctab    { padding: 8px 12px; font-size: 11px; }
  .icb-grid    { grid-template-columns: 1fr 1fr; }
}
