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

.detalle-wrap {
    color: #fff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: #0d0d0f;
    min-height: 100vh;
}

/* HERO SECTION */
.hero-detalle {
    position: relative;
    width: 100%;
    min-height: 75vh;
    background-size: cover;
    background-position: center;
    background-color: #0d0d0f;
    display: flex;
    align-items: center;
    padding: 120px 8% 80px;
    margin-bottom: 50px;
    overflow: hidden;
    isolation: isolate;
}

.hero-detalle::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background:
        linear-gradient(to top, rgba(13,13,15,1) 5%, rgba(13,13,15,0.74) 45%, rgba(13,13,15,0.25) 100%),
        linear-gradient(to right, rgba(13,13,15,0.96) 0%, rgba(13,13,15,0.58) 48%, rgba(13,13,15,0.86) 100%);
    z-index: 1;
    pointer-events: none;
}

.hero-preview-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    filter: saturate(1.08) contrast(1.05);
    z-index: 0;
    pointer-events: none;
}

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

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

.main-color {
    color: #f2d34c; /* Amarillo Sipse */
}

.hero-info .badge {
    background: #f2d34c;
    color: #000;
    padding: 6px 14px;
    border-radius: 4px;
    font-weight: 800;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0;
    display: inline-block;
}

.descripcion {
    font-size: 1.15rem;
    line-height: 1.65;
    margin: 25px 0;
    color: #cbd5e1;
    max-width: 720px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 40px;
}

.btn-play {
    background: #f2d34c;
    color: #000;
    border: none;
    padding: 16px 36px;
    font-size: 1.1rem;
    font-weight: 800;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(242, 211, 76, 0.25);
}

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

.btn-back {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 16px 36px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(10px);
}

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

.btn-share-title {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 16px 28px;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(10px);
}

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

/* EPISODIOS SECTION */
.episodios-section {
    padding: 0 8% 80px;
}

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

.section-header h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0;
}

.section-header .count {
    color: #f2d34c;
    font-size: 1.4rem;
    font-weight: 400;
}

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

.episodio-card {
    background: #15151b;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.episodio-card:hover {
    transform: scale(1.02) translateY(-8px);
    border-color: rgba(242, 211, 76, 0.4);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

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

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

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

.ep-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: 0.3s ease;
}

.episodio-card:hover .ep-overlay {
    opacity: 1;
}

.ep-overlay i {
    font-size: 3.5rem;
    color: #f2d34c;
    filter: drop-shadow(0 0 15px rgba(242, 211, 76, 0.5));
}

.ep-info {
    padding: 22px;
}

.ep-info h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 10px;
    color: #fff;
    transition: 0.3s;
}

.episodio-card:hover .ep-info h3 {
    color: #f2d34c;
}

.ep-info p {
    font-size: 0.95rem;
    color: #94a3b8;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

/* SOCIAL STRIP */
.od-social {
    padding: 40px 8%;
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* NO CONTENT */
.no-content-wrap {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 24px;
    border: 2px dashed rgba(255, 255, 255, 0.08);
}

.no-content-wrap i {
    font-size: 3.5rem;
    color: #272732;
    margin-bottom: 20px;
}

.no-content {
    font-size: 1.2rem;
    color: #94a3b8;
}

/* VIDEO OVERLAY (MODAL) */
.video-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(15px);
    padding: 60px 20px 20px;
    overflow-y: auto;
}

.video-modal-container {
    width: 100%;
    max-width: 1040px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

@media (max-width: 768px) {
    .video-overlay { padding-top: 80px; }
    .video-modal-container { gap: 10px; }
    .close-video { top: -55px; font-size: 2.5rem; }
}
.video-wrapper {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 80px rgba(0,0,0,0.8);
    position: relative;
}

#main-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
}

.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: #f2d34c;
    border-radius: 50%;
    animation: od-spin 0.9s linear infinite;
}

.video-loader p {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #f8fafc;
    text-shadow: 0 1px 12px rgba(0,0,0,0.75);
}

@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: #f2d34c;
    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: #f2d34c;
    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, #f2d34c 0%, #f2d34c 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: #f2d34c;
    border: 2px solid #111;
}

.video-progress::-moz-range-thumb,
.video-volume::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #f2d34c;
    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: #f2d34c;
    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;
}

.video-playing-info {
    padding: 0 10px;
    max-height: 118px;
    overflow-y: auto;
}

.video-playing-info h2 {
    color: #f2d34c;
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    margin: 0 0 6px;
}

.video-playing-info p {
    color: #ccc;
    font-size: 1rem;
    line-height: 1.5;
    margin: 0;
}

.video-error {
    color: #fca5a5 !important;
    margin-top: 10px;
    font-weight: 700;
}

.close-video {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.8rem;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.3s;
}

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

/* RESPONSIVE */
@media (max-width: 1024px) {
    .hero-detalle { padding: 100px 5% 60px; }
    .episodios-section { padding: 0 5% 60px; }
}

@media (max-width: 768px) {
    .hero-detalle {
        min-height: 60vh;
        align-items: flex-end;
        padding-bottom: 50px;
    }
    .hero-info h1 { font-size: 2.3rem; }
    .hero-actions { flex-direction: column; width: 100%; }
    .btn-play, .btn-back, .btn-share-title { width: 100%; justify-content: center; }
    .hero-preview-video { opacity: 1; }
    .episodios-grid { grid-template-columns: 1fr; }
    .section-header h2 { font-size: 1.8rem; }
    .video-modal-container { gap: 10px; }
    .close-video { top: -45px; font-size: 2.2rem; }
    .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; }
}
