:root {
  --pc-red: #ef4444;
  --hub-bg: #020617;
  --hub-nav-h: 80px;
  --hub-radius: 24px;
  --glass: rgba(15, 23, 42, 0.6);
  --border: rgba(255, 255, 255, 0.08);

  /* Category Colors */
  --color-sports: #ef4444;
  --color-music: #a855f7;
  --color-community: #f97316;
  --color-ads: #3b82f6;
}

body.hub-theme {
  background-color: var(--hub-bg);
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Force-hide legacy or stray artifacts on the Hub */
.hub-theme .cstv-sidebar,
.hub-theme #nav-menu,
.hub-theme .sidebar-header,
.hub-theme .sidebar-toggle,
.hub-theme aside,
.hub-theme .cstv-shell > ul {
  display: none !important;
}

.hub-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* --- NAVIGATION --- */
.hub-header {
  height: var(--hub-nav-h);
  border-bottom: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(24px);
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.nav-brand-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.csm-home-link {
  font-size: 0.65rem;
  font-weight: 900;
  color: #94a3b8;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  letter-spacing: 0.05em;
}
.csm-home-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav-sep {
  color: var(--border);
  font-weight: 200;
  font-size: 0.8rem;
}

.brand {
  font-size: 1.1rem;
  font-weight: 950;
  color: #fff;
  letter-spacing: 0.1em;
  text-decoration: none;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  text-decoration: none;
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  transition: color 0.3s ease;
}

.nav-links a:hover { color: #fff; }

.mobile-only { display: none; }

@media (max-width: 768px) {
  .desktop-only { display: none; }
  .mobile-only { display: flex; }
}

/* --- INTRO SECTION --- */
.hub-intro {
  padding: 1rem 0 1.5rem; /* Reduced top padding from 2.5rem to pull content closer to nav */
  text-align: center;
}

.intro-content h1 {
  font-size: 1.4rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  color: #fff;
}

.intro-content p {
  font-size: 0.95rem;
  color: #94a3b8;
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.45;
  font-weight: 500;
}

.upcoming {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--pc-red);
  margin-top: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- PLAYER STACK --- */
.hub-main { padding-bottom: 3rem; }

.player-stack {
  background: #000;
  border-radius: var(--hub-radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0,0,0,0.6);
  margin-bottom: 1.5rem;
}

.player-wrapper {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

.hero-player, .hero-image-display {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-image-display { display: none; }

/* Robustness Overlay */
.media-fallback-overlay {
  position: absolute;
  inset: 0;
  background: #020617;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 25;
}

.media-fallback-overlay.visible { display: flex; }

.fallback-icon { width: 48px; height: 48px; color: #475569; margin-bottom: 1rem; }
.fallback-text { font-weight: 800; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.1em; }
.fallback-sub { font-size: 0.75rem; color: var(--pc-red); margin-top: 0.5rem; text-transform: uppercase; font-weight: 700; }

/* Overlay styles */
.player-overlay-top {
  position: absolute; top: 0; left: 0; right: 0;
  padding: 1.5rem; display: flex; justify-content: space-between; align-items: flex-start;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
  z-index: 10;
}

.live-pill {
  background: var(--pc-red);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-dot {
  width: 6px; height: 6px; background: #fff; border-radius: 50%;
  animation: blink 1s infinite;
}

.player-overlay-bottom {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 2rem 1.5rem;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  z-index: 10;
}

#hero-title { font-size: 1.6rem; font-weight: 900; margin-bottom: 0.25rem; }
.hero-category { font-size: 0.7rem; font-weight: 800; color: var(--pc-red); text-transform: uppercase; letter-spacing: 0.1em; }

/* Category specific coloring */
.cat-sports .hero-category, .cat-sports .schedule-category { color: var(--color-sports); }
.cat-music .hero-category, .cat-music .schedule-category { color: var(--color-music); }
.cat-community .hero-category, .cat-community .schedule-category { color: var(--color-community); }
.cat-ads .hero-category, .cat-ads .schedule-category { color: var(--color-ads); }

/* --- ATTACHED GUIDE --- */
.attached-guide {
  background: #0f172a;
  border-top: 1px solid var(--border);
}

.guide-header {
  padding: 0.6rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.guide-header .label { font-size: 0.6rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.15em; color: #64748b; }
.guide-header .jump { font-size: 0.6rem; font-weight: 800; color: var(--pc-red); cursor: pointer; text-transform: uppercase; }

.schedule-rail {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.schedule-rail::-webkit-scrollbar { display: none; }

.schedule-slot {
  min-width: 260px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  transition: transform 0.3s ease;
}

.schedule-slot.now {
  background: rgba(255,255,255,0.06);
  border-color: var(--pc-red);
  transform: scale(1.02);
}

.schedule-time { font-size: 0.6rem; color: #64748b; font-weight: 700; margin-bottom: 0.5rem; display: block; }
.schedule-title { font-size: 0.85rem; font-weight: 800; line-height: 1.3; color: #fff; margin-bottom: 1rem; }

/* --- HUB CTAs --- */
.hub-actions-section {
  padding: 1.5rem 0;
}

.cta-group {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

@media (max-width: 640px) {
  .cta-group { flex-direction: column; align-items: stretch; }
}

.btn-premium-red, .btn-premium-dark {
  padding: 1rem 2rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-block;
}

.btn-premium-red {
  background: var(--pc-red);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.25);
}
.btn-premium-red:hover {
  background: #ff3b3b;
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(239, 68, 68, 0.4);
}

.btn-premium-dark {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  border: 1px solid var(--border);
}
.btn-premium-dark:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* --- COMPACT FOOTER --- */
.hub-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  background: #01040f;
  margin-top: auto;
}

.footer-compact-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 2rem;
}

@media (max-width: 900px) {
  .footer-compact-grid { flex-direction: column; text-align: center; gap: 1.5rem; }
}

.footer-brand-lockup h3 {
  font-size: 0.95rem;
  font-weight: 950;
  letter-spacing: 0.05em;
  color: #fff;
  margin-bottom: 0.25rem;
}

.footer-brand-lockup .tagline {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 600;
}

.footer-compact-links {
  display: flex;
  gap: 1.5rem;
}

.footer-compact-links a {
  color: #64748b;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color 0.2s ease;
}

.footer-compact-links a:hover {
  color: #fff;
}

.footer-contact .contact-email {
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-contact .contact-email:hover {
  color: var(--pc-red);
}

.footer-bottom-bar {
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.copyright-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.6rem;
  font-weight: 800;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.version {
  opacity: 0.6;
  font-family: monospace;
}

@media (max-width: 640px) {
  .footer-compact-links { flex-wrap: wrap; justify-content: center; gap: 1rem 1.5rem; }
  .copyright-line { flex-direction: column; gap: 0.5rem; text-align: center; }
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Hybrid player visibility */
.player-stack video { display: block; }
.player-stack.is-image video { display: none; }
.player-stack.is-image img { display: block; }

/* Join Overlay */
.join-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.85);
  display: none; align-items: center; justify-content: center; z-index: 50;
  border: none; cursor: pointer; color: #fff;
}
.join-overlay.visible { display: flex; }
.join-icon { width: 60px; height: 60px; background: var(--pc-red); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; }
.join-text .title { display: block; font-size: 1.2rem; font-weight: 900; }
.join-text .sub { font-size: 0.75rem; color: var(--pc-red); text-transform: uppercase; font-weight: 900; }

/* Mobile Menu Overlay Styles (Consolidated) */
.mobile-nav-overlay {
  position: fixed; inset: 0; background: rgba(2, 6, 23, 0.98);
  z-index: 2000; display: none; flex-direction: column;
  align-items: center; justify-content: center;
}
.mobile-nav-overlay.visible { display: flex; }
.menu-close-btn { position: absolute; top: 1.5rem; right: 1.5rem; background: none; border: 1px solid var(--border); color: #fff; padding: 10px; border-radius: 50%; }
.mobile-nav-links { list-style: none; text-align: center; display: flex; flex-direction: column; gap: 2rem; }
.mobile-nav-links a { text-decoration: none; color: #94a3b8; font-size: 1.5rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.1em; }
