/**
 * on_demand_detalle.css - Premium Netflix-style details
 */

:root {
    --panel: #f2d34c;
    --dark: #0d0d0f;
    --dark-soft: #15151b;
    --border: rgba(255, 255, 255, 0.1);
    --text: #ffffff;
    --text-muted: #b9b9bd;
}

.detalle-wrap {
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--dark);
    min-height: 100vh;
}

/* =========================================
   HERO SECTION (Detalle)
   ========================================= */
.hero-detalle {
    position: relative;
    width: 100%;
    min-height: 85vh;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    padding: 140px 8% 100px;
    margin-bottom: 60px;
    overflow: hidden;
    isolation: isolate;
}

.hero-detalle::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        linear-gradient(to top, var(--dark) 5%, rgba(13,13,15,0.7) 50%, rgba(13,13,15,0.3) 100%),
        linear-gradient(to right, rgba(13,13,15,1) 0%, rgba(13,13,15,0.6) 45%, rgba(13,13,15,0.9) 100%);
    z-index: 1;
}

.hero-preview-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
}

.hero-content {
    max-width: 900px;
    z-index: 2;
    position: relative;
}

.hero-info .badge {
    background: var(--panel);
    color: #000;
    padding: 8px 18px;
    border-radius: 6px;
    font-weight: 900;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: inline-block;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(242, 211, 76, 0.3);
}

.hero-info h1 {
    font-size: clamp(2.8rem, 6vw, 4.8rem);
    margin: 15px 0;
    line-height: 1.05;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: -1px;
}

.main-color {
    color: var(--panel);
}

.descripcion {
    font-size: 1.2rem;
    line-height: 1.65;
    margin: 30px 0;
    color: #cbd5e1;
    max-width: 750px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 45px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 18px 40px;
    border-radius: 60px;
    font-weight: 900;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
    border: none;
    text-transform: uppercase;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25em;
    height: 1.25em;
    font-size: 1.05em;
    line-height: 1;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 900;
}

.btn-play {
    background: var(--panel);
    color: #000;
    box-shadow: 0 12px 25px rgba(242, 211, 76, 0.25);
}

.btn-play:hover {
    background: #fff;
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(255, 255, 255, 0.35);
}

.btn-back {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.15);
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
    border-color: #fff;
}

.btn-share-title {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.15);
}

.btn-share-title:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
    border-color: #fff;
}

/* =========================================
   SISTEMA DE COMPARTIR
   ========================================= */
.botones-compartir {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 40px 8% 80px;
    padding: 35px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(27, 27, 34, 0.6), rgba(18, 18, 23, 0.8));
    flex-wrap: wrap;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.botones-compartir .section-subtitle {
    width: 100%;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 950;
    text-transform: uppercase;
    color: var(--panel);
    font-size: 1.4rem;
    letter-spacing: 1px;
}

.btn-share {
    min-height: 52px;
    padding: 0 28px;
    border: 1px solid rgba(242, 211, 76, 0.25);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-share:hover {
    border-color: var(--panel);
    background: rgba(242, 211, 76, 0.15);
    transform: translateY(-3px);
}

.btn-share.share-native {
    background: var(--panel);
    color: #000;
    border: none;
    min-width: 180px;
}

.btn-share.share-native:hover {
    background: #fff;
}

.btn-share.share-icon {
    width: 52px;
    padding: 0;
    border-radius: 50%;
    font-size: 1.2rem;
}

.share-feedback {
    width: 100%;
    text-align: center;
    margin-top: 20px;
    color: var(--panel);
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

/* =========================================
   SECCIÓN DE EPISODIOS
   ========================================= */
.episodios-section {
    padding: 0 8% 100px;
}

.section-header h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 50px;
    font-weight: 950;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 20px;
}

.section-header h2::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--panel), transparent);
}

.episodios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 40px;
}

.episodio-card {
    background: var(--dark-soft);
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--border);
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}

.episodio-card:hover {
    transform: translateY(-12px) scale(1.02);
    border-color: var(--panel);
    box-shadow: 0 25px 50px rgba(0,0,0,0.6);
}

.ep-portada {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.ep-portada img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.episodio-card:hover .ep-portada img {
    transform: scale(1.1);
}

.ep-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: 0.4s;
}

.episodio-card:hover .ep-overlay { opacity: 1; }
.ep-overlay i { font-size: 3.5rem; color: var(--panel); filter: drop-shadow(0 0 15px rgba(242, 211, 76, 0.6)); }

.ep-info { padding: 25px; }
.ep-info h3 { font-size: 1.2rem; margin-bottom: 12px; font-weight: 900; color: #fff; }
.ep-info p { font-size: 0.95rem; color: var(--text-muted); line-height: 1.5; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* =========================================
   MODAL DE VIDEO
   ========================================= */
.video-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.98);
    z-index: 300000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px);
}

.video-modal-container {
    width: 92%;
    max-width: 1200px;
    max-height: calc(100vh - 48px);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.video-wrapper {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,0.9);
    border: 1px solid rgba(255,255,255,0.1);
    position: relative;
}

#main-video { width: 100%; height: 100%; object-fit: contain; }

.video-loader {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #fff;
    background: radial-gradient(circle at center, rgba(0,0,0,0.24), rgba(0,0,0,0.56));
    pointer-events: none;
}

.video-loader[hidden] {
    display: none;
}

.video-loader-spinner {
    width: 52px;
    height: 52px;
    border: 4px solid rgba(255,255,255,0.22);
    border-top-color: var(--panel);
    border-radius: 50%;
    animation: od-spin 0.9s linear infinite;
}

.video-loader p {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 900;
    text-transform: uppercase;
}

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

.next-episode-panel {
    position: absolute;
    inset: 0;
    z-index: 7;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
    padding: clamp(24px, 6vw, 70px);
    background:
        linear-gradient(to right, rgba(0,0,0,0.92), rgba(0,0,0,0.62), rgba(0,0,0,0.22)),
        linear-gradient(to top, rgba(0,0,0,0.82), transparent);
}

.next-episode-panel[hidden] {
    display: none;
}

.next-episode-kicker {
    color: var(--panel);
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
}

.next-episode-panel h3 {
    margin: 0;
    max-width: 680px;
    color: #fff;
    font-size: clamp(1.35rem, 4vw, 2.5rem);
    line-height: 1.08;
}

.next-episode-panel p {
    margin: 0;
    max-width: 620px;
    color: #d1d5db;
    font-size: clamp(0.95rem, 2vw, 1.08rem);
    line-height: 1.5;
}

.next-episode-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.btn-next-episode,
.btn-replay-episode {
    border: 0;
    border-radius: 999px;
    padding: 13px 20px;
    font-size: 0.92rem;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn-next-episode {
    background: var(--panel);
    color: #000;
}

.btn-replay-episode {
    background: rgba(255,255,255,0.13);
    color: #fff;
}

.btn-next-episode:hover,
.btn-replay-episode:hover {
    transform: translateY(-2px);
}

.btn-replay-episode:hover {
    background: rgba(255,255,255,0.24);
}

.custom-video-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    padding: 54px 18px 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.86), rgba(0,0,0,0.36), transparent);
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.video-wrapper.controls-hidden {
    cursor: none;
}

.video-wrapper.is-paused .custom-video-controls,
.video-wrapper:focus-within:not(.controls-hidden) .custom-video-controls {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.video-wrapper.controls-hidden:not(.is-paused) .custom-video-controls {
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px);
}

.video-wrapper.has-next-panel .custom-video-controls,
.video-wrapper.has-next-panel.is-paused .custom-video-controls,
.video-wrapper.has-next-panel:focus-within .custom-video-controls {
    opacity: 0;
    pointer-events: none;
}

.video-progress {
    --progress: 0%;
    width: 100%;
    height: 6px;
    appearance: none;
    -webkit-appearance: none;
    border-radius: 999px;
    background: linear-gradient(to right, var(--panel) 0%, var(--panel) var(--progress), rgba(255,255,255,0.32) var(--progress), rgba(255,255,255,0.32) 100%);
    cursor: pointer;
    display: block;
    margin: 0 0 12px;
}

.video-progress::-webkit-slider-thumb,
.video-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--panel);
    border: 2px solid #111;
}

.video-progress::-moz-range-thumb,
.video-volume::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--panel);
    border: 2px solid #111;
}

.video-control-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.video-control-btn {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(255,255,255,0.13);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.video-control-btn:hover,
.video-control-btn:focus-visible {
    background: var(--panel);
    color: #000;
    transform: scale(1.06);
    outline: none;
}

.video-time {
    min-width: 112px;
    color: #f8fafc;
    font-size: 0.92rem;
    font-weight: 700;
    text-shadow: 0 1px 8px rgba(0,0,0,0.8);
}

.video-spacer {
    flex: 1;
}

.video-volume {
    width: 96px;
    height: 5px;
    appearance: none;
    -webkit-appearance: none;
    border-radius: 999px;
    background: rgba(255,255,255,0.32);
    cursor: pointer;
}

.video-wrapper:fullscreen,
.video-wrapper:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    border-radius: 0;
    aspect-ratio: auto;
    box-shadow: none;
}

.video-wrapper:fullscreen #main-video,
.video-wrapper:-webkit-full-screen #main-video {
    height: 100vh;
}

.close-video {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 9;
    color: #fff;
    font-size: 2.6rem;
    cursor: pointer;
    background: rgba(0,0,0,0.45);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: transform 0.3s;
}

.close-video:hover { color: var(--panel); transform: rotate(90deg); }

.video-playing-info { padding: 0 10px; }
.video-playing-info h2 { color: var(--panel); font-size: 1.5rem; margin-bottom: 8px; }
.video-playing-info p { color: #ccc; font-size: 1.1rem; }

/* =========================================
   RESPONSIVO (Detalle)
   ========================================= */
@media (max-width: 1024px) {
    .hero-detalle { padding-top: 120px; }
}

@media (max-width: 768px) {
    .hero-detalle { min-height: 70vh; padding-top: 100px; align-items: flex-end; padding-bottom: 60px; }
    .hero-info h1 { font-size: 2.3rem; }
    .hero-actions { flex-direction: column; width: 100%; }
    .btn { width: 100%; }
    .btn-share-title { width: 100%; }
    .botones-compartir { padding: 25px 15px; margin: 30px 5% 60px; }
    .btn-share.share-native { width: 100%; }
    .btn-share.share-icon { flex: 1; min-width: 45px; }
    .episodios-grid { grid-template-columns: 1fr; gap: 30px; }
    .section-header h2 { font-size: 1.6rem; margin-bottom: 30px; }
    .custom-video-controls { padding: 44px 12px 12px; }
    .video-control-row { gap: 8px; }
    .video-control-btn { width: 38px; height: 38px; }
    .video-time { min-width: 90px; font-size: 0.82rem; }
    .video-volume { display: none; }
    .next-episode-panel { align-items: center; text-align: center; }
    .next-episode-actions { justify-content: center; }
    .btn-next-episode, .btn-replay-episode { width: 100%; justify-content: center; }
}
