/* =========================================================
   Live TV page — premium OTT UI (scoped; no JS/backend impact)
   ========================================================= */

.live-tv-page {
  --ltv-bg: #06041a;
  --ltv-surface: rgba(22, 20, 40, 0.72);
  --ltv-surface-solid: #12101f;
  --ltv-glass: rgba(255, 255, 255, 0.06);
  --ltv-glass-border: rgba(255, 255, 255, 0.1);
  --ltv-text: #f4f2ff;
  --ltv-muted: rgba(244, 242, 255, 0.62);
  --ltv-accent: #782ecb;
  --ltv-accent-2: #00e3c2;
  --ltv-danger: #ff3b5c;
  --ltv-radius: 16px;
  --ltv-radius-sm: 12px;
  --ltv-radius-xs: 8px;
  --ltv-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --ltv-shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.28);
  --ltv-space: 8px;
  --ltv-nav-offset: 96px;
  --ltv-font: "SofiaPro", "Oswald", system-ui, sans-serif;
  color: var(--ltv-text);
  font-family: var(--ltv-font);
  position: relative;
  overflow-x: clip;
  padding-bottom: calc(var(--ltv-space) * 6);
}

.live-tv-page::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 520px;
  background:
    radial-gradient(ellipse 70% 55% at 15% 0%, rgba(120, 46, 203, 0.28), transparent 60%),
    radial-gradient(ellipse 50% 40% at 85% 10%, rgba(0, 227, 194, 0.12), transparent 55%),
    linear-gradient(180deg, rgba(8, 6, 28, 0.4) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.live-tv-page > * {
  position: relative;
  z-index: 1;
}

.live-tv-page .live-tv-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding-left: calc(var(--ltv-space) * 3);
  padding-right: calc(var(--ltv-space) * 3);
  padding-bottom: calc(var(--ltv-space) * 4);
}

/* ---------- Player stage ---------- */
.live-tv-page .live-tv-stage {
  margin-bottom: calc(var(--ltv-space) * 4);
}

.live-tv-page .live-tv-player-frame {
  position: relative;
  border-radius: var(--ltv-radius);
  overflow: hidden;
  background: #000;
  box-shadow: var(--ltv-shadow);
  border: 1px solid var(--ltv-glass-border);
  isolation: isolate;
}

.live-tv-page .live-tv-player-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  z-index: 3;
}

@media (min-width: 992px) {
  .live-tv-page .live-tv-player-sticky {
    position: sticky;
    top: var(--ltv-nav-offset);
    z-index: 30;
  }
}

.live-tv-page .live-tv-player-frame .player,
.live-tv-page .live-tv-player-frame .plyr,
.live-tv-page .live-tv-player-frame video#player1 {
  width: 100%;
  max-height: min(72vh, 760px);
  aspect-ratio: 16 / 9;
  background: #000;
  display: block;
  border-radius: 0;
}

.live-tv-page .live-tv-player-frame .plyr {
  border-radius: var(--ltv-radius);
}

.live-tv-page .live-tv-player-frame .plyr__video-wrapper {
  background: #000;
}

/* Floating glass controls */
.live-tv-page .plyr__controls {
  background: rgba(10, 8, 24, 0.55) !important;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  margin: 0 16px 16px;
  padding: 6px 14px !important;
  width: calc(100% - 32px);
  left: 16px;
  right: 16px;
  bottom: 12px;
  box-shadow: var(--ltv-shadow-soft);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.live-tv-page .plyr--hide-controls .plyr__controls {
  transform: translateY(8px);
}

.live-tv-page .plyr__control {
  border-radius: 999px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.live-tv-page .plyr__control:hover,
.live-tv-page .plyr__control:focus-visible {
  background: rgba(120, 46, 203, 0.45) !important;
  transform: scale(1.06);
}

.live-tv-page .plyr__control:focus-visible {
  outline: 2px solid var(--ltv-accent-2);
  outline-offset: 2px;
}

.live-tv-page .plyr__volume {
  max-width: 120px;
}

/* Live mode: hide non-essential Plyr chrome (same as previous inline rules) */
.live-tv-page .playlist-button,
.live-tv-page .plyr__controls button[data-plyr="play"],
.live-tv-page .plyr__control--overlaid,
.live-tv-page .plyr__progress,
.live-tv-page .plyr__time--current,
.live-tv-page .plyr__time--duration,
.live-tv-page .plyr__controls button[data-plyr="settings"],
.live-tv-page .plyr__controls button[data-plyr="airplay"],
.live-tv-page .plyr__controls button[data-plyr="restart"],
.live-tv-page .plyr__controls button[data-plyr="rewind"],
.live-tv-page .plyr__controls button[data-plyr="fast-forward"],
.live-tv-page .plyr__controls button[data-plyr="pip"] {
  display: none !important;
}

/* Overlay badges on player */
.live-tv-page .live-tv-overlay {
  position: absolute;
  top: calc(var(--ltv-space) * 2);
  left: calc(var(--ltv-space) * 2);
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: var(--ltv-space);
  pointer-events: none;
}

.live-tv-page .live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 59, 92, 0.92);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  box-shadow: 0 6px 16px rgba(255, 59, 92, 0.35);
}

.live-tv-page .live-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: ltv-pulse 1.4s ease-in-out infinite;
}

@keyframes ltv-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.live-tv-page .stream-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--ltv-glass);
  border: 1px solid var(--ltv-glass-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ltv-text);
  font-size: 12px;
  font-weight: 500;
}

.live-tv-page .stream-status-chip.is-offline {
  background: rgba(0, 0, 0, 0.55);
  color: var(--ltv-muted);
}

.live-tv-page .viewer-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--ltv-glass-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ltv-muted);
  font-size: 12px;
}

/* ---------- Meta / title / share ---------- */
.live-tv-page .live-tv-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: calc(var(--ltv-space) * 2);
  margin-top: calc(var(--ltv-space) * 3);
}

@media (min-width: 992px) {
  .live-tv-page .live-tv-meta {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: calc(var(--ltv-space) * 3);
    align-items: start;
  }
}

.live-tv-page .live-tv-meta-card,
.live-tv-page .live-tv-side-card {
  background: var(--ltv-surface);
  border: 1px solid var(--ltv-glass-border);
  border-radius: var(--ltv-radius);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  box-shadow: var(--ltv-shadow-soft);
  padding: calc(var(--ltv-space) * 3);
}

.live-tv-page .live-tv-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ltv-space);
  margin-bottom: calc(var(--ltv-space) * 2);
}

.live-tv-page .live-tv-meta-card h1,
.live-tv-page .live-tv-meta-card h4#dynamicTitle,
.live-tv-page #dynamicTitle {
  margin: 0 0 calc(var(--ltv-space) * 1.5);
  color: var(--ltv-text);
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.live-tv-page #dynamicDesc {
  margin: 0;
  color: var(--ltv-muted);
  font-size: 0.95rem;
  line-height: 1.65;
  max-width: 72ch;
}

.live-tv-page .live-tv-side-card h3 {
  margin: 0 0 calc(var(--ltv-space) * 2);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ltv-muted);
}

.live-tv-page .live-tv-channel-row {
  display: flex;
  align-items: center;
  gap: calc(var(--ltv-space) * 1.5);
  margin-bottom: calc(var(--ltv-space) * 2.5);
}

.live-tv-page .live-tv-channel-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(120, 46, 203, 0.9), rgba(0, 227, 194, 0.55));
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: #fff;
  box-shadow: 0 8px 20px rgba(120, 46, 203, 0.35);
  flex-shrink: 0;
}

.live-tv-page .live-tv-channel-copy strong {
  display: block;
  font-size: 0.95rem;
  color: var(--ltv-text);
  margin-bottom: 2px;
}

.live-tv-page .live-tv-channel-copy span {
  font-size: 0.8rem;
  color: var(--ltv-muted);
}

.live-tv-page .live-tv-share {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ltv-space);
}

.live-tv-page .live-tv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none !important;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.live-tv-page .live-tv-btn:focus-visible {
  outline: 2px solid var(--ltv-accent-2);
  outline-offset: 3px;
}

.live-tv-page .live-tv-btn-primary {
  background: linear-gradient(135deg, #8b3de0 0%, #6320b8 100%);
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(120, 46, 203, 0.35);
}

.live-tv-page .live-tv-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(120, 46, 203, 0.45);
  color: #fff !important;
}

.live-tv-page .live-tv-btn-ghost {
  background: var(--ltv-glass);
  border-color: var(--ltv-glass-border);
  color: var(--ltv-text) !important;
}

.live-tv-page .live-tv-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  color: #fff !important;
}

.live-tv-page .live-tv-share-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: calc(var(--ltv-space) * 2);
}

.live-tv-page .live-tv-share-links a {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff !important;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--ltv-glass-border);
  transition: transform 0.2s ease, background 0.2s ease;
}

.live-tv-page .live-tv-share-links a:hover,
.live-tv-page .live-tv-share-links a:focus-visible {
  transform: translateY(-2px) scale(1.05);
  background: rgba(120, 46, 203, 0.45);
}

.live-tv-page .live-tv-share-links a:focus-visible {
  outline: 2px solid var(--ltv-accent-2);
  outline-offset: 2px;
}

/* ---------- Offline / empty / error states ---------- */
.live-tv-page #image-div {
  margin-bottom: calc(var(--ltv-space) * 3);
}

.live-tv-page .live-tv-offline {
  position: relative;
  border-radius: var(--ltv-radius);
  overflow: hidden;
  border: 1px solid var(--ltv-glass-border);
  background: var(--ltv-surface-solid);
  box-shadow: var(--ltv-shadow);
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--ltv-space) * 4);
}

.live-tv-page .live-tv-offline img {
  max-width: min(420px, 100%);
  height: auto;
  opacity: 0.9;
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.45));
}

.live-tv-page .live-tv-offline-panel {
  position: absolute;
  inset: auto 16px 16px 16px;
  padding: 16px 18px;
  border-radius: var(--ltv-radius-sm);
  background: rgba(8, 6, 22, 0.72);
  border: 1px solid var(--ltv-glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  text-align: center;
}

.live-tv-page .live-tv-offline-panel h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
  color: var(--ltv-text);
}

.live-tv-page .live-tv-offline-panel p {
  margin: 0;
  color: var(--ltv-muted);
  font-size: 0.9rem;
}

.live-tv-page .live-tv-empty {
  margin: calc(var(--ltv-space) * 4) 0;
  padding: calc(var(--ltv-space) * 5) calc(var(--ltv-space) * 3);
  border-radius: var(--ltv-radius);
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(120, 46, 203, 0.12), rgba(18, 16, 31, 0.5));
  text-align: center;
}

.live-tv-page .live-tv-empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto calc(var(--ltv-space) * 2);
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--ltv-glass);
  border: 1px solid var(--ltv-glass-border);
  color: var(--ltv-accent-2);
  font-size: 1.4rem;
}

.live-tv-page .live-tv-empty h4 {
  margin: 0 0 8px;
  color: var(--ltv-text);
  font-size: 1.15rem;
}

.live-tv-page .live-tv-empty p {
  margin: 0 auto;
  max-width: 36ch;
  color: var(--ltv-muted);
  font-size: 0.92rem;
}

/* ---------- Section header ---------- */
.live-tv-page .live-tv-section {
  margin-top: calc(var(--ltv-space) * 5);
  margin-bottom: calc(var(--ltv-space) * 2);
}

.live-tv-page .live-tv-section .heading-01 {
  text-align: left;
  margin-bottom: calc(var(--ltv-space) * 3);
}

.live-tv-page .live-tv-section .heading-01 h3 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 600;
  color: var(--ltv-text);
  letter-spacing: 0.01em;
}

.live-tv-page .live-tv-section .heading-01 p {
  margin: 8px 0 0;
  color: var(--ltv-muted);
  font-size: 0.9rem;
}

/* ---------- Related / additional video cards ---------- */
.live-tv-page .live-tv-section .swiper-01 {
  padding: 4px 2px 8px;
}

.live-tv-page .live-tv-section .swiper-01 .swiper-button-next,
.live-tv-page .live-tv-section .swiper-01 .swiper-button-prev {
  width: 42px;
  height: 42px;
  margin-top: -21px;
  border-radius: 50%;
  background: rgba(18, 16, 31, 0.85);
  border: 1px solid var(--ltv-glass-border);
  backdrop-filter: blur(10px);
  box-shadow: var(--ltv-shadow-soft);
  transition: transform 0.2s ease, background 0.2s ease;
}

.live-tv-page .live-tv-section .swiper-01 .swiper-button-next:after,
.live-tv-page .live-tv-section .swiper-01 .swiper-button-prev:after {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.live-tv-page .live-tv-section .swiper-01 .swiper-button-next:hover,
.live-tv-page .live-tv-section .swiper-01 .swiper-button-prev:hover {
  background: rgba(120, 46, 203, 0.85);
  transform: scale(1.06);
}

.live-tv-page .product-01.show-card.add-program-video {
  background: transparent;
  transition: transform 0.28s ease;
}

.live-tv-page .product-01.show-card.add-program-video:hover {
  transform: translateY(-6px);
}

.live-tv-page .product-01.show-card.add-program-video .img {
  border-radius: var(--ltv-radius-sm);
  overflow: hidden;
  margin-bottom: calc(var(--ltv-space) * 1.5) !important;
  border: 1px solid var(--ltv-glass-border);
  box-shadow: var(--ltv-shadow-soft);
  background: #0c0a18;
  aspect-ratio: 16 / 10;
}

.live-tv-page .product-01.show-card.add-program-video .img img.img1,
.live-tv-page .product-01.show-card.add-program-video .img .video1 {
  height: 100%;
  width: 100%;
  object-fit: cover;
  border-radius: 0;
  transition: transform 0.4s ease, opacity 0.3s ease;
}

.live-tv-page .product-01.show-card.add-program-video:hover .img img.img1 {
  transform: scale(1.04);
}

.live-tv-page .product-01.show-card.add-program-video .txt {
  text-align: left;
  padding: 0 2px;
}

.live-tv-page .product-01.show-card.add-program-video .txt2 .ply a {
  color: var(--ltv-accent-2) !important;
  font-weight: 500;
  transition: color 0.2s ease;
}

.live-tv-page .product-01.show-card.add-program-video .txt2 .ply a:hover {
  color: #fff !important;
}

.live-tv-page .product-01.show-card.add-program-video .txt2 > p a {
  color: var(--ltv-text) !important;
  font-weight: 500;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.live-tv-page .product-01.show-card.add-program-video .txt2 > p a:hover,
.live-tv-page .product-01.show-card.add-program-video .txt2 > p a:focus-visible {
  color: #c9a6ff !important;
}

.live-tv-page .product-01.show-card.add-program-video a:focus-visible {
  outline: 2px solid var(--ltv-accent-2);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Loading skeleton (Plyr loading / offline wait) ---------- */
.live-tv-page .live-tv-skeleton {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    110deg,
    #0e0c1c 25%,
    #1a1730 37%,
    #0e0c1c 63%
  );
  background-size: 200% 100%;
  animation: ltv-shimmer 1.4s linear infinite;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.live-tv-page .plyr--loading + .live-tv-skeleton,
.live-tv-page .live-tv-player-frame.is-loading .live-tv-skeleton {
  opacity: 1;
}

@keyframes ltv-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.live-tv-page .live-tv-card-skeleton {
  border-radius: var(--ltv-radius-sm);
  overflow: hidden;
  background: #12101f;
  border: 1px solid var(--ltv-glass-border);
}

.live-tv-page .live-tv-card-skeleton .sk-thumb {
  aspect-ratio: 16 / 10;
  background: linear-gradient(110deg, #141224 25%, #221e3a 37%, #141224 63%);
  background-size: 200% 100%;
  animation: ltv-shimmer 1.4s linear infinite;
}

.live-tv-page .live-tv-card-skeleton .sk-line {
  height: 12px;
  margin: 12px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
}

.live-tv-page .live-tv-card-skeleton .sk-line.short {
  width: 55%;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .live-tv-page {
    --ltv-nav-offset: 72px;
  }

  .live-tv-page .live-tv-shell {
    padding-left: calc(var(--ltv-space) * 2);
    padding-right: calc(var(--ltv-space) * 2);
  }

  .live-tv-page .live-tv-player-frame .player,
  .live-tv-page .live-tv-player-frame .plyr,
  .live-tv-page .live-tv-player-frame video#player1 {
    max-height: min(56vh, 480px);
  }

  .live-tv-page .plyr__controls {
    margin: 0 10px 10px;
    width: calc(100% - 20px);
    left: 10px;
    padding: 4px 10px !important;
    border-radius: 14px;
  }

  .live-tv-page .live-tv-overlay {
    top: 10px;
    left: 10px;
  }

  .live-tv-page .live-tv-meta-card,
  .live-tv-page .live-tv-side-card {
    padding: calc(var(--ltv-space) * 2.5);
  }
}

@media (max-width: 575.98px) {
  .live-tv-page .live-badge,
  .live-tv-page .stream-status-chip,
  .live-tv-page .viewer-chip {
    font-size: 11px;
    padding: 5px 10px;
  }

  .live-tv-page .live-tv-btn {
    width: 100%;
  }

  .live-tv-page .live-tv-share {
    width: 100%;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .live-tv-page *,
  .live-tv-page *::before,
  .live-tv-page *::after {
    animation: none !important;
    transition: none !important;
  }
}
