/* ==========================================================================
   Live TV section — channel grid + player
   Loaded only on live.php / watch-live.php, on top of style.css.
   ========================================================================== */

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 92, 122, 0.15);
  color: var(--danger);
  border: 1px solid rgba(255, 92, 122, 0.4);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 999px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
  animation: live-pulse 1.4s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.live-channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin: 14px 0 28px;
}

.live-channel-card {
  position: relative;
  display: block;
  aspect-ratio: 4 / 4.6;
  background: #0c0a12;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(.2,.8,.2,1), border-color 0.25s ease, box-shadow 0.25s ease;
  will-change: transform;
}

.live-channel-card:hover {
  transform: translateY(-4px) scale(1.015);
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(0,0,0,0.4), 0 0 18px var(--accent-glow);
}

.live-channel-card:active {
  transform: translateY(-1px) scale(0.99);
}

.live-channel-card .live-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
}

/* Full-bleed poster — the image is the entire card, edge to edge, no
   surrounding padding/gap. A slight scale crops out any built-in
   transparent margin many logo files ship with, so the mark itself
   reads bigger and fills the box instead of floating in empty space. */
.live-channel-logo-wrap {
  position: absolute;
  inset: 0 0 40px 0;
  background: linear-gradient(160deg, rgba(155,92,255,0.14), rgba(255,255,255,0.03));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
  box-sizing: border-box;
}

.live-channel-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  transform: scale(1.05);
  transition: transform 0.35s ease;
  filter: drop-shadow(0 2px 10px rgba(0,0,0,0.35));
}

.live-channel-card:hover .live-channel-logo-wrap img {
  transform: scale(1.1);
}

.live-channel-logo-fallback {
  color: var(--text-dim);
}
.live-channel-logo-fallback .icon {
  width: 34px;
  height: 34px;
}

.live-channel-cat {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.7rem;
  color: var(--accent-2);
  font-family: var(--font-mono);
}

/* "Play" — a rectangular glass bar pinned to the bottom edge of the
   poster (not a floating pill), so every card in a row lines up flush
   at the same spot regardless of the image behind it. */
.live-play-btn {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  height: 40px;
  border-radius: 0;
  background: rgba(12, 9, 18, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255,255,255,0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background 0.2s ease;
}
.live-play-btn .icon { width: 16px; height: 16px; color: var(--accent); }
.live-channel-card:hover .live-play-btn {
  background: rgba(155, 92, 255, 0.28);
}
.live-play-btn:active { transform: scale(0.98); }

/* ---- Player page ---- */

.live-player-page {
  margin: 12px 0 24px;
}

.live-player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--card-border);
}

.live-player-video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

.live-player-wrap .video-embed-wrap {
  width: 100%;
  height: 100%;
}
.live-player-wrap .video-embed-wrap iframe,
.live-player-wrap .video-embed-wrap video {
  width: 100%;
  height: 100%;
  border: 0;
}

.live-badge-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  background: rgba(10, 8, 16, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}

.live-player-meta {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.live-player-meta h1 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 4px 0 0;
}

.live-player-desc {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 0;
}

@media (max-width: 640px) {
  .live-channel-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 6px;
  }
}

/* ==========================================================================
   Premium upgrade — hero banner, category "type" rows, featured chip,
   watch-page action row. Loaded on top of the base rules above.
   ========================================================================== */

.live-page-head { margin-bottom: 4px; }

/* ---- Hero / featured channel banner ---- */

.live-hero {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  margin: 14px 0 22px;
  border: 1px solid var(--card-border);
  background: linear-gradient(160deg, rgba(155,92,255,0.16), rgba(10,10,16,0.9) 55%);
  text-decoration: none;
  color: inherit;
  min-height: 220px;
  isolation: isolate;
}

.live-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.live-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(38px) saturate(1.3) brightness(0.55);
  transform: scale(1.25);
}

.live-hero-glow {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(155,92,255,0.35), transparent 60%),
    linear-gradient(180deg, rgba(6,6,10,0.35), rgba(6,6,10,0.92) 85%);
}

.live-hero-content {
  position: relative;
  z-index: 2;
  padding: 22px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.live-hero-badge { align-self: flex-start; }

.live-hero-main {
  display: flex;
  align-items: center;
  gap: 16px;
}

.live-hero-logo-wrap {
  flex: 0 0 auto;
  width: 84px;
  height: 84px;
  border-radius: 20px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.live-hero-logo-wrap img { width: 100%; height: 100%; object-fit: contain; }

.live-hero-info { min-width: 0; }

.live-hero-eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 4px;
}

.live-hero-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 4px;
  line-height: 1.15;
}

.live-hero-desc {
  color: var(--text-dim);
  font-size: 0.86rem;
  margin: 0 0 8px;
  max-width: 56ch;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.live-hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.live-hero-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 560px) {
  .live-hero-main { align-items: flex-start; }
  .live-hero-logo-wrap { width: 60px; height: 60px; border-radius: 14px; }
  .live-hero-name { font-size: 1.2rem; }
}

/* ---- Category "type" rows (Netflix-style horizontal scroll) ---- */

.live-type-head { margin-top: 30px; }

.live-channel-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scrollbar-width: none;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.live-channel-row::-webkit-scrollbar { display: none; }
.live-channel-row .live-channel-card {
  flex: 0 0 auto;
  width: 150px;
  scroll-snap-align: start;
}

.live-type-row { margin-bottom: 6px; }

/* ---- Featured badge on channel cards ---- */

.live-featured-chip {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 196, 0, 0.15);
  color: #ffcf3c;
  border: 1px solid rgba(255, 196, 0, 0.4);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}
.live-featured-chip .icon { width: 10px; height: 10px; }

/* Premium card polish — gradient ring + a touch more depth than the base
   flat border, matching the hero's glassy feel. */
.live-channel-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.01));
  backdrop-filter: blur(6px);
}

/* ---- Watch-page action row (Like / Dislike / Save / Share / Comments) ---- */

.live-action-row.wp-action-row {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  margin-top: 14px;
}
.live-action-row .wp-action-btn {
  flex-direction: column;
  gap: 3px;
  padding: 9px 2px;
  font-size: 0.62rem;
  min-height: 44px;
  border-radius: 12px;
}
.live-action-row .wp-action-btn .icon { width: 16px; height: 16px; }
.live-action-row .live-react-count { font-size: 0.68rem; }

@media (min-width: 460px) {
  .live-action-row .wp-action-btn {
    flex-direction: row;
    font-size: 0.72rem;
    padding: 9px 4px;
  }
}

.live-react-btn.added {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(155, 92, 255, 0.12);
}
.live-react-btn.added .icon {
  color: var(--accent);
}
.live-react-count {
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

/* ---- Back button, top of the live player page ---- */

.live-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--card-border);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.live-back-btn:hover {
  background: rgba(155, 92, 255, 0.14);
  border-color: var(--accent);
}
.live-back-btn:active { transform: scale(0.96); }
.live-back-btn .icon { width: 16px; height: 16px; }

/* ---- General smoothness polish ---- */

.live-channel-grid,
.live-channel-row {
  scroll-behavior: smooth;
}

.wp-action-btn,
.live-hero-btn,
.live-save-toggle-btn {
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease, color 0.2s ease;
}
.wp-action-btn:active { transform: scale(0.96); }

