/* BBM Live TV Enterprise v2.6.1 - simple hub + stable grid */

/* ---------- Global shell ---------- */
:root {
  --bbm-maxw: 1720px;
  --bbm-gutter: 24px;
  --bbm-header-h: 72px;
  --bbm-adminbar-h: 0px;
}

body.admin-bar { --bbm-adminbar-h: 32px; }
@media (max-width: 782px) {
  body.admin-bar { --bbm-adminbar-h: 46px; }
}

.bbm-app-shell {
  min-height: calc(100vh - var(--bbm-header-h) - var(--bbm-adminbar-h));
  padding-top: calc(var(--bb-header-height, var(--bbm-header-h)) + var(--bbm-adminbar-h) + 12px);
}

.bbm-content-shell {
  width: calc(100% - (var(--bbm-gutter) * 2));
  max-width: var(--bbm-maxw);
  margin-inline: auto;
}

.bbm-ltve-page { --bbm-maxw: 1720px; }
@media (max-width: 1800px) {
  .bbm-ltve-page { --bbm-maxw: 1600px; }
}
@media (max-width: 1400px) {
  .bbm-ltve-page { --bbm-maxw: 1360px; }
}

.bbm-ltve-wrap { max-width: none; margin: 0; padding: 0; }

.bbm-page-head { margin: 0 0 14px; }

.bbm-page-title {
  margin: 0;
  font-size: clamp(48px, 5vw, 64px);
  line-height: 1.05;
}

.bbm-page-subtitle {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
}
.bbm-page-subtitle a {
  color: #d1d5db;
  text-decoration: underline;
}

.bbm-page-body { padding-bottom: 40px; }

/* ---------- Category rail ---------- */
.bbm-ltve-genre-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 6px 0 16px;
}

.bbm-ltve-genre-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: #e5e7eb;
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  transition: all 0.2s ease;
}
.bbm-ltve-genre-pill:hover,
.bbm-ltve-genre-pill:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
}
.bbm-ltve-genre-pill.is-active {
  background: #e50914;
  border-color: #e50914;
  color: #fff;
}
.bbm-ltve-explore-all { margin-left: auto; }

/* ---------- Grid ---------- */
.bbm-live-grid-wrap { display: block; }

.bbm-grid,
.bbm-ltve-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

/* ---------- Cards ---------- */
.bbm-card,
.bbm-ltve-card {
  background: #111;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  min-height: 250px;
  display: flex;
  flex-direction: column;
}

.bbm-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0b0b0b;
}
.bbm-thumb img,
.bbm-ltve-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.bbm-thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  background: #1a1a1a;
}

.bbm-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: #111;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.bbm-card.is-live .bbm-badge {
  background: #e50914;
  border-color: #e50914;
}
.bbm-card.is-off .bbm-badge {
  background: #444;
  border-color: #555;
}

.bbm-title {
  margin: 10px 12px 6px;
  font-size: 14px;
  line-height: 1.35;
  color: #fff;
}
.bbm-meta {
  margin: 0 12px 10px;
  font-size: 12px;
  color: #b8b8b8;
}

.bbm-btn {
  margin: 0 12px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #262626;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}
.bbm-btn-watch {
  background: #e50914;
  border-color: #e50914;
}
.bbm-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---------- Empty state ---------- */
.bbm-empty {
  margin: 16px 0;
  padding: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  color: #ccc;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
}
.bbm-empty-help {
  margin: 12px 0 0;
  padding: 12px;
  border-radius: 10px;
  background: rgba(180, 83, 9, 0.12);
  border: 1px solid rgba(180, 83, 9, 0.3);
  color: #fde68a;
}

/* ---------- Hub cards ---------- */
.bbm-lt-hub-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin: 10px 0 20px;
}
.bbm-lt-hub-cat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
}
.bbm-lt-hub-cat:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
}
.bbm-lt-hub-cat-name {
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.bbm-lt-hub-cat-count {
  color: #bbb;
  font-size: 12px;
}

.bbm-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 12px;
}
.bbm-row-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}
.bbm-see-all-link {
  font-size: 13px;
  text-decoration: none;
  color: #bdbdbd;
}
.bbm-see-all-link:hover { color: #fff; }

.bbm-lt-cat-section { margin: 22px 0 26px; }

/* ---------- Watch page ---------- */
.bbm-watch-wrap {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  background: #000;
}
.bbm-watch-wrap video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: #000;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .bbm-grid,
  .bbm-ltve-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }

  .bbm-ltve-genre-rail {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .bbm-ltve-genre-pill {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}
@media (max-width: 768px) {
  :root {
    --bbm-gutter: 16px;
    --bbm-header-h: 64px;
  }
  .bbm-page-title {
    font-size: clamp(32px, 10vw, 44px);
  }
}
@media (max-width: 560px) {
  .bbm-grid,
  .bbm-ltve-grid {
    grid-template-columns: 1fr;
  }
}

/* Explore anchors remain clickable above rail overlays. */
.bbm-ltve-explore {
  position: relative;
  z-index: 5;
  pointer-events: auto;
}
