html { background-color: #000000; } /* Pinta los bordes del iPhone de negro profundo */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }

/* Fondo degradado premium */
body { 
    background: radial-gradient(circle at 80% 20%, #1a0a0a 0%, #050505 80%, #000000 100%);
    color: #ffffff; 
    width: 100vw;
    height: 100dvh; 
    overflow: hidden; 
    padding: clamp(10px, 2vh, 20px) clamp(10px, 2vw, 20px); 
}

@keyframes fadeInApp { from { opacity: 0; filter: blur(5px); } to { opacity: 1; filter: blur(0); } }

.app-container { 
    display: flex; flex-direction: row; width: 100%; height: 100%; gap: clamp(10px, 2vw, 20px); 
    animation: fadeInApp 0.6s ease-out;
}

/* --- COLUMNA IZQUIERDA (VIDEO Y BANNER) --- */
.left-column { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: clamp(10px, 2vh, 20px); }

.video-container { 
    flex: 1; background-color: #000; border-radius: 12px; overflow: hidden; position: relative; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.8); border: 1px solid rgba(255,255,255,0.05);
}
.video-container iframe, .video-container video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.video-placeholder { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: #444; font-weight: 600; font-size: clamp(1rem, 2vw, 1.5rem); letter-spacing: 1px;}

.ad-banner { 
    width: 100%; 
    height: auto; /* Respeto total a la proporción matemática */
    aspect-ratio: 1920 / 200; 
    max-height: 150px; 
    background-color: #0a0a0a; border-radius: 10px; overflow: hidden; position: relative; flex-shrink: 0; 
    border: 1px solid rgba(255,255,255,0.03); box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}
.slider-wrapper { display: flex; width: 100%; height: 100%; transition: transform 1s ease; }
.banner-slide { 
    width: 100%; 
    height: 100%; 
    object-fit: contain; /* MAGIA: El banner jamás se recorta */
    flex-shrink: 0; /* MAGIA 2: Prohibido apachurrarse por el navegador */
}
.default-banner-text { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: clamp(1rem, 2vw, 1.8rem); font-weight: 800; color: #333; letter-spacing: 2px;}

/* --- COLUMNA DERECHA (PROGRAMACIÓN) --- */
.sidebar { 
    width: 30%; 
    min-width: 280px;
    max-width: 450px;
    height: 100%; display: flex; flex-direction: column; 
    background: rgba(20, 20, 20, 0.45); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.05); border-radius: 12px; padding: clamp(12px, 1.5vw, 18px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
}

.logo-container { height: auto; min-height: 40px; max-height: 10vh; display: flex; align-items: center; justify-content: center; margin-bottom: 15px; flex-shrink: 0; }
.sidebar-logo { max-width: 65%; max-height: 60px; object-fit: contain; filter: drop-shadow(0px 4px 6px rgba(229, 9, 20, 0.2));}

.sidebar-header { flex-shrink: 0; }
.sidebar-header h2 { font-size: clamp(0.9rem, 1.2vw, 1rem); font-weight: 800; letter-spacing: 1px; margin-bottom: 6px; color: #fff;}
.red-line { height: 3px; background: linear-gradient(90deg, #E50914, transparent); width: 100%; margin-bottom: 15px; border-radius: 2px;}

.schedule-list { list-style: none; overflow-y: auto; padding-right: 5px; flex: 1; min-height: 0; }
.schedule-list::-webkit-scrollbar { width: 4px; }
.schedule-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }

.schedule-item { 
    display: flex; justify-content: space-between; align-items: center; 
    margin-bottom: 10px; background: rgba(10, 10, 10, 0.7);
    padding: clamp(10px, 1.5vh, 15px); border-radius: 10px; border: 1px solid rgba(255,255,255,0.03);
    transition: all 0.2s ease; gap: 10px;
}

@keyframes breathingGlow {
    0% { box-shadow: 0 0 10px rgba(229, 9, 20, 0.2), inset 4px 0 0 #E50914; }
    50% { box-shadow: 0 0 25px rgba(229, 9, 20, 0.5), inset 4px 0 0 #ff1a1a; }
    100% { box-shadow: 0 0 10px rgba(229, 9, 20, 0.2), inset 4px 0 0 #E50914; }
}

.schedule-item.active-live { background: linear-gradient(135deg, rgba(229, 9, 20, 0.15), rgba(0,0,0,0.8)); border-color: rgba(229, 9, 20, 0.4); animation: breathingGlow 2.5s infinite ease-in-out; }
.schedule-item:hover { background: rgba(20, 20, 20, 0.9); transform: translateY(-2px); border-color: rgba(255,255,255,0.1); }

.item-text { flex: 1; display: flex; flex-direction: column; align-items: flex-start; overflow: hidden; }
.item-text h3 { font-size: clamp(0.85rem, 1.2vw, 1rem); font-weight: 700; margin-bottom: 2px; color: #fff; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-text p { font-size: clamp(0.7rem, 1vw, 0.8rem); color: #999; margin-bottom: 1px; }
.item-text .days { color: #E50914; font-weight: 600; font-size: clamp(0.65rem, 0.9vw, 0.75rem); }

.item-box { width: clamp(55px, 6vw, 70px); height: clamp(55px, 6vw, 70px); flex-shrink: 0; background-color: #111; border-radius: 8px; object-fit: cover; }

.badge { display: inline-flex; padding: 3px 6px; border-radius: 4px; font-size: 0.6rem; font-weight: 800; margin-bottom: 4px; letter-spacing: 0.5px; }
.badge-live { background: #E50914; color: white; }
.badge-next { background: rgba(255, 255, 255, 0.1); color: #ccc; }

.vod-btn {
    background: #E50914; color: #ffffff; border: none; padding: 6px 12px; border-radius: 15px; 
    font-size: clamp(0.65rem, 1vw, 0.75rem); font-weight: 700; cursor: pointer; margin-top: 6px; 
    box-shadow: 0 4px 10px rgba(229, 9, 20, 0.3); width: max-content; align-self: flex-start;
}

.return-live-btn {
    position: absolute; top: 10px; left: 10px; background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255,255,255,0.2); color: white; padding: clamp(8px, 1.5vh, 10px) clamp(15px, 2vw, 22px); border-radius: 15px;
    font-size: clamp(0.7rem, 1vw, 0.8rem); font-weight: 700; z-index: 1000; cursor: pointer; backdrop-filter: blur(5px);
}

.vod-episode-item { cursor: pointer; border-left: 4px solid transparent; }
.vod-episode-item:hover { background: rgba(229, 9, 20, 0.1); border-left: 4px solid #E50914; transform: translateX(5px); }
.vod-episode-item:active { transform: scale(0.98); }
.vod-episode-item .item-box { width: 100px; height: auto; aspect-ratio: 16/9; }

.rotate-message { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh; background-color: #000; color: #fff; z-index: 999999; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; }
.rotate-message h2 { color: #E50914; font-size: 2rem;}
@media screen and (orientation: portrait) { .app-container { display: none !important; } .rotate-message { display: flex; } body { padding: 0; } }

/* MODAL APK */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh; background-color: rgba(0, 0, 0, 0.75); z-index: 9999999; align-items: center; justify-content: center; backdrop-filter: blur(8px); }
.modal-content { background: #111; padding: 30px; border-radius: 15px; text-align: center; max-width: 400px; border: 1px solid #E50914; position: relative; margin: 20px; }
.close-modal { position: absolute; top: 10px; right: 15px; color: #666; font-size: 28px; cursor: pointer; }
.modal-content h2 { color: #ffffff; margin-bottom: 10px; font-size: 1.4rem;}
.modal-content p { color: #aaa; margin-bottom: 20px; font-size: 0.9rem; }
.btn-download { display: inline-block; background: #E50914; color: white; padding: 12px 24px; text-decoration: none; border-radius: 10px; font-weight: 800; }

/* ==============================================================
   ESTRICTAMENTE PARA CELULARES HORIZONTALES (MAGIA RESPONSIVA) 
   ============================================================== */
@media (max-width: 930px) and (orientation: landscape), (max-height: 500px) {
    body { padding: 8px; }
    .app-container { gap: 10px; }
    
    /* 1. Encogemos el banner respetando su proporción perfecta (1920x200) */
    .ad-banner { 
        height: auto; 
        min-height: unset; 
        max-height: 20vh; 
        aspect-ratio: 1920 / 200; 
        border-radius: 6px; 
    }
    .left-column { gap: 8px; }
    .default-banner-text { font-size: 0.9rem; letter-spacing: 1px; }

    /* 2. Hacemos la columna derecha mucho más delgada */
    .sidebar { width: 230px; min-width: 230px; padding: 10px; border-radius: 8px; }
    .logo-container { height: 35px; min-height: 35px; margin-bottom: 8px; }
    .sidebar-header h2 { font-size: 0.8rem; margin-bottom: 4px; }
    .red-line { margin-bottom: 8px; }
    
    /* 3. Ajustamos las tarjetas y la fuente para que el texto respire */
    .schedule-item { padding: 8px; margin-bottom: 8px; border-radius: 8px; gap: 8px;}
    .item-text h3 { font-size: 0.75rem; margin-bottom: 1px;}
    .item-text p { font-size: 0.65rem; }
    .item-text .days { font-size: 0.6rem; }
    
    /* 4. Achicamos la foto y los botones */
    .item-box { width: 45px; height: 45px; border-radius: 6px; }
    .badge { font-size: 0.55rem; padding: 2px 5px; margin-bottom: 3px; }
    .vod-btn { font-size: 0.6rem; padding: 4px 10px; margin-top: 4px; border-radius: 10px; }
    .return-live-btn { padding: 6px 12px; font-size: 0.7rem; border-radius: 10px;}
    .video-placeholder { font-size: 0.9rem; }
}