/* ================================================================
   Global Free TV Hub — Main Stylesheet
   Fonts: Syne (display) + DM Sans (body)
   Theme: Dark broadcast/streaming aesthetic with electric red accent
   ================================================================ */

/* ── Reset & Variables ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Colors */
  --bg:          #0a0a0f;
  --bg-card:     #13131e;
  --bg-card2:    #1a1a2e;
  --bg-nav:      rgba(10,10,15,0.96);
  --accent:      #e94560;
  --accent2:     #ff6b35;
  --gold:        #f7c59f;
  --text:        #e8e8f0;
  --text-muted:  #7a7a9a;
  --text-dim:    #4a4a6a;
  --border:      rgba(255,255,255,0.07);
  --border2:     rgba(233,69,96,0.3);
  --live:        #00d084;
  --shadow:      0 8px 32px rgba(0,0,0,0.5);

  /* Typography */
  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  /* Spacing */
  --nav-h:     64px;
  --radius:    10px;
  --radius-lg: 18px;

  /* Transitions */
  --ease: cubic-bezier(0.4,0,0.2,1);
}

[data-theme="light"] {
  --bg:        #f0f0f7;
  --bg-card:   #ffffff;
  --bg-card2:  #e8e8f5;
  --bg-nav:    rgba(240,240,247,0.97);
  --text:      #1a1a2e;
  --text-muted:#555570;
  --text-dim:  #9999bb;
  --border:    rgba(0,0,0,0.08);
  --shadow:    0 4px 20px rgba(0,0,0,0.1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ── Navbar ────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  flex-shrink: 0;
  color: var(--text);
}
.nav-brand:hover .brand-text { color: var(--accent); }
.brand-icon { font-size: 1.5rem; }

.nav-search {
  flex: 1;
  max-width: 420px;
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.nav-search:focus-within { border-color: var(--accent); }
.nav-search input {
  flex: 1;
  padding: 9px 14px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.nav-search button {
  padding: 9px 14px;
  color: var(--text-muted);
  transition: color 0.2s;
}
.nav-search button:hover { color: var(--accent); }

.nav-links {
  display: flex;
  list-style: none;
  gap: 4px;
  margin-left: auto;
}
.nav-links > li > a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s;
}
.nav-links > li > a:hover { color: var(--text); background: var(--bg-card); }

/* Dropdown */
.has-dropdown { position: relative; }
.dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 220px;
  padding: 8px;
  box-shadow: var(--shadow);
  z-index: 500;
  animation: dropIn 0.15s var(--ease);
}
.dropdown--country { columns: 2; min-width: 360px; }
.has-dropdown:hover .dropdown { display: block; }
.dropdown a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--text-muted);
  transition: all 0.15s;
  break-inside: avoid;
}
.dropdown a:hover { background: var(--bg-card2); color: var(--text); }
.dropdown .count {
  font-size: 11px;
  background: var(--bg-card2);
  padding: 1px 6px;
  border-radius: 20px;
  color: var(--text-dim);
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nav-actions { display: flex; align-items: center; gap: 6px; }
.btn-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.btn-icon:hover { color: var(--accent); border-color: var(--accent); }
.hamburger { display: none; }

/* ── Mobile Menu ───────────────────────────────────────────── */
.mobile-menu {
  display: none;
  padding: 16px 20px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}
.mobile-menu.open { display: block; }
.mobile-search {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 14px;
}
.mobile-search input {
  flex: 1; padding: 10px 14px;
  background: transparent; border: none;
  color: var(--text); outline: none;
}
.mobile-search button { padding: 10px 14px; color: var(--text-muted); }
.mobile-links { display: flex; flex-wrap: wrap; gap: 8px; }
.mobile-links a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--bg);
  border-radius: 7px;
  font-size: 14px;
  color: var(--text-muted);
  transition: all 0.15s;
}
.mobile-links a:hover { color: var(--accent); }

/* ── Layout ─────────────────────────────────────────────────── */
.main-content { min-height: calc(100vh - var(--nav-h) - 200px); }
.container { max-width: 1400px; margin: 0 auto; padding: 0 20px; }

/* ── Section ────────────────────────────────────────────────── */
.section { padding: 40px 0; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: '';
  display: block;
  width: 4px;
  height: 22px;
  background: var(--accent);
  border-radius: 2px;
}
.section-link { font-size: 13px; color: var(--accent); font-weight: 500; }
.section-link:hover { text-decoration: underline; }

/* ── Channel Grid ───────────────────────────────────────────── */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

/* ── Channel Card ───────────────────────────────────────────── */
.channel-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.channel-card:hover {
  transform: translateY(-4px);
  border-color: var(--border2);
  box-shadow: 0 12px 32px rgba(233,69,96,0.15);
}
.channel-card a { display: block; }

.channel-card__thumb {
  aspect-ratio: 16/9;
  background: var(--bg-card2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.channel-card__thumb img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 16px;
  transition: transform 0.3s var(--ease);
}
.channel-card:hover .channel-card__thumb img { transform: scale(1.08); }

.live-badge {
  position: absolute;
  top: 8px; left: 8px;
  background: var(--live);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.live-badge::before {
  content: '';
  width: 6px; height: 6px;
  background: #000;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hd-badge {
  position: absolute;
  top: 8px; right: 8px;
  background: var(--accent2);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.channel-card__info {
  padding: 10px 12px;
}
.channel-card__name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.channel-card__meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.channel-card__flag { font-size: 13px; }

/* ── Hero Banner ────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--bg-card2) 0%, var(--bg) 60%);
  border-bottom: 1px solid var(--border);
  padding: 60px 0 50px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(233,69,96,0.12), transparent 60%);
}
.hero-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
}
.hero-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  max-width: 680px;
  margin-bottom: 16px;
}
.hero-title span { color: var(--accent); }
.hero-subtitle { color: var(--text-muted); max-width: 500px; margin-bottom: 32px; }

.hero-search {
  display: flex;
  max-width: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(233,69,96,0.1);
}
.hero-search input {
  flex: 1;
  padding: 14px 18px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 15px;
  outline: none;
}
.hero-search button {
  padding: 14px 22px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  transition: background 0.2s;
}
.hero-search button:hover { background: #c73752; }

.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.hero-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent);
}
.hero-stat span { font-size: 13px; color: var(--text-muted); }

/* ── Country Grid ───────────────────────────────────────────── */
.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}
.country-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.country-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.country-card__flag { font-size: 2rem; }
.country-card__name { font-size: 12.5px; font-weight: 600; }
.country-card__count { font-size: 11px; color: var(--text-muted); }

/* ── Player Page ────────────────────────────────────────────── */
.player-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 20px;
}
.player-main {}
.player-sidebar {}

.player-wrapper {
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16/9;
  position: relative;
}
#videoPlayer {
  width: 100%;
  height: 100%;
  display: block;
}
.player-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.85);
  gap: 14px;
  color: var(--text-muted);
  font-size: 14px;
}
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.player-meta {
  margin-top: 18px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.player-logo {
  width: 72px; height: 72px;
  border-radius: 12px;
  background: var(--bg-card2);
  object-fit: contain;
  padding: 8px;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.player-info {}
.player-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
}
.player-badges { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-muted);
}
.badge--live { border-color: var(--live); color: var(--live); }
.badge--cat  { border-color: var(--border2); color: var(--accent); }

.player-actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #c73752; }
.btn-outline { border: 1px solid var(--border); color: var(--text-muted); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger  { border: 1px solid rgba(233,69,96,0.4); color: var(--accent); }
.btn-danger:hover { background: var(--accent); color: #fff; }

/* Sidebar */
.sidebar-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.sidebar-channel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius);
  transition: background 0.15s;
}
.sidebar-channel:hover { background: var(--bg-card); }
.sidebar-channel img {
  width: 44px; height: 44px;
  border-radius: 8px;
  object-fit: contain;
  background: var(--bg-card2);
  padding: 4px;
  flex-shrink: 0;
}
.sidebar-channel__name { font-size: 13px; font-weight: 600; }
.sidebar-channel__meta { font-size: 11px; color: var(--text-muted); }

/* ── Category/Country page ──────────────────────────────────── */
.page-header {
  background: var(--bg-card2);
  border-bottom: 1px solid var(--border);
  padding: 40px 0 32px;
}
.page-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}
.page-header__kicker { font-size: 12px; text-transform: uppercase; letter-spacing: 2px; color: var(--accent); margin-bottom: 8px; }
.page-header__title { font-family: var(--font-display); font-size: 2rem; font-weight: 800; }
.page-header__meta { color: var(--text-muted); margin-top: 8px; }

/* ── Search ─────────────────────────────────────────────────── */
.search-bar-lg {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: 10px;
  overflow: hidden;
  max-width: 600px;
  margin-bottom: 32px;
}
.search-bar-lg input {
  flex: 1;
  padding: 13px 18px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 15px;
  outline: none;
}
.search-bar-lg button {
  padding: 13px 22px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* ── Pagination ─────────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 36px 0;
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  padding: 8px 14px;
  border-radius: 7px;
  font-size: 14px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all 0.15s;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination .disabled { opacity: 0.4; pointer-events: none; }

/* ── Flash Messages ─────────────────────────────────────────── */
.flash {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  position: relative;
}
.flash--success { background: rgba(0,208,132,0.12); border-bottom: 1px solid rgba(0,208,132,0.3); color: var(--live); }
.flash--error   { background: rgba(233,69,96,0.12);  border-bottom: 1px solid rgba(233,69,96,0.3);  color: var(--accent); }
.flash button   { opacity: 0.6; font-size: 18px; }

/* ── Ads ────────────────────────────────────────────────────── */
.ad-banner { text-align: center; padding: 8px 20px; }
.ad-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 6px;
  width: 100%; max-width: 728px;
  height: 90px;
  color: var(--text-dim);
  font-size: 12px;
}

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  margin-top: 60px;
}
.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 50px 20px 32px;
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 40px;
}
.footer-brand .brand-icon { font-size: 2rem; display: block; margin-bottom: 6px; }
.footer-tagline { color: var(--text-muted); font-size: 13px; margin-top: 6px; }
.footer-disclaimer-short { font-size: 12px; color: var(--text-dim); margin-top: 10px; line-height: 1.6; }
.footer-links h4 { font-family: var(--font-display); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 14px; }
.footer-links ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: 13px; color: var(--text-dim); transition: color 0.15s; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.footer-bottom p { font-size: 12px; color: var(--text-dim); }
.footer-legal a { color: var(--accent); }

/* ── Empty / Loading States ─────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 1rem; }

/* ── Legal Pages ────────────────────────────────────────────── */
.legal-page { max-width: 820px; margin: 0 auto; padding: 40px 20px; }
.legal-page h1 { font-family: var(--font-display); font-size: 2rem; margin-bottom: 8px; }
.legal-page .updated { color: var(--text-muted); font-size: 13px; margin-bottom: 32px; }
.legal-page h2 { font-family: var(--font-display); font-size: 1.2rem; margin: 28px 0 10px; color: var(--accent); }
.legal-page p, .legal-page li { color: var(--text-muted); line-height: 1.8; margin-bottom: 12px; }
.legal-page ul { margin-left: 20px; }
.legal-page a { color: var(--accent); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .player-layout { grid-template-columns: 1fr; }
  .player-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .nav-search { display: none; }
  .hero { padding: 40px 0 36px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .channel-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
  .player-sidebar { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; }
  .hero-stats { gap: 20px; }
  .channel-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Utility ────────────────────────────────────────────────── */
.text-center  { text-align: center; }
.text-muted   { color: var(--text-muted); }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mb-20 { margin-bottom: 20px; }

/* ── Report Modal ───────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow);
}
.modal h3 { font-family: var(--font-display); margin-bottom: 16px; }
.modal select, .modal textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-family: var(--font-body);
  margin-bottom: 12px;
}
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
