/* ============================================================================
   LWG TV — VOD Premium (Películas / Series / Anime)
   Tema azul oscuro premium, independiente del CSS global de en-vivo para
   no afectar Home/Live/SportsHub. Z-INDEX: vistas vod+overlays por debajo
   del player live y del login, por encima del contenido normal.
   ========================================================================== */

:root {
  --vod-bg: #070b16;
  --vod-bg2: #0c1322;
  --vod-card: #121a2e;
  --vod-card-hover: #1a2540;
  --vod-border: rgba(148, 178, 255, 0.14);
  --vod-accent: #3d8bff;
  --vod-accent2: #8ac1ff;
  --vod-accent-grad: linear-gradient(135deg, #2f7bff 0%, #5ea2ff 100%);
  --vod-text: #eef3ff;
  --vod-dim: #aebad4;
  --vod-muted: #6b7794;
  --vod-gold: #ffd166;
  --vod-focus: 0 0 0 3px rgba(61, 139, 255, 0.9), 0 8px 30px rgba(0, 0, 0, 0.7);
  --vod-rail-gap: 18px;
}

/* --------------------------- Vistas --------------------------- */
.vod-view {
  padding: 24px var(--page-px) 60px;
  min-height: 100vh;
}

.vod-view-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--vod-text);
  margin: 0 0 4px;
  padding: 12px 0 6px;
}

.vod-view-sub {
  font-size: 13px;
  color: var(--vod-dim);
  margin: 0 0 18px;
}

/* --------------------------- Hero --------------------------- */
.v-hero {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  min-height: 380px;
  display: flex;
  align-items: flex-end;
  background: linear-gradient(180deg, #0a1120 0%, #0c1428 60%, #0e1730 100%);
  isolation: isolate;
  margin-bottom: 34px;
}

.v-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 22%;
  transform: scale(1.02);
  z-index: 0;
}

.v-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 11, 22, 0.55) 0%, rgba(7, 11, 22, 0.12) 38%, rgba(7, 11, 22, 0.92) 100%),
    linear-gradient(90deg, rgba(7, 11, 22, 0.7) 0%, transparent 55%);
}

.v-hero-grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #0d1730 0%, rgba(10, 16, 32, 0.75) 55%, var(--vod-bg) 100%);
  z-index: 0;
}

.v-hero-content {
  position: relative;
  z-index: 1;
  padding: 34px 40px 28px;
  max-width: 620px;
}

.v-hero-type {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--vod-accent2);
  text-transform: uppercase;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(61, 139, 255, 0.16);
  border: 1px solid rgba(61, 139, 255, 0.35);
}

.v-hero-title {
  font-size: clamp(30px, 3.4vw, 46px);
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.05;
  color: var(--vod-text);
  margin: 0 0 10px;
}

.v-hero-meta {
  font-size: 14px;
  color: var(--vod-dim);
  margin: 0 0 12px;
}

.v-hero-rating {
  color: var(--vod-gold);
  font-weight: 700;
}

.v-hero-desc {
  font-size: 15px;
  line-height: 1.5;
  color: #c6d2ec;
  margin: 0 0 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.v-hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.v-btn {
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  color: #fff;
  background: var(--vod-accent-grad);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  box-shadow: 0 6px 20px rgba(47, 123, 255, 0.35);
}

.v-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }

.v-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: none;
}

.v-btn.secondary:hover { background: rgba(255, 255, 255, 0.18); }

.v-btn.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: none;
}

.v-btn.on {
  background: linear-gradient(135deg, #2b7a4b 0%, #3f9c66 100%);
  box-shadow: 0 6px 20px rgba(63, 156, 102, 0.35);
}

.v-btn:focus-visible,
.v-card:focus-visible,
.v-ep:focus-visible,
.v-season:focus-visible,
.v-pill-focusable:focus-visible,
.v-control:focus-visible,
.v-close:focus-visible {
  outline: none;
  box-shadow: var(--vod-focus);
  transform: scale(1.03);
  z-index: 3;
}

.v-btn:focus { outline: none; }

/* --------------------------- Rails --------------------------- */
.v-section { margin-bottom: 30px; }

.v-section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.v-section-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--vod-text);
  margin: 0;
  letter-spacing: -0.2px;
}

.v-rail {
  display: flex;
  gap: var(--vod-rail-gap);
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding-bottom: 6px;
}

.v-rail::-webkit-scrollbar { display: none; }

/* --------------------------- Card --------------------------- */
.v-card {
  position: relative;
  flex: 0 0 200px;
  width: 200px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--vod-card);
  border: 1px solid var(--vod-border);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  scroll-snap-align: start;
}

.v-card:hover { border-color: rgba(61, 139, 255, 0.5); }

.v-card-poster {
  width: 100%;
  aspect-ratio: 2/3;
  background: linear-gradient(160deg, #1a2442 0%, #10192e 100%);
  position: relative;
}

.v-card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.v-card-poster img.loaded { opacity: 1; }

.v-card-poster .v-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: rgba(255, 255, 255, 0.16);
  background: linear-gradient(160deg, #1a253f 0%, #0d1526 100%);
}

.v-ph-letter {
  font-weight: 900;
  font-size: 44px;
  font-family: Inter, sans-serif;
}

.v-card-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.v-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #fff;
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(7, 11, 22, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(4px);
}

.v-badge.live { background: rgba(255, 77, 79, 0.85); }
.v-badge-audio {
  background: rgba(74, 222, 128, 0.9);
  color: #052e16;
  border-color: rgba(5, 46, 22, 0.2);
}

.v-card-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.14);
}

.v-card-progress-fill {
  height: 100%;
  background: var(--vod-accent);
  width: 0%;
}

.v-card-info { padding: 10px 12px 12px; }

.v-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--vod-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 0 4px;
}

.v-card-meta {
  font-size: 12px;
  color: var(--vod-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.v-card-rating { color: var(--vod-gold); font-weight: 600; }

.v-card-count {
  font-size: 11px;
  color: var(--vod-muted);
}

/* --------------------------- Loading / empty / error --------------------------- */
.v-skeleton-grid {
  display: flex;
  gap: var(--vod-rail-gap);
  overflow: hidden;
}

.v-sk {
  flex: 0 0 200px;
  height: 300px;
  border-radius: 12px;
  background: linear-gradient(100deg, #0e1628 40%, #15203a 50%, #0e1628 60%);
  background-size: 200% 100%;
  animation: v-shimmer 1.3s infinite;
}

@keyframes v-shimmer { to { background-position: -200% 0; } }

.v-empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--vod-dim);
  border: 1px dashed var(--vod-border);
  border-radius: 14px;
  margin: 18px 0;
}

.v-empty-title { font-size: 18px; font-weight: 700; color: var(--vod-text); margin: 0 0 6px; }
.v-empty-sub { font-size: 14px; margin: 0; }

.v-error {
  margin: 24px 0;
  padding: 26px 20px;
  border-radius: 14px;
  background: rgba(255, 77, 79, 0.08);
  border: 1px solid rgba(255, 77, 79, 0.35);
  color: #ffb3b6;
  text-align: center;
}

/* --------------------------- Detail overlay --------------------------- */
.vod-overlay {
  position: fixed;
  inset: 0;
  z-index: 7500;
  background: var(--vod-bg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.vod-overlay.hidden { display: none; }

.v-detail-hero {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
}

.v-detail-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 11, 22, 0.5) 0%, rgba(7, 11, 22, 0.25) 45%, var(--vod-bg) 100%),
    linear-gradient(90deg, rgba(7, 11, 22, 0.85) 0%, transparent 62%);
  z-index: 0;
}

.v-detail-bgimg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 25%;
  z-index: -1;
}

.v-detail-box {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 24px;
  padding: 72px 40px 0;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.v-detail-poster {
  width: 220px;
  flex: 0 0 220px;
  aspect-ratio: 2/3;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--vod-border);
  background: linear-gradient(160deg, #1a253f 0%, #0d1526 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.v-detail-poster img { width: 100%; height: 100%; object-fit: cover; }

.v-detail-info { flex: 1; min-width: 0; padding-bottom: 28px; }

.v-detail-type {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--vod-accent2);
  margin-bottom: 6px;
}

.v-detail-title {
  font-size: clamp(28px, 3.6vw, 44px);
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.05;
  margin: 0 0 10px;
  color: var(--vod-text);
}

.v-detail-meta {
  font-size: 14px;
  color: var(--vod-dim);
  margin: 0 0 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.v-detail-meta .sep { opacity: 0.4; }

.v-detail-rating { color: var(--vod-gold); font-weight: 700; }

.v-detail-overview {
  font-size: 15px;
  line-height: 1.55;
  color: #c6d2ec;
  margin: 14px 0 20px;
  max-width: 720px;
}

.v-detail-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.v-back-btn {
  position: absolute;
  top: 18px;
  left: 22px;
  z-index: 5;
  border: none;
  background: rgba(7, 11, 22, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.v-back-btn:hover { background: rgba(255, 255, 255, 0.16); }

/* --------------------------- Seasons / episodes --------------------------- */
.v-seasons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 0;
}

.v-season {
  border: 1px solid var(--vod-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--vod-text);
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}

.v-season.active {
  background: var(--vod-accent-grad);
  border-color: transparent;
}

.v-episodes { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }

.v-ep {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border-radius: 12px;
  padding: 12px 16px;
  background: var(--vod-card);
  border: 1px solid var(--vod-border);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.v-ep:hover { background: var(--vod-card-hover); border-color: rgba(61, 139, 255, 0.4); }

.v-ep-thumb {
  width: 130px;
  flex: 0 0 130px;
  aspect-ratio: 16/9;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(160deg, #1a253f 0%, #0d1526 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.2);
  font-size: 22px;
  position: relative;
}

.v-ep-thumb img { width: 100%; height: 100%; object-fit: cover; }

.v-ep-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--vod-muted);
  margin-bottom: 2px;
}

.v-ep-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--vod-text);
  margin-bottom: 4px;
}

.v-ep-overview {
  font-size: 13px;
  line-height: 1.45;
  color: var(--vod-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.v-ep-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.14);
}

.v-ep-progress-fill { height: 100%; background: var(--vod-accent); }

.v-detail-section {
  padding: 30px var(--page-px);
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

.v-detail-section-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--vod-text);
  margin: 0 0 12px;
}

/* --------------------------- Player overlay --------------------------- */
.v-pe {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.v-pe.hidden { display: none; }

#vod-video-player { width: 100%; height: 100%; background: #000; outline: none; }

.v-pe-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 16px 20px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.72) 0%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.v-close {
  pointer-events: auto;
  border: none;
  background: rgba(7, 11, 22, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.v-pe-title {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  pointer-events: auto;
}

.v-pe-bars { position: absolute; bottom: 0; left: 0; right: 0; z-index: 2; }

.v-pe-bar-track {
  height: 5px;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  position: relative;
}

.v-pe-bar-fill {
  height: 100%;
  background: var(--vod-accent);
  width: 0%;
}

.v-pe-bar-head { display: none; }

.v-pe-controls {
  padding: 8px 20px 18px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.78) 0%, transparent 100%);
  position: absolute;
  bottom: -100%;
  left: 0;
  right: 0;
  transition: bottom 0.25s ease;
  z-index: 3;
}

.v-pe.show-controls .v-pe-bars { bottom: 88px; }

.v-pe.show-controls .v-pe-controls { bottom: 0; }

.v-pe-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.v-pe-time {
  color: var(--vod-dim);
  font-size: 12px;
  min-width: 96px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.v-control {
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 8px;
  min-width: 44px;
  height: 44px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  font-family: inherit;
  transition: background 0.15s, transform 0.15s;
}

.v-control:hover { background: rgba(255, 255, 255, 0.24); }

.v-control.primary { background: var(--vod-accent-grad); }

.v-control .lbl { font-size: 12px; font-weight: 600; }

.v-pe-spacer { flex: 1; }

.v-seekbar { flex: 1; cursor: pointer; position: relative; min-width: 60px; height: 32px; display: flex; align-items: center; }

.v-seek-track { position: absolute; left: 0; right: 0; height: 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.24); }

.v-seek-fill { position: absolute; left: 0; top: 0; bottom: 0; height: 100%; width: 0%; border-radius: 4px; background: var(--vod-accent); }

.v-seek-thumb {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* Siguiente episodio */
.v-next {
  position: absolute;
  right: 26px;
  bottom: 110px;
  z-index: 5;
  width: 360px;
  background: rgba(10, 16, 32, 0.92);
  border: 1px solid rgba(61, 139, 255, 0.45);
  border-radius: 16px;
  padding: 16px;
  color: #fff;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.6);
}

.v-next.hidden { display: none; }

.v-next-title { font-size: 12px; font-weight: 700; color: var(--vod-accent2); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 4px; }
.v-next-name { font-size: 16px; font-weight: 800; margin: 0 0 6px; }
.v-next-sub { font-size: 13px; color: var(--vod-dim); margin: 0 0 12px; }
.v-next-actions { display: flex; gap: 10px; }
.v-next-count { font-size: 12px; color: var(--vod-muted); margin-top: 10px; }

/* Error de reproducción */
.v-pe-error {
  position: absolute;
  inset: 0;
  background: rgba(7, 11, 22, 0.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--vod-text);
  padding: 30px;
  text-align: center;
}

.v-pe-error.hidden { display: none; }

.v-pe-error .big { font-size: 46px; }
.v-pe-error h3 { margin: 0; font-size: 20px; }
.v-pe-error p { margin: 0 0 8px; color: var(--vod-dim); font-size: 14px; }
.v-pe-error .v-btn { min-width: 160px; justify-content: center; }

/* Connecting / buffering */
.v-pe-connecting {
  position: absolute;
  inset: 0;
  background: rgba(7, 11, 22, 0.6);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
}

.v-pe-connecting.show { display: flex; }

.v-spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--vod-accent);
  animation: v-spin 0.9s linear infinite;
}

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

/* Toast VOD */
.v-toast {
  position: fixed;
  left: 50%;
  bottom: 42px;
  transform: translateX(-50%) translateY(20px);
  z-index: 9500;
  background: rgba(10, 16, 32, 0.95);
  border: 1px solid var(--vod-border);
  border-radius: 12px;
  padding: 12px 20px;
  color: var(--vod-text);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.v-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --------------------------- Responsive --------------------------- */
@media (max-width: 1024px) {
  .v-card { flex: 0 0 168px; width: 168px; }
  .v-sk { flex: 0 0 168px; }
  .v-hero-content { padding: 26px 26px 22px; }
  .v-detail-box { padding: 60px 22px 0; flex-direction: column; }
  .v-detail-poster { width: 160px; flex: 0 0 160px; }
}

@media (max-width: 768px) {
  .vod-view { padding: 14px 14px 80px; }
  .v-card { flex: 0 0 140px; width: 140px; }
  .v-sk { flex: 0 0 140px; }
  .v-hero { min-height: 300px; border-radius: 12px; }
  .v-hero-content { padding: 20px 18px 16px; }
  .v-hero-title { font-size: 26px; }
  .v-btn { padding: 10px 16px; font-size: 13px; }
  .v-detail-box { padding: 54px 14px 0; }
  .v-detail-poster { width: 120px; flex: 0 0 120px; }
  .v-ep { flex-direction: column; align-items: stretch; }
  .v-ep-thumb { width: 100%; flex: 0 0 auto; aspect-ratio: 16/9; }
  .v-next { left: 14px; right: 14px; width: auto; bottom: 120px; }
  .v-pe-controls { padding-bottom: 12px; }
}
.v-badge-embed {
  background: rgba(230, 168, 23, 0.92);
  color: #241a02;
  border-color: rgba(36, 26, 2, 0.2);
}
