/* --- VARIABLES GLOBALES --- */
:root {
    --primary: #00ff88;
    --bg: #050505;
    --text-gray: #bbb;
    --card-bg: #151515;
    --glass: rgba(10, 10, 10, 0.98);
}

/* --- ESTILOS GENERALES --- */
body {
    margin: 0;
    background: var(--bg);
    color: #fff;
    font-family: 'Space Grotesk', sans-serif;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
}

.app-viewport {
    width: 100%;
    max-width: 480px;
    background: #111;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    padding-bottom: 80px;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

/* --- HEADER --- */
.app-header-main {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 20px;
    background: linear-gradient(180deg, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0) 100%);
    position: sticky; top: 0; z-index: 100;
}

.logo-wrapper { display: flex; align-items: center; gap: 8px; }
.logo { font-size: 1.4rem; font-weight: 800; color: white; letter-spacing: -1px; margin: 0; line-height: 1; }
.logo span { color: var(--primary); }

.plan-tag-header {
    font-size: 0.6rem; font-weight: 800; padding: 3px 6px;
    border-radius: 4px; letter-spacing: 1px; text-transform: uppercase;
    display: inline-block; vertical-align: middle;
}
.tag-free { background: #222; color: #888; border: 1px solid #444; }
.tag-fan { background: #00ff88; color: #000; box-shadow: 0 0 10px rgba(0,255,136,0.4); }
.tag-squad { background: #ff00de; color: #fff; box-shadow: 0 0 10px rgba(255,0,222,0.4); }

.user-counter-badge {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 5px 10px; border-radius: 20px;
    font-size: 0.75rem; font-weight: bold;
    display: flex; align-items: center; gap: 6px;
    color: var(--primary);
}
.live-dot-header {
    width: 6px; height: 6px; background: #ff4444; border-radius: 50%;
    box-shadow: 0 0 5px #ff4444; animation: pulse 1s infinite;
}

/* --- MENÚ INFERIOR (PERFECTO) --- */
.bottom-nav {
    position: fixed; bottom: 0; 
    left: 50%; transform: translateX(-50%); 
    width: 100%; max-width: 480px; 
    height: 65px;
    background: var(--glass); border-top: 1px solid #222;
    backdrop-filter: blur(10px); z-index: 90;
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    align-items: center; justify-items: center;
}

.nav-item { 
    color: #666; font-size: 1.3rem; cursor: pointer; 
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    position: relative; transition: color 0.3s;
}
.nav-item:hover { color: #fff; }
.nav-item.active { color: var(--primary); }
.nav-item.active::after {
    content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 20px; height: 3px; background: var(--primary);
    border-radius: 10px 10px 0 0; box-shadow: 0 -2px 10px var(--primary);
}

/* --- BUSCADOR --- */
.search-container { padding: 0 20px 5px 20px; }
.bio-input {
    background: #111; border: 1px solid #333; color: white;
    border-radius: 6px; width: 100%; box-sizing: border-box;
    font-size: 0.85rem; padding: 12px 15px;
}
.bio-input:focus { border-color: var(--primary); outline: none; }

#search-results-container {
    padding: 0 20px; display: none;
    grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 20px;
}
.searching #search-results-container { display: grid !important; }
.searching .scroller-container, .searching .section-title { display: none !important; }
#search-results-container .poster-card { flex: none; width: 100%; }

/* --- CARRUSELES --- */
.section-title {
    padding: 0 20px; margin: 25px 0 10px 0;
    font-size: 0.85rem; color: #ccc; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
}
.scroller-container {
    display: flex; overflow-x: auto; scroll-behavior: smooth;
    gap: 10px; padding: 0 20px; scrollbar-width: none;
    /* Importante para que el wrapper no tape el scroll */
    position: relative; z-index: 1; 
}
.scroller-container::-webkit-scrollbar { display: none; }

.poster-card { flex: 0 0 28%; position: relative; cursor: pointer; transition: transform 0.1s; }
.poster-card:active { transform: scale(0.95); opacity: 0.8; }

.poster-wrapper {
    position: relative; width: 100%; aspect-ratio: 2/3;
    border-radius: 6px; overflow: hidden; border: 1px solid #222;
}
.poster-img { width: 100%; height: 100%; object-fit: cover; }

.premium-lock {
    position: absolute; top: 5px; right: 5px;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
    width: 24px; height: 24px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,0.2); z-index: 10;
}
.premium-lock i { color: var(--primary); font-size: 0.7rem; }

/* --- FLECHAS PC (RECTANGULARES) --- */
.carousel-wrapper {
    position: relative;
    /* Ajuste para que las flechas se alineen con el carrusel */
}

/* ESTILO BASE DE LA FLECHA RECTANGULAR */
.nav-arrow {
    position: absolute;
    top: 0;
    height: 100%; /* ¡OCUPA TODA LA ALTURA! */
    width: 45px;  /* Ancho del botón */
    
    background: rgba(10, 10, 10, 0.7); /* Fondo oscuro semitransparente */
    border: 1px solid #333;
    border-radius: 8px; /* Bordes ligeramente redondeados, no círculos */
    
    color: var(--primary);
    display: none; /* Oculto en móvil */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.2s ease;
    font-size: 1.5rem;
}

.nav-arrow:hover {
    background: var(--primary); /* Se pone verde */
    color: black;
    box-shadow: 0 0 20px var(--primary);
    transform: scale(1.05);
}

.nav-arrow.left { left: -55px; } /* Fuera del contenedor a la izquierda */
.nav-arrow.right { right: -55px; } /* Fuera del contenedor a la derecha */

/* SOLO MOSTRAR EN PANTALLAS GRANDES */
@media (min-width: 700px) {
    .app-viewport { overflow: visible; } /* Permite ver las flechas afuera */
    .nav-arrow { display: flex; }
}

/* --- MOVIE PAGE (LANDING) --- */
.movie-hero {
    position: relative; width: 100%; height: 55vh; max-height: 500px;
    background-color: #222; background-size: cover; background-position: center top;
}
.movie-hero::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 90%;
    background: linear-gradient(to bottom, transparent 0%, #111 95%);
}

.top-bar {
    position: absolute; top: 0; left: 0; width: 100%; padding: 15px;
    display: flex; justify-content: space-between; align-items: center; z-index: 10;
}
.btn-back {
    background: rgba(0,0,0,0.5); color: white; width: 40px; height: 40px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,0.2); backdrop-filter: blur(5px);
    text-decoration: none;
}
.live-badge {
    background: rgba(0,0,0,0.6); padding: 5px 12px; border-radius: 20px;
    display: flex; align-items: center; gap: 6px; 
    border: 1px solid rgba(0,255,136,0.3); backdrop-filter: blur(5px);
}
.live-dot {
    width: 6px; height: 6px; background: var(--primary); border-radius: 50%;
    box-shadow: 0 0 8px var(--primary); animation: pulse 1.5s infinite;
}
.live-text { font-size: 0.7rem; font-weight: bold; color: var(--primary); letter-spacing: 0.5px; }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } }

.movie-content { padding: 20px; margin-top: -140px; position: relative; z-index: 5; }
.movie-content h1 { 
    font-size: 2.2rem; line-height: 1.1; margin: 0 0 10px 0; 
    text-shadow: 0 10px 30px #000; letter-spacing: -1px; 
}

.btn-play-big {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    background: var(--primary); color: #000; font-size: 1.1rem; font-weight: 800;
    padding: 15px; border-radius: 12px; text-decoration: none; margin-bottom: 20px;
    box-shadow: 0 0 25px rgba(0,255,136,0.2); cursor: pointer; border: none; width: 100%;
    text-transform: uppercase; letter-spacing: 1px;
    animation: pulseBig 2s infinite; 
}
@keyframes pulseBig { 
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7); }
    70% { transform: scale(1.02); box-shadow: 0 0 0 10px rgba(0, 255, 136, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}

.btn-options { 
    display: flex; gap: 15px; margin-bottom: 30px; 
    width: 100%;
}
.btn-secondary {
    flex: 1; 
    background: rgba(255,255,255,0.08); color: #fff; padding: 12px;
    text-align: center; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem; display: flex; align-items: center; justify-content: center; gap: 8px; 
    cursor: pointer; text-decoration: none; font-weight: 600;
}

.synopsis { 
    color: #ccc; line-height: 1.6; font-size: 0.95rem; margin: 0; 
    text-align: justify; margin-bottom: 25px;
}

/* --- REPRODUCTOR & LOADER ESCÁNER --- */
.player-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #000; z-index: 6000; display: none;
}
.player-wrapper {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center; z-index: 1;
}
.close-player {
    position: absolute; top: 25px; right: 25px; width: 45px; height: 45px;
    background: rgba(0,0,0,0.6); border-radius: 50%; color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; cursor: pointer; z-index: 3000;
    border: 1px solid rgba(255,255,255,0.2); backdrop-filter: blur(4px);
}

/* ESCÁNER DE CINE (Loader Rectangular) */
.video-loader {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: black; display: flex; flex-direction: column;
    align-items: center; justify-content: center; z-index: 5;
    transition: opacity 0.5s ease;
}

.loader-spinner {
    width: 150px; 
    height: 4px;  
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px; position: relative; overflow: hidden;
    box-shadow: 0 0 15px rgba(0,255,136,0.2);
    margin-bottom: 20px;
}

.loader-spinner::after {
    content: ''; position: absolute; top: 0; left: -50%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: cinema-scan 1.8s infinite ease-in-out;
}

@keyframes cinema-scan {
    0% { left: -60%; opacity: 0.5; }
    50% { opacity: 1; }
    100% { left: 100%; opacity: 0.5; }
}

.loader-text { 
    font-family: 'Space Grotesk', sans-serif; 
    color: var(--primary); font-size: 0.9rem; letter-spacing: 2px;
    font-weight: bold; text-transform: uppercase;
    animation: text-pulse 2s infinite ease-in-out;
}
@keyframes text-pulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }

/* TIMER DE REGALO */
#trial-timer {
    position: absolute; top: 30px; left: 30px; z-index: 6003;
    background: rgba(0, 0, 0, 0.8); color: #ff4444; padding: 8px 15px;
    border: 1px solid #ff4444; border-radius: 8px; font-weight: 700; font-size: 0.9rem; 
    display: none; box-shadow: 0 0 20px rgba(255, 68, 68, 0.3);
    backdrop-filter: blur(5px);
}
#trial-timer span { color: white; font-family: monospace; font-size: 1rem; margin-left: 8px; }

/* MODALES */
.modal-overlay, .premium-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); z-index: 3000; display: none; align-items: center; justify-content: center;
    backdrop-filter: blur(8px);
}
.premium-card, .paywall-card {
    background: #1a1a1d; border: 1px solid #333; width: 85%; max-width: 320px; border-radius: 20px; padding: 30px 20px; text-align: center;
    box-shadow: 0 0 40px rgba(0,0,0,0.7); animation: modalPop 0.3s ease-out;
}
@keyframes modalPop { from { transform: scale(0.9); opacity: 0 } to { transform: scale(1); opacity: 1 } }

.premium-icon { font-size: 3rem; color: var(--primary); margin-bottom: 15px; }
.premium-title { font-size: 1.3rem; font-weight: 800; color: white; margin-bottom: 10px; }
.premium-desc { font-size: 0.95rem; color: #999; margin-bottom: 25px; line-height: 1.5; }

.btn-modal { display: block; width: 100%; padding: 14px; border-radius: 10px; font-weight: 800; cursor: pointer; border: none; margin-bottom: 12px; font-size: 0.95rem;}
.btn-unlock, .paywall-btn { background: var(--primary); color: #000; text-decoration: none; display: block; }
.btn-outline { background: transparent; border: 1px solid #333; color: #fff; }
.btn-cancel { background: #333; color: #fff; }
.btn-text { background: none; border: none; color: #666; font-size: 0.85rem; cursor: pointer; text-decoration: underline; margin-top: 10px; }

/* TOAST (NOTIFICACIÓN) */
#live-toast {
    position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
    background: #222; color: white; padding: 12px 25px; border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); z-index: 7000; display: none;
    align-items: center; gap: 10px; font-size: 0.9rem; border: 1px solid var(--primary);
    white-space: nowrap; animation: slideUp 0.3s ease-out; font-weight: bold;
}
@keyframes slideUp { from { transform: translate(-50%, 20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* OTROS */
.tags { display: flex; gap: 8px; color: #ccc; font-size: 0.75rem; margin-bottom: 15px; align-items: center; }
.tag-hd { background: var(--primary); color: #000; padding: 2px 5px; border-radius: 4px; font-weight: 800; }
.section-header { color: var(--primary); font-size: 0.8rem; font-weight: 800; letter-spacing: 1px; margin-top: 25px; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; text-transform: uppercase; }
.section-header::after { content: ''; flex: 1; height: 1px; background: rgba(0,255,136,0.2); }
.tech-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: #1a1a1a; padding: 15px; border-radius: 12px; border: 1px solid #333; }
.cast-scroller { display: flex; gap: 15px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.cast-item { min-width: 70px; text-align: center; }
.cast-img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; border: 2px solid #333; margin-bottom: 5px; }