/* ==========================================================================
   1. VARIABLES Y CONFIGURACIÓN BASE (RESET)
   ========================================================================== */
:root {
    --nav-height: 75px;
    --player-height: 90px;
    --accent-red: #f11001;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background-color: #000 !important;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
}

/* Contenedor Maestro de la App */
#master-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* Área de Contenido Principal (Scroll dinámico) */
#main-content {
    flex: 1;
    overflow-y: auto;
    padding-top: var(--nav-height);
    /* Ajustado a 85px para dar espacio físico real a la barra flotante de créditos en noticias */
    padding-bottom: calc(var(--player-height) + 85px); 
    background: radial-gradient(circle at top center, #1a1a1a 0%, #000 100%);
}

/* Corrección Global de Espaciado Superior para Bootstrap en PC y Móvil */
#main-content .container-fluid.py-5,
#main-content .container.py-5 {
    padding-top: 20px !important;
}

/* ==========================================================================
   2. NAVBAR Y MENÚ DE NAVEGACIÓN
   ========================================================================== */
.navbar-custom {
    height: var(--nav-height);
    min-height: var(--nav-height);
    max-height: var(--nav-height);
    background: rgba(10,10,10,.8) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1050;
}

.nav-logo {
    height: 100px;
    display: block;
    position: relative;
    top: 15px;
    z-index: 9999;
}

.navbar-brand {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.brand-name {
    font-weight: 900;
    letter-spacing: -0.5px;
    font-size: 1.2rem;
}

.nav-link {
    font-size: 0.85rem;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.8) !important;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s;
}

.nav-link:hover {
    color: var(--accent-red) !important;
}

.navbar-collapse .d-flex {
    align-items: center;
    gap: 15px !important;
}

/* ==========================================================================
   3. REPRODUCTOR FIJO (PLAYER BAR)
   ========================================================================== */
#player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 2000;
}

/* ==========================================================================
   4. COMPONENTES GLOBALES (Botones, Redes, Utilidades, Modales y Loaders)
   ========================================================================== */
/* Botón TV en Vivo (Estructura Base Premium) */
#tvMenuBtn, #tvMenuBtnDesktop {
    display: inline-block;
    padding: 6px 16px !important;
    font-size: 0.8rem;
    font-weight: 900 !important;
    font-family: 'Montserrat', sans-serif !important;
    text-transform: uppercase;
    text-decoration: none !important;
    letter-spacing: 1px;
    color: var(--accent-red) !important;
    background: linear-gradient(135deg, rgba(241, 16, 1, 0.1) 0%, rgba(241, 16, 1, 0.05) 100%) !important;
    border: 2px solid var(--accent-red) !important;
    border-radius: 50px;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

#tvMenuBtn:hover, #tvMenuBtnDesktop:hover {
    background: var(--accent-red) !important;
    color: #fff !important;
    border-color: #fff !important;
    box-shadow: 0 0 20px rgba(241, 16, 1, 0.5) !important;
    transform: scale(1.05) !important;
}

#tvMenuBtnDesktop:hover {
    background-color: #b00000 !important;
}

/* Redes Sociales */
.social-link {
    font-size: 1.2rem;
    color: #fff !important;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    color: var(--accent-red) !important;
    transform: translateY(-2px);
}

/* Clases de utilidad de texto */
.fw-900 { font-weight: 900; }
.text-outline { -webkit-text-stroke: 1px white; color: transparent; }
.letter-spacing-2 { letter-spacing: 2px; font-size: 0.8rem; }

/* Modales oscuros */
.modal-content {
    background: linear-gradient(145deg, #1a1a1a, #000) !important;
}

/* Loader de Transición de Páginas */
#page-loader {
    display: none;
    position: fixed;
    top: var(--nav-height);
    bottom: var(--player-height);
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 900;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-content { 
    animation: pulse 1.5s infinite ease-in-out; 
}

/* Custom Scrollbar */
#main-content::-webkit-scrollbar { width: 6px; }
#main-content::-webkit-scrollbar-track { background: #000; }
#main-content::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}
#main-content::-webkit-scrollbar-thumb:hover { background: var(--accent-red); }

/* ==========================================================================
   5. VISTA: INICIO (HERO BANNER Y NOTICIAS)
   ========================================================================== */
.hero-banner {
    height: 450px;
    width: 100%;
    background-color: #111;
    background-image: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.2) 100%),
    url('https://images.unsplash.com/photo-1598488035139-bdbb2231ce04?q=80&w=1350&auto=format&fit=crop');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    border-radius: 30px;
    display: flex;
    align-items: flex-end;
    position: relative;
    overflow: hidden;
}

.display-3 { font-size: 2.5rem; }

/* Tarjetas de Noticias */
.news-card { transition: all 0.3s ease; cursor: pointer; text-decoration: none !important; }
.news-card:hover { transform: translateY(-10px); }

.news-img-container { position: relative; overflow: hidden; border-radius: 20px; }
.news-img-container img {
    aspect-ratio: 16/9;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}
.news-card:hover .news-img-container img { transform: scale(1.08); }

.news-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
    opacity: 0.6;
}

/* Interna de Noticia (Detalle Completo) */
.noticia-full-text { line-height: 1.8; font-size: 1.1rem; }
.noticia-full-text p { margin-bottom: 1.5rem; }
.noticia-full-text img { max-width: 100%; height: auto; border-radius: 15px; margin: 1rem 0; }

/* ==========================================================================
   6. VISTA: RADIOS (SMART STUDIO NETWORK)
   ========================================================================== */
.radio-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.3s ease, border-color 0.3s ease;
    will-change: transform;
}

.radio-card:hover {
    background: rgba(241, 16, 1, 0.08); 
    border-color: rgba(241, 16, 1, 0.3);
    transform: translateY(-4px);
}

.radio-card:active {
    transform: translateY(-1px) scale(0.99);
}

.radio-img-container {
    position: relative;
    overflow: hidden;
}

.radio-overlay {
    position: absolute;
    top: 8px; left: 8px; right: 8px; bottom: 8px;
    background: rgba(241, 16, 1, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease-in-out;
}

.radio-card:hover .radio-overlay {
    opacity: 1;
}

/* ==========================================================================
   7. VISTA: NOSOTROS / TEAM SMART (FIX ÓVALO Y BENTO)
   ========================================================================== */
.team-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    overflow: hidden;
    padding: 2.5rem 1.5rem 1.5rem 1.5rem;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
}

.team-card:hover {
    transform: translateY(-5px);
    border-color: rgba(241, 16, 1, 0.3);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
}

/* Forzar círculo perfecto */
.team-img-wrapper {
    width: 200px;
    height: 200px;
    margin: 0 auto 1.5rem auto;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.1);
    transition: border-color 0.3s ease;
}

.team-card:hover .team-img-wrapper {
    border-color: rgba(241, 16, 1, 0.6);
}

.team-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.team-card:hover .team-img-wrapper img {
    transform: scale(1.06);
}

.team-info h3 {
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 0.4rem;
    letter-spacing: 0.5px;
}

/* Grid Bento de Talentos */
.talento-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); 
    gap: 15px; 
}

.talento-item { 
    position: relative; 
    width: 190px;
    height: 240px;
    border-radius: 16px; 
    overflow: hidden; 
    cursor: pointer; 
    background: #0b0b0b;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, border-color 0.3s ease;
    will-change: transform;
}

.talento-item:hover { 
    transform: scale(1.03); 
    border-color: rgba(241, 16, 1, 0.4);
}

.talento-item img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

.talento-overlay { 
    position: absolute; 
    bottom: 0; 
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.4) 70%, transparent 100%); 
    padding: 15px 10px;
    text-align: center;
}

.talento-overlay span { font-size: 0.75rem; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; }

/* --- Ajuste de seguridad exclusivo para los Talentos en Móviles --- */
@media (max-width: 768px) {
    #main-content .talento-grid,
    #main-content .justify-content-center.justify-content-md-start {
        /* Le da un colchón extra de espacio al contenedor de los cuadritos */
        padding-bottom: 60px !important; 
    }
}

/* ==========================================================================
   8. ANIMACIONES GLOBALES (KEYFRAMES)
   ========================================================================== */
@keyframes pulse-danger {
    0% { box-shadow: 0 0 0 0 rgba(217, 0, 0, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(217, 0, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(217, 0, 0, 0); }
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.animate-pulse {
    animation: pulse-danger 2s infinite;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
}

/* ==========================================================================
   9. MEDIA QUERIES (RESPONSIVE DESIGN UNIFICADO E INTERSECCIÓN DE NAVBAR MÓVIL)
   ========================================================================== */

/* --- Celulares Pequeños (max-width: 576px) --- */
@media (max-width: 576px) {
    .row.mb-5 .col-12.d-flex {
        flex-direction: row;
        align-items: center;
    }
    .row.mb-5 h2 {
        font-size: 1.2rem;
    }
}

/* --- Celulares y Tablets Medianas (max-width: 768px) --- */
@media (max-width: 768px) {
    .hero-banner {
        height: 300px;
        border-radius: 20px;
    }
}

/* --- REGLAS DE ALINEACIÓN ABSOLUTA EN MÓVILES (max-width: 991px) --- */
@media (max-width: 991px) {
    /* 1. Contenedor en modo flex sin permitir envolturas */
    .navbar-custom .container-fluid {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        position: relative !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* 2. IZQUIERDA: Forzar al botón de TV a alinearse al extremo izquierdo */
    .navbar-custom .order-1 {
        order: 1 !important;
        flex: 1 !important;
        display: flex !important;
        justify-content: flex-start !important;
        z-index: 10000 !important;
    }

    /* 2.1 FIX: Reducir un tris el tamaño del botón TV solo en móviles */
    #tvMenuBtn {
        margin-right: auto !important;
        padding: 4px 10px !important; /* Más esbelto (antes era 6px 16px) */
        font-size: 0.72rem !important; /* Letra ligeramente más pequeña (antes era 0.8rem) */
        letter-spacing: 0.5px !important;
    }

    /* 3. CENTRO: Logo centrado y permitido sobresalir (Efecto PC) */
    .navbar-custom .navbar-brand {
        order: 2 !important;
        position: absolute !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -40%) !important;
        margin: 0 !important;
        padding: 0 !important;
        z-index: 10005 !important;
    }

    /* Ajuste de tamaño para que "rompa" el borde inferior de la navbar */
    .nav-logo {
        height: 90px !important;
        position: relative !important;
        top: 0 !important;
    }

    /* 4. DERECHA: Forzar al sándwich a alinearse al extremo derecho */
    .navbar-custom .navbar-toggler {
        order: 3 !important;
        flex: 1 !important;
        display: flex !important;
        justify-content: flex-end !important;
        background: transparent !important;
        z-index: 10000 !important;
    }

    /* 5. MENÚ DESPLEGABLE: Cortina intacta */
    .navbar-collapse {
        position: absolute !important;
        top: var(--nav-height) !important;
        left: 0 !important;
        width: 100% !important;
        background: rgba(10, 10, 10, 0.98) !important;
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        padding: 20px !important;
        border-bottom: 1px solid rgba(255,255,255,0.1) !important;
        z-index: 1998 !important; 
        margin-top: 0 !important;
        border-radius: 0 0 15px 15px !important;
        order: 4 !important;
    }
}

/* --- Pantallas Grandes/Escritorio (min-width: 992px) --- */
@media (min-width: 992px) {
    #tvMenuBtn, #tvMenuBtnDesktop {
        padding: 10px 25px !important;
        font-size: 1rem;
    }
    .social-link {
        font-size: 1.5rem;
    }
}

/* ==========================================================================
   FOOTER DE CRÉDITOS INTELIGENTE (Sincronizado al 100% con tu Master SPA)
   ========================================================================== */
.credits-bar {
    position: fixed;
    bottom: calc(var(--player-height) + env(safe-area-inset-bottom)); 
    left: 0;
    width: 100%;
    background: linear-gradient(to top, #000 50%, rgba(0, 0, 0, 0) 100%);
    padding: 8px 20px;
    z-index: 1999; 
    text-align: center;
    pointer-events: none;
    transition: bottom 0.3s ease;
}

.credits-content {
    pointer-events: auto;
}

.text-muted-credits {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.72rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.credit-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.credit-link:hover {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.text-danger-smart {
    color: var(--accent-red); 
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.text-danger-smart:hover {
    color: #fff;
    text-shadow: 0 0 8px var(--accent-red);
}

.credit-divider {
    margin: 0 8px;
    color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   AJUSTE AUTOMÁTICO PARA MÓVILES (Calibrado con tus Media Queries)
   ========================================================================== */
@media (max-width: 1024px) {
    .credits-bar {
        bottom: calc(var(--player-height) + env(safe-area-inset-bottom));
        padding: 6px 10px;
        background: rgba(0, 0, 0, 0.85);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    .text-muted-credits {
        font-size: 0.62rem;
        letter-spacing: 1px;
    }
}