/* =========================================
   STREAMFLEX PRO - CSS CORE v8.5
   ========================================= */

:root { 
    --accent: #E50914; 
    --bg: #050505; 
    --card: rgba(255,255,255,0.03); 
    --glass: rgba(0, 0, 0, 0.85);
    --border: rgba(255, 255, 255, 0.1);
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    -webkit-font-smoothing: antialiased;
}

body { 
    background: var(--bg); 
    color: #fff; 
    font-family: 'Outfit', sans-serif; 
    overflow: hidden; 
    line-height: 1.6;
}

/* NAVBAR & CATEGORIES */
.main-nav { 
    background: #000; 
    padding: 1rem 4%; 
    border-bottom: 1px solid var(--border); 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
}

.nav-container { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    gap: 2rem; 
}

.logo-area { 
    font-size: 1.8rem; 
    font-weight: 900; 
    color: var(--accent); 
    letter-spacing: -1.5px; 
    text-transform: uppercase;
}

.logo-area span { color: #fff; font-weight: 200; }

.search-area { flex: 1; max-width: 600px; }
.search-area input { 
    width: 100%; 
    padding: 12px 25px; 
    border-radius: 30px; 
    border: 1px solid var(--border); 
    background: var(--card); 
    color: #fff; 
    font-family: inherit;
    transition: 0.3s;
}

.search-area input:focus { 
    outline: none; 
    border-color: var(--accent); 
    background: rgba(255,255,255,0.08); 
}

.category-bar { 
    display: flex; 
    gap: 12px; 
    margin-top: 15px; 
    overflow-x: auto; 
    scrollbar-width: none; 
    padding-bottom: 5px;
}

.category-bar::-webkit-scrollbar { display: none; }

.cat-item { 
    padding: 8px 22px; 
    border-radius: 20px; 
    background: var(--card); 
    border: 1px solid var(--border); 
    color: #888; 
    cursor: pointer; 
    white-space: nowrap; 
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.85rem;
    font-weight: 400;
}

.cat-item.active, .cat-item:hover { 
    background: var(--accent); 
    color: #fff; 
    border-color: var(--accent);
}

/* MAIN LAYOUT */
.main-grid { 
    display: flex; 
    padding: 20px 4%; 
    gap: 25px; 
    height: calc(100vh - 130px); 
}

.player-section { 
    flex: 2.5; 
    display: flex; 
    flex-direction: column; 
    gap: 20px;
    min-width: 0;
}

.catalog-sidebar { 
    flex: 0.9; 
    background: var(--card); 
    border-radius: 24px; 
    padding: 20px; 
    overflow-y: auto; 
    border: 1px solid var(--border);
}

/* PLAYER BOX & VIDEO */
.video-container { 
    position: relative; 
    width: 100%; 
    aspect-ratio: 16/9; 
    background: #000; 
    border-radius: 20px; 
    overflow: hidden; 
    box-shadow: 0 50px 100px -20px rgba(0,0,0,0.7);
}

.mount-point { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.startup-msg { color: #444; font-weight: 900; letter-spacing: 2px; font-size: 0.9rem; }

/* FULLSCREEN OVERLAY - DISEÑO PREMIUM */
.custom-controls-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 15%;
    height: 200px;
    background: transparent 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 5px;
    opacity: 0;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
    pointer-events: none;
    transform: translateY(15px);
}

.video-container:hover .custom-controls-overlay {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#custom-fullscreen-btn {
    width: 100%;
    height: 50px;
    background: transparent;
    cursor: pointer;
    font-weight: 400;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

#custom-fullscreen-btn i { color: var(--accent); font-size: 1.8rem; }

#custom-fullscreen-btn:hover {
    background: transparent;
    box-shadow: 0 0 30px rgba(229, 9, 20, 0.2);
}

/* PUBLICIDAD BANNERS */
/* PUBLICIDAD BANNERS - ACTUALIZADO v9.6 */
.adv-banner { 
    position: absolute; 
    bottom: 0px; /* Sube lo suficiente para no tapar el botón de ampliar */
    left: 20px;  /* Posición a la derecha en PC */
    left: auto;   /* Anulamos el centrado anterior */
    transform: none; 
    width: 350px; /* Tamaño tipo notificación para PC */
    max-width: 90%;
    z-index: 100; /* Por encima de los controles pero debajo de los anuncios de video */
    transition: 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Animación de entrada lateral */
.adv-banner.hidden { 
    opacity: 0; 
    transform: translateX(50px); 
    display: none !important; 
}

.adv-content { 
    background: var(--glass); 
    backdrop-filter: blur(15px);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent); 
    padding: 12px 20px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-radius: 12px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Estilo para el botón que inyectamos desde el JS */
.adv-btn {
    flex-shrink: 0;
    margin: 0 10px;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    color: #fff;
    transition: 0.3s;
}

#adv-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: #eee;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* PUBLICIDAD VIDEO (INTERSTITIAL) */
.ad-interstitial { 
    position: absolute; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    background: #000; 
    z-index: 2500; 
}

#yt-player { width: 100%; height: 100%; }

.ad-timer-ui { position: absolute; bottom: 30px; right: 35px; z-index: 2600; }
.btn-skip { 
    padding: 10px 30px; 
    background: #fff; 
    color: #000; 
    font-weight: 900; 
    text-transform: uppercase; 
    font-size: 0.75rem; 
    border-radius: 1px; 
    border: none;
    cursor: pointer;
    transition: 0.3s;
}
.btn-skip hover { background: transparent; }
.btn-skip:disabled { opacity: 0.5; cursor: not-allowed; }


/* MEDIA CARDS */
.scroll-list { display: grid; grid-template-columns: 1fr; gap: 12px; }

.media-card { 
    display: flex; 
    gap: 15px; 
    padding: 12px; 
    border-radius: 16px; 
    cursor: pointer; 
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    border: 1px solid transparent; 
    background: rgba(255,255,255,0.02);
}

.media-card:hover { 
    background: rgba(255,255,255,0.06); 
    border-color: var(--border);
    transform: translateY(-2px);
}

.card-img { 
    position: relative; 
    width: 130px; 
    min-width: 130px; 
    aspect-ratio: 16/9; 
    border-radius: 10px; 
    overflow: hidden; 
}

.card-img img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.media-card:hover .card-img img { transform: scale(1.1); }

.play-hint { 
    position: absolute; 
    inset: 0; 
    background: rgba(0,0,0,0.5); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    opacity: 0; 
    transition: 0.3s; 
    font-size: 1.2rem;
}

.media-card:hover .play-hint { opacity: 1; }

.card-txt h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 4px; color: #eee; }
.card-txt span { font-size: 0.7rem; color: #666; text-transform: uppercase; letter-spacing: 1px; }

/* UTILS */
.hidden { display: none !important; }
.meta-info h1 { font-size: 1.8rem; font-weight: 900; margin-bottom: 8px; letter-spacing: -1px; }
.meta-info p { color: #666; font-size: 0.95rem; max-width: 800px; }

/* SCROLLBAR */
.catalog-sidebar::-webkit-scrollbar { width: 4px; }
.catalog-sidebar::-webkit-scrollbar-track { background: transparent; }
.catalog-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }

/* RESPONSIVE */
@media (max-width: 1024px) {
    body { overflow-y: auto; }
    .main-grid { flex-direction: column; height: auto; }
    .catalog-sidebar { height: 600px; flex: none; }
    .video-container { border-radius: 0; margin: 0 -4%; width: 108%; }
}

/* RESPONSIVE UPDATES */
@media (max-width: 1024px) {
    body { overflow-y: auto; }
    .main-grid { flex-direction: column; height: auto; }
    .catalog-sidebar { height: 600px; flex: none; }
    .video-container { border-radius: 0; margin: 0 -4%; width: 108%; }

    /* Ajuste de Banner para Tablet/Móvil */
    .adv-banner {
        bottom: 70px; /* Un poco más abajo en móvil */
        right: 5%;
        left: 5%;
        width: 90%;
        transform: none;
    }

    .adv-content {
        padding: 10px 15px;
    }

    #adv-text {
        font-size: 0.75rem;
    }

    /* Botón de ampliar más visible en táctil */
    #custom-fullscreen-btn {
        letter-spacing: 2px;
        font-size: 0.65rem;
    }
}

/* Optimización para móviles pequeños */
@media (max-width: 480px) {
    .adv-banner {
        bottom: 0px;
    }
    .adv-btn {
        padding: 5px 8px;
        font-size: 9px;
    }
}

/* Optimización para móviles pequeños */
@media (max-width: 760px) {
    .adv-banner {
        bottom: 0px;
    }
    .adv-btn {
        padding: 5px 8px;
        font-size: 9px;
    }
}