/* =========================================
   VARIABLES & RESET
========================================= */
:root {
    --bg: #050505;
    --text: #f4f4f4;
    --accent: #00e5ff; /* Tu Cian Arbitrario */
    --muted: #999;
    --serif: 'Playfair Display', serif;
    --sans: 'Montserrat', sans-serif;
    --mono: 'Space Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    overflow-x: hidden;
    min-height: 100vh;
}

/* =========================================
   FONDOS CINEMÁTICOS (NUEVO DISEÑO)
========================================= */

/* 1. Imagen de fondo desenfocada */
.background-backdrop {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center;
    /* Truco de editora: Saturamos para que los colores "exploten" tras el blur */
    filter: blur(25px) brightness(0.45) saturate(1.4);
    transform: scale(1.1); /* Zoom para ocultar bordes borrosos */
    z-index: -5; 
    transition: background-image 0.8s ease-in-out;
}

/* 2. Viñeta Radial (Luz en el centro, oscuridad en bordes) */
.overlay-gradient {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    /* Gradiente radial: Foco de luz sutil donde está el texto */
    background: radial-gradient(
        circle at 60% 40%, 
        rgba(10, 15, 20, 0.4) 0%, 
        rgba(0, 0, 0, 0.95) 90%
    );
    z-index: -4;
    pointer-events: none;
}

/* =========================================
   HEADER GLOBAL (Barra superior)
========================================= */
.main-header {
    position: fixed; top: 0; left: 0; width: 100%;
    padding: 25px 5%;
    display: flex; justify-content: space-between; align-items: center;
    z-index: 100;
 /*  background: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent);*/
 background-color: black;
 opacity: 95%;
   
}

.header-logo {
    /* Quitamos estilos de texto antiguos */
    display: flex;
    align-items: center;
}

.header-logo img {
    height: 100px; /* Altura controlada para que no rompa el header */
    width: auto;  /* El ancho se ajusta solo */
    object-fit: contain; /* Asegura que se vea el logo entero sin cortarse */
    
    /* Opcional: si tu logo es negro y el fondo es negro, usa este filtro para volverlo blanco */
    /* filter: invert(1); */ 
}
.header-logo .accent { color: var(--accent); font-style: italic; }

.header-meta { 
    font-family: var(--mono); font-size: 0.75rem; 
    letter-spacing: 1px; color: rgba(255,255,255,0.8); 
    display: flex; align-items: center; gap: 8px; 
}
.signal-dot { 
    color: #0f0; text-shadow: 0 0 5px #0f0; 
    animation: blink 2s infinite; 
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* =========================================
   LANDING HERO (Portada Inicial) - CORREGIDO
========================================= */
.landing-hero {
    height: 100vh;
    width: 100%;
    /* Posición relativa para controlar sus hijos */
    position: relative; 
    /* Z-INDEX ALTO: Esto asegura que la portada flote SOBRE el fondo global borroso */
    z-index: 50; 
    display: flex; align-items: center;
    padding: 0 10%;
    overflow: hidden;
    /* Un fondo base negro por si la imagen tarda en cargar */
    background-color: #000; 
    opacity: 10;
}

.landing-backdrop {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center;
    /* La imagen de la portada debe ser nítida pero oscura para leer el texto */
    filter: brightness(0.15); 
    transition: 1s;
    /* Se queda detrás del texto (-1) pero dentro del contenedor (.landing-hero) */
    z-index: -1; 

}

.landing-gradient {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    /* Degradado para integrar la portada con el resto de la página abajo */
    background: linear-gradient(0deg, var(--bg) 0%, rgba(0,0,0,0) 50%);
    z-index: 0; /* Encima de la imagen de fondo */
    pointer-events: none;
}

.landing-content { 
    max-width: 900px; 
    position: relative; 
    /* Z-INDEX MÁXIMO: El texto debe estar encima de todo */
    z-index: 100; 
    opacity: 1; /* Aseguramos visibilidad */
}

/* Estilos de Texto */
.new-tag { 
    background: var(--accent); color: #000; padding: 6px 12px; 
    font-weight: 800; font-size: 0.75rem; letter-spacing: 2px;
    display: inline-block; margin-bottom: 15px;
}

#landing-title {
    font-family: var(--serif);
    /* Tamaño fluido pero grande */
    font-size: clamp(1.5rem, 5vw, 3.5rem);
    line-height: 1; margin-bottom: 30px;
    color: #fff; /* Forzamos blanco */
    text-shadow: 0 10px 40px rgba(0,0,0,0.8); /* Sombra para separar del fondo */
}

.landing-desc { 
    font-size: 1.2rem; line-height: 1.6; color: #e0e0e0; 
    margin-bottom: 40px; max-width: 650px; 
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.cta-button {
    background: rgba(255,255,255,0.1); /* Fondo semi-transparente */
    border: 1px solid var(--text); color: var(--text);
    padding: 18px 45px; font-family: var(--sans); font-weight: 700; letter-spacing: 2px;
    cursor: pointer; display: flex; align-items: center; gap: 12px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}
.cta-button:hover { 
    background: var(--accent); 
    color: #000; 
    border-color: var(--accent);
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.4);
}
.cta-button svg { width: 20px; fill: currentColor; }

.scroll-indicator {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    font-family: var(--mono); font-size: 0.65rem; letter-spacing: 3px; opacity: 0.7;
    display: flex; flex-direction: column; align-items: center; gap: 15px;
    z-index: 100; color: white;
}
.scroll-indicator .line { 
    width: 1px; height: 50px; background: white; 
    box-shadow: 0 0 10px white;
}

/* =========================================
   APP INTERFACE (Sección Inferior)
========================================= */
.app-container {
    display: flex;
    flex-wrap: wrap; /* Importante para responsivo */
    max-width: 1600px; margin: 0 auto;
    min-height: 100vh;
    position: relative;
    border-top: 1px solid rgba(255,255,255,0.1);
    z-index: 10; /* Sobre el fondo */
}

/* --- SIDEBAR --- */
.sidebar {
    width: 340px;
    /* Fondo semi-transparente estilo vidrio oscuro */
    background: rgba(8, 8, 8, 0.75); 
    backdrop-filter: blur(15px);
    border-right: 1px solid rgba(255,255,255,0.08);
    display: flex; flex-direction: column;
    /* Sticky para que te siga al bajar */
    height: 100vh; position: sticky; top: 0;
    z-index: 50;
}

.sidebar-header { 
    padding: 30px; 
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.3); 
}

.season-filter { display: flex; gap: 10px; }
.filter-btn {
    background: transparent; border: 1px solid rgba(255,255,255,0.2);
    color: var(--muted); padding: 5px 15px; font-size: 0.7rem;
    cursor: pointer; border-radius: 20px; transition: 0.3s;
    font-family: var(--sans); letter-spacing: 1px;
}
.filter-btn:hover { border-color: white; color: white; }
.filter-btn.active { 
    background: var(--accent); color: black; 
    border-color: var(--accent); font-weight: bold; 
}

.episodes-list { overflow-y: auto; flex-grow: 1; padding-bottom: 50px; }

.ep-item { 
    padding: 22px 30px; 
    border-bottom: 1px solid rgba(255,255,255,0.03); 
    cursor: pointer; transition: 0.2s; 
}
.ep-item:hover { background: rgba(255,255,255,0.05); }
.ep-item.active { 
    border-left: 3px solid var(--accent); 
    background: linear-gradient(90deg, rgba(0,229,255,0.1), transparent); 
}

.ep-item h3 { font-size: 0.9rem; font-weight: 500; margin-bottom: 5px; color: #eee; line-height: 1.4; }
.ep-meta { font-size: 0.7rem; color: var(--muted); display: flex; justify-content: space-between; }

/* --- MAIN CONTENT --- */
.main-content { 
    flex: 1; 
    padding: 60px; 
    display: flex; align-items: center; justify-content: center; 
}

.content-box { 
    display: grid; grid-template-columns: 320px 1fr; 
    gap: 60px; width: 100%; align-items: start; 
}

.poster-frame img { 
    width: 100%; border-radius: 4px; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.6); 
    border: 1px solid rgba(255,255,255,0.1);
}

.info-side { padding-top: 10px; }

.tags { margin-bottom: 20px; display: flex; gap: 15px; align-items: center; }
.pill { 
    border: 1px solid var(--accent); color: var(--accent); 
    font-size: 0.65rem; padding: 4px 10px; border-radius: 20px; 
    font-weight: 700; letter-spacing: 1px; 
}
.date-text { font-size: 0.8rem; color: var(--muted); }

.info-side h2 { 
    font-family: var(--serif); font-size: 3rem; 
    margin-bottom: 25px; line-height: 1.1; 
    text-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.description-text { 
    font-size: 1rem; color: #ccc; margin-bottom: 40px; 
    line-height: 1.7; max-width: 700px; 
    max-height: 250px; overflow-y: auto; 
    padding-right: 15px;
}
/* Scrollbar bonita */
.description-text::-webkit-scrollbar { width: 4px; }
.description-text::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }

/* --- REPRODUCTOR PERSONALIZADO --- */
.custom-player-wrapper { 
    background: rgba(255,255,255,0.05); 
    border: 1px solid rgba(255,255,255,0.15); 
    border-radius: 12px; padding: 25px; 
    backdrop-filter: blur(10px); 
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.player-controls { display: flex; align-items: center; gap: 25px; }

.play-button { 
    width: 60px; height: 60px; border-radius: 50%; 
    background: var(--accent); border: none; cursor: pointer; 
    display: flex; align-items: center; justify-content: center; 
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    box-shadow: 0 5px 20px rgba(0,229,255,0.3);
}
.play-button:hover { transform: scale(1.1); box-shadow: 0 5px 30px rgba(0,229,255,0.5); }
.play-button svg { width: 22px; fill: #000; }
.hidden { display: none; }

.progress-container { 
    flex-grow: 1; display: flex; align-items: center; 
    gap: 15px; font-size: 0.75rem; 
    font-family: var(--mono); color: #aaa; 
}

.progress-bar-bg { 
    flex-grow: 1; height: 4px; 
    background: rgba(255,255,255,0.15); 
    cursor: pointer; border-radius: 2px; position: relative; 
}

.progress-bar-fill { 
    height: 100%; background: var(--accent); 
    width: 0%; border-radius: 2px; position: relative; 
}
/* Puntito al final de la barra */
.progress-bar-fill::after { 
    content:''; position: absolute; right: -5px; top: -3px; 
    width: 10px; height: 10px; background: var(--accent); 
    border-radius: 50%; opacity: 0; transition: 0.2s; 
    box-shadow: 0 0 10px var(--accent);
}
.progress-bar-bg:hover .progress-bar-fill::after { opacity: 1; }

/* =========================================
   RESPONSIVE (MÓVIL)
========================================= */
@media (max-width: 1000px) {
    .app-container { flex-direction: column; }
    
    .sidebar { 
        width: 100%; height: auto; position: relative; 
        order: 2; /* Pone la lista ABAJO en celular */
        border-right: none; border-top: 1px solid rgba(255,255,255,0.1);
    }
    .episodes-list { max-height: 400px; }
    
    .main-content { order: 1; padding: 40px 20px; }
    
    .content-box { 
        grid-template-columns: 1fr; 
        text-align: center; gap: 30px; 
    }
    
    .poster-frame { max-width: 250px; margin: 0 auto; }
    .tags { justify-content: center; }
    
    .info-side h2 { font-size: 2.2rem; }
    .description-text { text-align: left; margin: 0 auto 30px auto; }
    
    #landing-title { font-size: 3rem; }
    .cta-button { width: 100%; justify-content: center; }
}