/* =============================================
   WhatsOnFreeTV — Netflix-style Design System
   ============================================= */

:root {
  --bg:          #141414;
  --bg-dark:     #0a0a0a;
  --bg-card:     #1c1c1c;
  --bg-card-hover: #232323;
  --bg-overlay:  rgba(20, 20, 20, 0.92);
  --red:         #E50914;
  --red-hover:   #f40612;
  --red-dim:     rgba(229, 9, 20, 0.15);
  --text:        #ffffff;
  --text-muted:  #b3b3b3;
  --text-dim:    #6b6b6b;
  --border:      #2a2a2a;
  --border-focus:#555;
  --radius:      4px;
  --radius-lg:   8px;
  --transition:  0.2s ease;
  --nav-height:  68px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 48px;
  background: linear-gradient(to bottom, rgba(10,10,10,0.98) 60%, transparent);
  transition: background var(--transition);
}

.navbar.scrolled {
  background: rgba(10,10,10,0.98);
}

.navbar-logo {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--red);
  letter-spacing: -0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.navbar-logo span {
  color: var(--text);
  font-weight: 400;
}

.nav-country-links {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.nav-country-link {
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition), background var(--transition);
}

.nav-country-link:hover { color: var(--text); }
.nav-country-link.active {
  color: var(--text);
  background: rgba(255,255,255,0.08);
}

.navbar-spacer { flex: 1; }

.search-wrapper {
  position: relative;
  flex-shrink: 0;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: auto;
  cursor: pointer;
  z-index: 1;
}

.search-input {
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--border-focus);
  color: var(--text);
  padding: 8px 12px 8px 34px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  width: 220px;
  outline: none;
  transition: border-color var(--transition), width var(--transition), background var(--transition);
}

.search-input::placeholder { color: var(--text-dim); }
.search-input:focus {
  border-color: var(--text-muted);
  background: rgba(0,0,0,0.8);
  width: 280px;
}

.platform-filter {
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--border-focus);
  color: var(--text);
  padding: 8px 28px 8px 12px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color var(--transition);
}

.platform-filter:focus { border-color: var(--text-muted); }
.platform-filter option { background: #1c1c1c; color: var(--text); }

.suggest-nav-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  background: var(--red);
  color: var(--text);
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: background var(--transition);
  white-space: nowrap;
}

.suggest-nav-btn:hover { background: var(--red-hover); }

/* =============================================
   HERO
   ============================================= */
.hero {
  position: relative;
  padding: calc(var(--nav-height) + 40px) 48px 48px;
  background: linear-gradient(to bottom, var(--bg-dark) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 12px;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: 10px;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 480px;
}

.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 24px;
}

.hero-stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--red);
  line-height: 1;
}

.hero-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

/* =============================================
   GENRE SECTIONS
   ============================================= */
.content {
  padding: 8px 0 60px;
}

.genre-section {
  padding: 20px 0;
  position: relative;
}

.genre-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 0 48px;
  margin-bottom: 12px;
}

.genre-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.genre-count {
  font-size: 0.75rem;
  color: var(--red);
  font-weight: 600;
}

/* ---- Scroll Row ---- */
.row-container {
  position: relative;
}

.channels-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 8px 48px 16px;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.channels-row::-webkit-scrollbar { display: none; }

/* Scroll Arrows */
.scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 44px;
  height: 100%;
  max-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10,10,10,0.85);
  color: var(--text);
  font-size: 1.4rem;
  opacity: 0;
  transition: opacity var(--transition);
  border-radius: var(--radius);
}

.row-container:hover .scroll-btn { opacity: 1; }
.scroll-btn:hover { background: rgba(10,10,10,0.98); }
.scroll-btn.left  { left: 0; border-radius: 0 var(--radius) var(--radius) 0; }
.scroll-btn.right { right: 0; border-radius: var(--radius) 0 0 var(--radius); }

/* =============================================
   CHANNEL CARDS
   ============================================= */
.channel-card {
  flex: 0 0 180px;
  cursor: pointer;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.channel-card:hover {
  transform: scale(1.07);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(229,9,20,0.3);
  z-index: 10;
}

.card-thumb {
  width: 180px;
  height: 101px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 14px;
  transition: opacity var(--transition);
}

.card-fallback {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 900;
  color: var(--red);
  background: var(--bg-card);
  letter-spacing: -1px;
}

.card-thumb img.errored { display: none; }
.card-thumb img.errored + .card-fallback { display: flex; }

/* Hover overlay */
.card-hover-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(10,10,10,0.95), transparent);
  padding: 20px 8px 6px;
  transform: translateY(100%);
  transition: transform 0.2s ease;
}

.channel-card:hover .card-hover-info {
  transform: translateY(0);
}

.card-hover-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.card-hover-badge {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 5px;
  background: var(--red);
  border-radius: 2px;
  white-space: nowrap;
}

/* Card label below thumbnail */
.card-footer {
  background: #1a1a1a;
  padding: 8px 10px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.card-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition);
}

.channel-card:hover .card-label { color: var(--text); }

.card-mobile-platforms {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  display: none; /* hidden on desktop — platforms shown on hover overlay */
}

@media (max-width: 600px) {
  .card-mobile-platforms { display: block; }
}

/* =============================================
   SKELETON LOADERS
   ============================================= */
.skeleton {
  background: linear-gradient(
    90deg,
    #1c1c1c 25%,
    #262626 50%,
    #1c1c1c 75%
  );
  background-size: 400% 100%;
  animation: shimmer 1.6s ease infinite;
}

@keyframes shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.skeleton-title {
  height: 20px;
  width: 160px;
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.skeleton-thumb {
  width: 180px;
  height: 101px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.skeleton-footer {
  width: 180px;
  height: 36px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.skeleton-card {
  flex: 0 0 180px;
}

/* =============================================
   EMPTY / ERROR STATES
   ============================================= */
.state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
  gap: 12px;
}

.state-icon {
  font-size: 3rem;
  margin-bottom: 8px;
  opacity: 0.5;
}

.state-title {
  font-size: 1.3rem;
  font-weight: 700;
}

.state-msg {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 360px;
}

.retry-btn {
  margin-top: 16px;
  padding: 10px 24px;
  background: var(--red);
  color: var(--text);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background var(--transition);
}

.retry-btn:hover { background: var(--red-hover); }

.hidden { display: none !important; }

/* =============================================
   CHANNEL DETAIL PAGE
   ============================================= */
.detail-page {
  min-height: 100vh;
}

.detail-hero {
  padding: calc(var(--nav-height) + 32px) 48px 40px;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a0a0a 100%);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 48px;
  align-items: flex-start;
}

.detail-logo-wrap {
  flex-shrink: 0;
  width: 160px;
  height: 160px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--border);
}

.detail-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
}

.detail-logo-fallback {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--red);
}

.detail-info { flex: 1; }

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 20px;
  transition: color var(--transition);
}

.detail-back:hover { color: var(--text); }

.detail-channel-name {
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
  line-height: 1.1;
}

.detail-description {
  font-size: 0.975rem;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 24px;
}

.detail-section {
  margin-bottom: 20px;
}

.detail-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 20px;
  white-space: nowrap;
}

.badge-platform {
  background: var(--red);
  color: #fff;
}

.badge-genre                          { background: rgba(255,255,255,0.08); color: var(--text-muted); border: 1px solid var(--border); }
.badge-genre[data-genre="News"]       { background: rgba(29,105,200,0.18); color: #5b9fef; border-color: rgba(29,105,200,0.35); }
.badge-genre[data-genre="Sports"]     { background: rgba(39,174,96,0.18);  color: #4cd98a; border-color: rgba(39,174,96,0.35); }
.badge-genre[data-genre="Movies"]     { background: rgba(229,9,20,0.18);   color: #f26672; border-color: rgba(229,9,20,0.35); }
.badge-genre[data-genre="Kids"]       { background: rgba(241,196,15,0.18); color: #f5d142; border-color: rgba(241,196,15,0.35); }
.badge-genre[data-genre="Music"]      { background: rgba(142,68,173,0.22); color: #c39bd3; border-color: rgba(142,68,173,0.4); }
.badge-genre[data-genre="Comedy"]     { background: rgba(243,156,18,0.18); color: #f0a500; border-color: rgba(243,156,18,0.35); }
.badge-genre[data-genre="Documentary"]{ background: rgba(0,188,212,0.18);  color: #4dd9e8; border-color: rgba(0,188,212,0.35); }
.badge-genre[data-genre="Drama"]      { background: rgba(229,9,20,0.12);   color: #e07070; border-color: rgba(229,9,20,0.25); }
.badge-genre[data-genre="Reality"]    { background: rgba(255,152,0,0.16);  color: #ffb74d; border-color: rgba(255,152,0,0.3); }
.badge-genre[data-genre="Lifestyle"]  { background: rgba(233,30,99,0.16);  color: #f06292; border-color: rgba(233,30,99,0.3); }
.badge-genre[data-genre="Food"]       { background: rgba(255,87,34,0.16);  color: #ff8a65; border-color: rgba(255,87,34,0.3); }
.badge-genre[data-genre="Travel"]     { background: rgba(0,150,136,0.18);  color: #4db6ac; border-color: rgba(0,150,136,0.35); }
.badge-genre[data-genre="Technology"] { background: rgba(33,150,243,0.16); color: #64b5f6; border-color: rgba(33,150,243,0.3); }

a.badge {
  text-decoration: none;
}
a.badge:hover {
  opacity: 0.82;
  transform: translateY(-1px);
  transition: opacity 0.15s, transform 0.15s;
}

.badge-country {
  background: rgba(229,9,20,0.12);
  color: var(--red);
  border: 1px solid rgba(229,9,20,0.25);
}

.detail-body {
  padding: 48px;
  max-width: 900px;
}

.detail-body h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

/* =============================================
   SUGGEST PAGE
   ============================================= */
.suggest-page {
  padding: calc(var(--nav-height) + 40px) 48px 80px;
  max-width: 680px;
  margin: 0 auto;
}

.suggest-page h1 {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 8px;
}

.suggest-page .page-sub {
  color: var(--text-muted);
  margin-bottom: 40px;
  font-size: 0.95rem;
}

.form-grid {
  display: grid;
  gap: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.form-group label span {
  color: var(--red);
  margin-left: 2px;
}

.form-control {
  background: #1a1a1a;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  outline: none;
  width: 100%;
  transition: border-color var(--transition), background var(--transition);
}

.form-control::placeholder { color: var(--text-dim); }
.form-control:focus {
  border-color: var(--red);
  background: #1e1e1e;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: border-color var(--transition), color var(--transition), background var(--transition);
  user-select: none;
}

.checkbox-label:hover {
  border-color: var(--red);
  color: var(--text);
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--red);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.checkbox-label:has(input:checked) {
  border-color: var(--red);
  background: var(--red-dim);
  color: var(--text);
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.submit-btn {
  padding: 14px 32px;
  background: var(--red);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius);
  transition: background var(--transition), transform var(--transition);
  letter-spacing: 0.3px;
}

.submit-btn:hover:not(:disabled) {
  background: var(--red-hover);
  transform: translateY(-1px);
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-feedback {
  padding: 16px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
}

.form-feedback.success {
  background: rgba(39, 174, 96, 0.12);
  border: 1px solid rgba(39, 174, 96, 0.3);
  color: #2ecc71;
}

.form-feedback.error {
  background: rgba(229, 9, 20, 0.12);
  border: 1px solid rgba(229, 9, 20, 0.3);
  color: #ff6b6b;
}

/* =============================================
   INDEX / REDIRECT PAGE
   ============================================= */
.redirect-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 20px;
  text-align: center;
  padding: 24px;
}

.redirect-logo {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--red);
}

.redirect-logo span { color: var(--text); font-weight: 400; }

.redirect-msg {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.redirect-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.redirect-manual {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.redirect-btn {
  padding: 10px 28px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all var(--transition);
}

.redirect-btn:hover {
  border-color: var(--red);
  color: var(--text);
  background: var(--red-dim);
}

/* =============================================
   EPG — WHAT'S ON NOW
   ============================================= */
.epg-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.epg-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  flex-shrink: 0;
  animation: epg-pulse 2.2s ease-in-out infinite;
}

@keyframes epg-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}

/* EPG cards sit inside the shared .channels-row so they scroll the same way */
.epg-card {
  flex: 0 0 220px;
  background: #181818;
  border: 1px solid #2a2a2a;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
}

.epg-card:hover {
  border-color: var(--red);
  transform: translateY(-2px);
}

.epg-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #222;
  background: #111;
  min-height: 52px;
}

.epg-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  object-fit: contain;
  background: #1c1c1c;
  flex-shrink: 0;
  padding: 3px;
}

.epg-logo-fallback {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--red);
  flex-shrink: 0;
}

.epg-channel-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.epg-card-body {
  padding: 12px;
}

.epg-show-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 7px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.epg-show-time {
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 0.3px;
}

.epg-card-platform {
  margin-top: 8px;
}

.epg-card-platform .badge {
  font-size: 0.68rem;
  padding: 3px 8px;
}

/* Also fix card-fallback to be hidden by default when logo is present */
.card-fallback {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 900;
  color: var(--red);
  background: #1e1e1e;
  letter-spacing: -1px;
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 48px 32px;
  background: var(--bg-dark);
  text-align: center;
}

.footer-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.footer-logo {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--red);
}

.footer-logo span { color: var(--text-muted); font-weight: 400; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
}

.footer-link {
  font-size: 0.8rem;
  color: var(--text-dim);
  transition: color var(--transition);
}

.footer-link:hover { color: var(--text-muted); }

.footer-legal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.footer-attribution {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 10px;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.footer-attr-link {
  color: var(--text-dim);
  transition: color var(--transition);
}

.footer-attr-link:hover { color: var(--text-muted); }

.footer-sep { color: var(--border); }

/* =============================================
   LEGAL PAGES (privacy.html, terms.html)
   ============================================= */
.legal-page {
  max-width: 800px;
  margin: 0 auto;
  padding: calc(var(--nav-height) + 56px) 48px 80px;
  color: var(--text-muted);
  line-height: 1.75;
}

.legal-page h1 {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.legal-page .legal-updated {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 48px;
}

.legal-page h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 36px 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.legal-page h3 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 24px 0 8px;
}

.legal-page p {
  font-size: 0.88rem;
  margin-bottom: 14px;
}

.legal-page ul,
.legal-page ol {
  margin: 8px 0 14px 24px;
}

.legal-page li {
  font-size: 0.88rem;
  margin-bottom: 6px;
}

.legal-page a {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-page a:hover { color: var(--red-hover); }

.legal-page strong { color: var(--text); font-weight: 600; }

.legal-toc {
  margin: 12px 0 32px 0;
  padding-left: 24px;
}

.legal-toc li {
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.legal-toc a {
  text-decoration: none;
  color: var(--text-muted);
}

.legal-toc a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
  .navbar {
    padding: 0 20px;
    gap: 12px;
    flex-wrap: wrap;
    height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .navbar-logo { font-size: 1.2rem; }
  .search-input { width: 160px; }
  .search-input:focus { width: 180px; }

  /* Suggest button lives in the toggle bar, not the navbar */

  .hero {
    padding: 100px 20px 32px;
  }

  .hero-title { font-size: 1.8rem; }
  .hero-stats { gap: 20px; }

  .genre-header { padding: 0 20px; }
  .channels-row  { padding: 8px 20px 16px; }

  .scroll-btn { display: none; }

  .detail-hero {
    flex-direction: column;
    padding: 100px 20px 32px;
    gap: 24px;
  }

  .detail-logo-wrap { width: 160px; height: 160px; }
  .detail-channel-name { font-size: 1.8rem; }

  .detail-body { padding: 24px 20px; }

  .suggest-page { padding: 100px 20px 60px; }

  .site-footer { padding: 28px 20px; }
  .legal-page { padding: calc(var(--nav-height) + 32px) 20px 60px; }
}

@media (max-width: 600px) {
  .hero-stats { gap: 16px; }
  .hero-stat-value { font-size: 1.4rem; }
  .card-hover-info { display: none; }
  .channel-card { flex: 0 0 calc(50vw - 30px); }
  .card-thumb { width: 100%; height: auto; aspect-ratio: 16/9; }
  .skeleton-thumb { width: 100%; height: auto; aspect-ratio: 16/9; }
  .skeleton-card { flex: 0 0 calc(50vw - 30px); }

  /* ---- Navbar: single-line, no wrap ---- */
  .navbar {
    flex-wrap: nowrap;
    height: var(--nav-height);
    padding-top: 0;
    padding-bottom: 0;
    gap: 8px;
  }

  /* ---- Search: on mobile, icon taps open full-screen modal ---- */
  .search-input,
  .search-close-btn { display: none !important; }

  .search-icon {
    position: static;
    transform: none;
    cursor: pointer;
    pointer-events: auto;
    font-size: 1.1rem;
    color: var(--text-muted);
    padding: 4px 8px;
    flex-shrink: 0;
  }
}

/* =============================================
   PLATFORM PILLS
   ============================================= */
.platform-pills-bar {
  padding: 16px 48px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.platform-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.platform-pills::-webkit-scrollbar { display: none; }

@media (max-width: 600px) {
  .platform-pills { flex-wrap: nowrap; }
}

.platform-pill {
  padding: 7px 18px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #2a2a2a;
  color: var(--text-muted);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.platform-pill:hover {
  background: #3a3a3a;
  color: var(--text);
}

.platform-pill.active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

/* =============================================
   PLATFORM HERO
   ============================================= */
.platform-hero {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.featured-epg-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 8px 48px 16px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.featured-epg-row::-webkit-scrollbar { display: none; }

.featured-epg-card {
  flex: 0 0 260px;
  background: #181818;
  border: 1px solid #2a2a2a;
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition), transform 0.25s ease;
}

.featured-epg-card:hover {
  border-color: var(--red);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.featured-epg-thumb {
  height: 130px;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.featured-epg-thumb img {
  max-width: 65%;
  max-height: 90px;
  object-fit: contain;
}

.featured-epg-thumb-fallback {
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--red);
}

.featured-epg-live {
  position: absolute;
  top: 8px;
  right: 8px;
}

.featured-epg-body {
  padding: 14px;
}

.featured-epg-channel {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.featured-epg-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-epg-time {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--red);
}

.featured-epg-platform {
  margin-top: 8px;
}

.featured-epg-platform .badge {
  font-size: 0.6rem;
  padding: 2px 6px;
  letter-spacing: 0.5px;
}

/* =============================================
   CHANNEL CARD ENHANCEMENTS
   ============================================= */
.card-new-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 5;
  background: var(--red);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: 2px;
}

.card-epg-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 8px;
  background: rgba(0,0,0,0.88);
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 3;
}

.card-epg-bar .now-dot {
  color: var(--red);
  margin-right: 3px;
  font-size: 0.58rem;
}

.card-epg-now {
  font-size: 0.68rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 3px;
  line-height: 1.2;
}

.card-epg-now .now-dot {
  color: var(--red);
  margin-right: 2px;
  font-size: 0.6rem;
}

/* =============================================
   PLATFORM BRAND COLORS
   ============================================= */
.badge-platform-pluto   { background: #F9B42D !important; color: #000 !important; }
.badge-platform-roku    { background: #6B4FBB !important; color: #fff !important; }
.badge-platform-samsung { background: #1428A0 !important; color: #fff !important; }
.badge-platform-plex    { background: #E5A00D !important; color: #000 !important; }
.badge-platform-tubi    { background: #fa4040 !important; color: #fff !important; }
.badge-platform-peacock { background: #0070cc !important; color: #fff !important; }
.badge-platform-freevee { background: #00a8e0 !important; color: #fff !important; }

/* =============================================
   CHANNEL DETAIL — Enhanced
   ============================================= */
.detail-body {
  padding: 0;
  max-width: none;
}

.detail-country {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.detail-epg-section {
  padding: 36px 48px;
  border-bottom: 1px solid var(--border);
}

.detail-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.on-now-card {
  background: #181818;
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  max-width: 560px;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 16px;
}

.on-now-show-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.on-now-time-remaining {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--red);
}

.schedule-list {
  display: flex;
  flex-direction: column;
  max-width: 560px;
}

.schedule-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.schedule-item:last-child { border-bottom: none; }

.schedule-time {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dim);
  width: 68px;
  flex-shrink: 0;
}

.schedule-title {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.detail-similar-section {
  padding: 20px 0 20px;
  border-bottom: 1px solid var(--border);
}

.detail-similar-section .genre-header {
  padding: 0 48px;
  margin-bottom: 12px;
}

.detail-suggest-edit {
  display: block;
  padding: 28px 48px;
  font-size: 0.8rem;
  color: var(--text-dim);
  transition: color var(--transition);
}

.detail-suggest-edit:hover { color: var(--text-muted); }

/* =============================================
   RESPONSIVE — new additions
   ============================================= */
@media (max-width: 900px) {
  .platform-pills-bar { padding: 12px 20px 8px; }
  .featured-epg-row   { padding: 8px 20px 16px; }
  .detail-epg-section { padding: 24px 20px; }
  .detail-similar-section .genre-header { padding: 0 20px; }
  .detail-suggest-edit { padding: 24px 20px; }
}

@media (max-width: 600px) {
  .featured-epg-card { flex: 0 0 220px; }
  .featured-epg-thumb { height: 100px; }
}

/* =============================================
   EPG CARD MODAL
   ============================================= */
.epg-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.epg-modal-backdrop.open {
  display: flex;
}

.epg-modal {
  background: #1c1c1c;
  border: 1px solid #333;
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
  overflow: hidden;
  position: relative;
  animation: modalIn 0.18s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.epg-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: background 0.15s;
}
.epg-modal-close:hover { background: rgba(255,255,255,0.2); }

.epg-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid #2a2a2a;
}

.epg-modal-logo {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: contain;
  background: #111;
  flex-shrink: 0;
}

.epg-modal-logo-fallback {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: var(--red-dim);
  color: var(--red);
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.epg-modal-channel {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 40px; /* room for close btn */
}

.epg-modal-body {
  padding: 16px;
}

.epg-modal-show {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 8px;
}

.epg-modal-time {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 12px;
}

.epg-modal-platform {
  margin-bottom: 16px;
}

.epg-modal-platform .badge {
  font-size: 0.72rem;
  padding: 4px 10px;
}

.epg-modal-actions {
  display: flex;
  gap: 10px;
}

.epg-modal-btn {
  flex: 1;
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: opacity 0.15s;
}
.epg-modal-btn:hover { opacity: 0.85; }

.epg-modal-btn-primary {
  background: var(--red);
  color: #fff;
}

.epg-modal-btn-secondary {
  background: rgba(255,255,255,0.08);
  color: var(--text-muted);
  border: 1px solid #333;
}

@media (max-width: 600px) {
  .epg-modal-backdrop { padding: 0; align-items: flex-end; }
  .epg-modal { max-width: 100%; border-radius: 16px 16px 0 0; }
  .epg-modal-close { width: 44px; height: 44px; top: 14px; right: 14px; font-size: 1.3rem; }
  .epg-modal-show { font-size: 1.15rem; }
  .epg-modal-btn { padding: 14px 16px; font-size: 0.9rem; }
}

/* =============================================
   MODAL — COMING UP NEXT
   ============================================= */
.epg-modal-next {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 10px;
  margin-bottom: 16px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* =============================================
   GENRE PILLS
   ============================================= */
.genre-pills-bar {
  padding: 10px 48px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

/* Extra genre pills — hidden on desktop (shown in More dropdown),
   visible on mobile as part of the scrollable row */
@media (min-width: 601px) {
  .genre-pill-extra { display: none; }
  .genre-more-wrap  { display: inline-flex; align-items: center; }
}
@media (max-width: 600px) {
  .genre-pills-bar  { padding: 8px 20px 10px; }
  .genre-pill-extra { display: inline-flex; }
  .genre-more-wrap  { display: none; }
  .genre-pills      { flex-wrap: nowrap; }
}

.genre-more-wrap {
  flex-shrink: 0;
  z-index: 100;
}

.genre-more-dropdown {
  display: none;
  position: fixed; /* fixed so it's never clipped by overflow-x: auto */
  min-width: 180px;
  background: #222;
  border: 1px solid #3a3a3a;
  border-radius: 10px;
  padding: 6px;
  z-index: 200;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  scrollbar-width: thin;
}

.genre-more-dropdown.open {
  display: block;
}

.genre-more-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.genre-more-item:hover {
  background: #333;
  color: var(--text);
}

.genre-more-item.active {
  background: var(--red);
  color: #fff;
}

/* =============================================
   VIEW TOGGLE BAR
   ============================================= */
.view-toggle-bar {
  display: flex;
  gap: 8px;
  padding: 12px 48px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.view-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.view-toggle-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-color: #444;
}

.view-toggle-btn.active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

/* Toggle-bar Suggest button — mobile only, hidden on desktop */
.suggest-toggle-btn {
  display: none;
  margin-left: auto;
  font-size: 0.82rem;
  padding: 7px 14px;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  /* Show the toggle-bar button, hide the navbar button */
  .suggest-toggle-btn       { display: inline-flex; }
  .navbar .suggest-nav-btn  { display: none !important; }
}

@media (max-width: 600px) {
  .view-toggle-bar { padding: 10px 16px; }
  .suggest-toggle-btn { font-size: 0.75rem; padding: 6px 10px; }
}

/* =============================================
   LIVE GUIDE
   ============================================= */
#guideSection {
  padding: 0 0 60px;
}

.guide-wrap {
  position: relative;
}

/* ---- Sticky time header (sticks to viewport, outside scroll container) ---- */
.guide-sticky-header {
  position: sticky;
  top: var(--nav-height);   /* sit just below the fixed navbar */
  z-index: 20;
  display: flex;
  height: 36px;
  background: var(--bg);
  border-bottom: 2px solid var(--border);
}

.guide-corner {
  width: 100px;
  flex-shrink: 0;
  background: var(--bg-dark);
  border-right: 1px solid var(--border);
  z-index: 1;
}

/* Clips the scrolling time labels without showing a scrollbar */
.guide-time-viewport {
  overflow: hidden;
  flex: 1;
  position: relative;
}

.guide-time-cells {
  position: relative;
  height: 100%;
}

.guide-time-cell {
  position: absolute;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  border-left: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}

/* ---- Horizontal-scroll body (no height = page controls vertical scroll) ---- */
.guide-body-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.guide-body-scroll::-webkit-scrollbar       { height: 6px; }
.guide-body-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.guide-body-scroll::-webkit-scrollbar-track { background: transparent; }

.guide-inner {
  /* width set inline by JS */
}

/* Guide body */
.guide-body {
  position: relative;
}

/* Channel row */
.guide-row {
  display: flex;
  /* height set inline by JS */
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.guide-row:hover .guide-programs-cell {
  background: rgba(255,255,255,0.012);
}

/* Channel cell — sticky left within .guide-body-scroll */
.guide-channel-cell {
  /* width set inline by JS */
  flex-shrink: 0;
  position: sticky;
  left: 0;
  z-index: 10;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  overflow: hidden;
  box-sizing: border-box;
  cursor: default;
}

.guide-channel-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
}

/* No-logo fallback: channel name text, centered, max 2 lines */
.guide-channel-fallback {
  width: 80px;
  height: 80px;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-align: center;
  padding: 4px 6px;
  line-height: 1.3;
  overflow: hidden;
  word-break: break-word;
  display: grid;
  place-items: center;
  /* clamp to 2 lines inside the grid cell */
}

/* program inner wrapper — stacks title + time vertically */
.guide-program-inner {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  width: 100%;
}

.guide-program-time {
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* Programs cell */
.guide-programs-cell {
  position: relative;
  /* width & height set inline by JS */
  background: var(--bg);
  transition: background 0.1s;
}

/* Program block */
.guide-program {
  position: absolute;
  top: 8px;
  height: calc(100% - 16px);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 6px;
  overflow: hidden;       /* hard clip — nothing escapes the block boundary */
  clip-path: inset(0);    /* belt-and-suspenders for subpixel bleed */
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0 12px;
  transition: background 0.12s, border-color 0.12s;
  box-sizing: border-box;
  min-width: 0;
}

.guide-program:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.26);
}

/* Currently airing — subtle red tint */
.guide-program-now {
  background: rgba(229,9,20,0.16);
  border-color: rgba(229,9,20,0.35);
}

.guide-program-now:hover {
  background: rgba(229,9,20,0.26);
}

.guide-program-title {
  font-size: 0.875rem;  /* 14px */
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* Current-time vertical line */
.guide-now-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--red);
  z-index: 8;
  pointer-events: none;
}

.guide-now-line::before {
  content: '';
  position: absolute;
  top: 0;
  left: -4px;
  width: 10px;
  height: 10px;
  background: var(--red);
  border-radius: 50%;
}

.guide-end-message {
  padding: 24px 0 8px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Guide nav buttons removed — guide is now scrollable via touch/mouse */

/* Logo wrapper — relative so the platform dot can overlay the corner */
.guide-logo-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

/* Platform dot — bottom-right corner of logo, desktop only */
.guide-platform-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,0.45);
  z-index: 5;
  cursor: default;
  background: var(--red); /* fallback */
}

.guide-platform-dot[data-platform="Pluto TV"]        { background: #F9B42D; }
.guide-platform-dot[data-platform="Roku"]            { background: #6B4FBB; }
.guide-platform-dot[data-platform="Samsung TV Plus"] { background: #1428A0; }
.guide-platform-dot[data-platform="Plex"]            { background: #E5A00D; }

/* Platform pill — hidden on desktop (dot is used instead), shown on mobile */
.guide-channel-platform {
  display: none;
  font-size: 0.69rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  margin-top: 4px;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
  flex-shrink: 0;
}

/* On mobile: hide dot, show pill */
@media (max-width: 600px) {
  .guide-platform-dot    { display: none; }
  .guide-channel-platform { display: inline-block; }
}

@media (max-width: 600px) {
  .guide-corner,
  .guide-channel-cell { width: 72px !important; }
  .guide-channel-logo { width: 52px; height: 52px; }
  .guide-channel-fallback { width: 52px; height: 52px; font-size: 0.62rem; }
  .guide-program-time { font-size: 10px; }
  .guide-channel-platform { font-size: 0.6rem; max-width: 64px; padding: 1px 5px; }
  /* Navbar is nowrap+fixed-height on mobile so top offset stays correct */
  .guide-sticky-header { top: var(--nav-height); }
}

/* =============================================
   MOBILE SEARCH MODAL
   ============================================= */
.search-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.75);
  flex-direction: column;
}
.search-modal.open { display: flex; }

.search-modal-inner {
  background: var(--bg-dark);
  width: 100%;
  max-width: 640px;        /* centered panel on desktop */
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
  border-radius: 0 0 12px 12px;
  margin: 0 auto;          /* center horizontally */
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

.search-modal-bar {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.search-modal-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
  color: var(--text-dim);
}

.search-modal-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.1rem;
  outline: none;
  min-width: 0;
}
.search-modal-input::placeholder { color: var(--text-dim); }

.search-modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 6px;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.15s;
}
.search-modal-close:hover { color: var(--text); }

.search-modal-results {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}

.search-modal-hint {
  padding: 28px 16px;
  color: var(--text-dim);
  font-size: 0.9rem;
  text-align: center;
}

.search-modal-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.search-modal-item:hover { background: rgba(255,255,255,0.06); }

.search-modal-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.04);
}

.search-modal-logo-fallback {
  width: 44px;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
  color: var(--text);
}

.search-modal-name {
  font-size: 1rem;
  color: var(--text);
  font-weight: 500;
}

/* =============================================
   TVMAZE INTEGRATION
   ============================================= */

/* ---- Show Hero (single-show channel) ---- */
.show-hero {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.show-poster {
  width: 150px;
  min-width: 150px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  aspect-ratio: 2 / 3;
  flex-shrink: 0;
}
.show-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.show-poster-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--text-dim);
}
.show-hero-info { flex: 1; min-width: 0; }
.show-hero-title {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 10px;
}
.show-rating {
  color: var(--red);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 8px;
}
.show-status-running {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(39, 174, 96, 0.2);
  color: #2ecc71;
  margin-right: 8px;
  margin-bottom: 8px;
}
.show-status-ended {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(107, 107, 107, 0.3);
  color: var(--text-muted);
  margin-right: 8px;
  margin-bottom: 8px;
}
.show-network {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.show-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.show-genre-pill {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

/* ---- Synopsis ---- */
.show-synopsis {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 4px;
}
.show-synopsis-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}
.show-synopsis-text {
  font-size: 0.93rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ---- Cast ---- */
.cast-section {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 4px;
}
.cast-section-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text);
}
.cast-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.cast-row::-webkit-scrollbar { height: 4px; }
.cast-row::-webkit-scrollbar-track { background: transparent; }
.cast-row::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.cast-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 80px;
  max-width: 80px;
  flex-shrink: 0;
}
.cast-photo {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-card);
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.cast-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cast-photo-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--bg-card);
}
.cast-actor-name {
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
  color: var(--text);
  line-height: 1.3;
  word-break: break-word;
}
.cast-char-name {
  font-size: 0.66rem;
  text-align: center;
  color: var(--text-muted);
  line-height: 1.2;
  word-break: break-word;
}

/* ---- Seasons & Episodes ---- */
.seasons-section {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 4px;
}
.seasons-section-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text);
}
.season-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 8px;
  overflow: hidden;
}
.season-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}
.season-header:hover { background: var(--bg-card-hover); }
.season-header-label { font-weight: 700; font-size: 0.92rem; }
.season-header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}
.season-header-count {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.season-chevron {
  font-size: 0.72rem;
  color: var(--text-muted);
  transition: transform 0.2s;
  display: inline-block;
}
.season-chevron.open { transform: rotate(180deg); }
.season-episodes {
  display: none;
  background: rgba(0, 0, 0, 0.2);
}
.season-episodes.open { display: block; }
.episode-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 6px 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  align-items: start;
}
.episode-item:last-child { border-bottom: none; }
.episode-num {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 600;
  padding-top: 2px;
}
.episode-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.episode-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.45;
  grid-column: 2;
}
.episode-date {
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
  padding-top: 2px;
}

/* ---- TVmaze attribution ---- */
.tvmaze-attribution {
  font-size: 0.76rem;
  color: var(--text-dim);
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.tvmaze-attribution a { color: var(--text-muted); text-decoration: underline; }
.tvmaze-attribution a:hover { color: var(--text); }

/* ---- Show Detail Modal (Experience 2) ---- */
.show-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.show-modal {
  background: #1c1c1c;
  border-radius: 12px;
  width: 100%;
  max-width: 500px;
  max-height: 84vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
}
/* Channel header strip — mirrors epg-modal-header */
.show-modal-channel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.show-modal-channel-logo {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: contain;
  background: #111;
  flex-shrink: 0;
}
.show-modal-channel-fallback {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: var(--red-dim);
  color: var(--red);
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.show-modal-channel-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  padding-right: 40px; /* room for close btn */
}
.show-modal-close {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-muted);
  z-index: 10;
  transition: background var(--transition), color var(--transition);
  border: none;
  flex-shrink: 0;
}
.show-modal-close:hover { background: rgba(255, 255, 255, 0.18); color: var(--text); }
.show-modal-inner { padding: 16px 20px 20px; }
.show-modal-header {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}
.show-modal-poster {
  width: 88px;
  min-width: 88px;
  height: 128px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card);
  flex-shrink: 0;
}
.show-modal-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.show-modal-poster-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.show-modal-info { flex: 1; min-width: 0; }
.show-modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 7px;
}
.show-modal-rating {
  color: var(--red);
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 6px;
}
.show-modal-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.show-modal-genre-pill {
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.68rem;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}
.show-modal-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.show-modal-summary {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.62;
  margin-bottom: 14px;
}
.show-modal-airing {
  background: rgba(229, 9, 20, 0.08);
  border: 1px solid rgba(229, 9, 20, 0.22);
  border-radius: var(--radius-lg);
  padding: 11px 14px;
  margin-bottom: 14px;
}
.show-modal-airing-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--red);
  margin-bottom: 5px;
}
.show-modal-airing-info {
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.5;
}
.show-modal-omdb-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  line-height: 1.5;
}
.show-modal-attribution {
  font-size: 0.72rem;
  color: var(--text-dim);
}
.show-modal-attribution a { color: var(--text-muted); text-decoration: underline; }
.show-modal-attribution a:hover { color: var(--text); }
.show-modal-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 52px;
}
.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: tvmaze-spin 0.7s linear infinite;
}
@keyframes tvmaze-spin { to { transform: rotate(360deg); } }

/* ---- On Now enriched card ---- */
.on-now-poster {
  width: 90px;
  min-width: 90px;
  height: 90px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.on-now-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.on-now-info { flex: 1; min-width: 0; }
.on-now-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.on-now-rating {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}
.on-now-more-btn {
  display: block;
  font-size: 0.78rem;
  color: var(--red);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-top: 6px;
  text-align: left;
  transition: color var(--transition);
}
.on-now-more-btn:hover { color: var(--red-hover); }

/* ---- Clickable schedule items ---- */
.schedule-item.clickable {
  cursor: pointer;
  border-radius: var(--radius);
  padding: 6px 8px;
  margin: 0 -8px;
  transition: background var(--transition);
}
.schedule-item.clickable:hover { background: rgba(255, 255, 255, 0.05); }
.on-now-card.clickable { cursor: pointer; transition: background var(--transition); }
.on-now-card.clickable:hover { background: rgba(255, 255, 255, 0.04); }

/* ---- Mobile ---- */
@media (max-width: 640px) {
  .show-hero { flex-direction: column; align-items: center; text-align: center; }
  .show-poster { width: 120px; min-width: 120px; }
  .show-genres { justify-content: center; }
  .show-hero-info .show-rating,
  .show-hero-info .show-network { text-align: center; }
  .show-modal-header { flex-direction: column; align-items: center; text-align: center; }
  .show-modal-genres { justify-content: center; }
  .show-modal-meta { justify-content: center; }
  .episode-item { grid-template-columns: 28px 1fr; }
  .episode-date { grid-column: 2; padding-top: 0; }
}
