/* DESPUÉS (Lógica de tema unificada) */
:root {
    /* Ahora las variables por defecto son las del tema CLARO */
    --color-background: #f0f2f5;
    --color-surface: #ffffff;
    --color-primary: #050505;
    --color-secondary: #65676b;
    --color-accent: #b72a1e;
    --border-color: #ddd;
    --border-radius: 12px;
}
body.dark-theme {
    /* La clase .dark-theme aplicará las variables del tema OSCURO */
    --color-background: #121212;
    --color-surface: #1e1e1e;
    --color-primary: #ffffff;
    --color-secondary: #b3b3b3;
    --border-color: #333;
}

body { background-color: var(--color-background); color: var(--color-primary); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; margin: 0; padding-top: 60px; }
.container { 
    max-width: 1600px; 
    margin: 0 auto; 
    padding: 0 2rem; 
}
/* --- HEADER --- */
.main-header { position: fixed; top: 0; left: 0; width: 100%; height: 60px; background-color: var(--color-surface); border-bottom: 1px solid var(--border-color); z-index: 2000; }
.header-content { display: flex; justify-content: space-between; align-items: center; max-width: 1800px; margin: 0 auto; height: 100%; padding: 0 1.5rem; }
.header-logo { display: flex; align-items: center; text-decoration: none; color: var(--color-primary); gap: 0.75rem; }
.header-logo img { height: 40px; }
.header-actions { display: flex; align-items: center; gap: 1rem; }

/* --- Estilos para la Barra de Búsqueda --- */
.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--color-surface-light);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.search-bar:focus-within {
    border-color: var(--color-accent); /* Resalta la barra al hacer clic */
}

.search-bar i {
    color: var(--color-secondary);
    margin-right: 0.5rem;
}

.search-bar input {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 0.9rem;
    width: 200px; /* Ancho inicial */
    transition: width 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    width: 250px; /* Se expande un poco al hacer clic */
}

.search-bar input::placeholder {
    color: var(--color-secondary);
}

.theme-toggle-btn, .profile-icon { font-size: 1.5rem; color: var(--color-secondary); background: none; border: none; cursor: pointer; }

/* --- CARRUSEL HERO (v2 - Info Debajo) --- */
.featured-carousel {
    position: relative;
    width: 100%;
    height: 60vh; /* Altura un poco mayor para dar espacio a la info */
    min-height: 500px;
    padding: 2rem 0;
    box-sizing: border-box;
    overflow: hidden;
}
.carousel-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    perspective: 1500px;
}
.carousel-track {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}
.carousel-slide {
    display: flex; /* Cambiamos a flexbox */
    flex-direction: column; /* Dirección vertical */
    position: absolute;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 50%;
    max-width: 700px;
    height: 100%;
    border-radius: var(--border-radius);
    background-color: var(--color-surface); /* Color de fondo para la caja de info */
    overflow: hidden;
    transition: transform 0.5s ease, opacity 0.5s;
    cursor: pointer;
}
.slide-player {
    width: 100%;
    height: 75%; /* El reproductor ocupa el 75% del alto */
    background-color: #000;
    flex-shrink: 0; /* Evita que se encoja */
}
.slide-player img,
.slide-player iframe {
    width: 100%;
    height: 100%;
    border: none;
    object-fit: cover;
}
.slide-info-box {
    position: static; /* Ya no está superpuesto */
    width: 100%;
    height: 25%; /* La info ocupa el 25% restante */
    padding: 1rem 1.5rem;
    box-sizing: border-box;
    background: none; /* Quitamos el gradiente */
    color: var(--color-primary);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.slide-info-box h3 {
    margin: 0 0 0.25rem;
    font-size: 1.2rem;
    line-height: 1.3; /* Añadimos una altura de línea para mejor legibilidad */
    /* Se eliminaron las reglas de truncamiento para permitir que el texto ocupe varias líneas */
}
.slide-info-box p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--color-secondary);
    /* Se eliminaron las reglas de truncamiento */
}
.carousel-nav {
    position: absolute;
    top: 40%; /* Ajustado para estar centrado en el reproductor */
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
}
.carousel-nav.prev { left: 10%; }
.carousel-nav.next { right: 10%; }

/* --- AGENDA (ESTILO ORIGINAL) --- */
.agenda-wrapper { max-width: 1600px; margin: 2rem auto; padding: 0 1.5rem; }
.tabs { border-bottom: 1px solid var(--border-color); }
.tab-link { padding: 0.75rem 1rem; cursor: pointer; background: none; border: none; color: var(--color-secondary); font-size: 1rem; font-weight: 600; border-bottom: 3px solid transparent; }
.tab-link.active { color: var(--color-primary); border-bottom-color: var(--color-accent); }
.tab-content { display: none; }
.tab-content.active { display: block; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; padding-top: 1.5rem; }
.event-card {
    aspect-ratio: 1 / 1;
    position: relative;
    cursor: pointer;
    border-radius: var(--border-radius);
    overflow: hidden;
    background-color: var(--color-surface-light);
    transform: translateZ(0); /* <-- Añadido para estabilidad */
}
.event-card .card-background { position: absolute; width: 100%; height: 100%; background-size: cover; background-position: center; z-index: 1; }

.event-card .card-info {
    position: relative;
    z-index: 2; /* Pone el texto por encima del nuevo degradado */
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    box-sizing: border-box;
}

.video-card { cursor: pointer; background-color: var(--color-surface); border-radius: var(--border-radius); }
.video-card img { width: 100%; border-radius: var(--border-radius) var(--border-radius) 0 0; display: block; }
.video-card p { font-weight: 600; margin: 0; padding: 1rem; }

/* --- ESTILOS PARA SALA DE DIRECTO (v7 - Layout Definitivo) --- */

/* 1. Contenedor principal del Modal y Scroll */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--color-background);
    z-index: 3000;
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s;
    overflow-y: auto;
}
.modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* 2. Botón de cierre */
.modal-close-btn {
    position: fixed;
    top: 0rem;
    right: 1rem;
    z-index: 3010;
    background: var(--color-surface);
    color: var(--color-primary);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* 3. Grid principal del contenido */
.live-room-content {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 1.5rem;
    width: 100%;
    max-width: 1800px;
    min-height: 100%; /* Asegura que el grid ocupe al menos toda la altura */
    margin: 0 auto;
    padding: 1.5rem;
    box-sizing: border-box;
}

/* 4. Columnas */
.live-room-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ---- INICIO DE LA CORRECCIÓN PARA EL CHAT ---- */
.live-room-side {
    display: flex;
    flex-direction: column;
    /* Importante: quitamos min-height de aquí para que sea flexible */
}

#chat-box {
    background-color: var(--color-surface);
    border-radius: var(--border-radius);
    padding: 1rem;
    flex-grow: 1; /* Hace que la caja del chat se estire */
    display: flex; /* La caja del chat también es un contenedor flex */
    flex-direction: column;
    min-height: 0; /* Truco de flexbox para evitar desbordamientos */
}
/* ---- FIN DE LA CORRECCIÓN PARA EL CHAT ---- */


/* 5. Contenedores internos */
.live-room-player {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    border-radius: var(--border-radius);
    overflow: hidden;
}
.live-room-player iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.live-room-investigators-strip,
.live-room-info {
    background-color: var(--color-surface);
    padding: 1.5rem;
    border-radius: var(--border-radius);
}

.live-room-side {
    /* Limita la altura de la columna a la altura de la ventana menos el padding */
    max-height: calc(100vh - 3rem);
    
    /* Hace que la columna se quede fija al hacer scroll */
    position: -webkit-sticky;
    position: sticky;
    top: 1.5rem; /* La deja pegada en la parte superior, respetando el padding */
}

/* --- INICIO DE CORRECCIÓN PARA AVATARES --- */
.live-room-investigators-strip .avatar {
    width: 44px;  /* Más pequeño */
    height: 44px; /* Más pequeño */
    border-radius: 50%; /* Asegura que sea circular */
    object-fit: cover;
    cursor: pointer;
}
/* --- FIN DE CORRECCIÓN PARA AVATARES --- */


#chat-container {
    flex-grow: 1; /* El contenedor del iframe ocupa el espacio de #chat-box */
    min-height: 0; /* Necesario para que flexbox calcule bien la altura */
    border-radius: var(--border-radius);
    overflow: hidden; /* Oculta cualquier desbordamiento del iframe */
}
#chat-container iframe {
    /* Hacemos el iframe un poco más grande que el contenedor */
    width: calc(100% + 20px);
    height: calc(100% + 20px);

    /* Lo movemos para que los bordes queden fuera */
    margin-top: -10px;
    margin-left: -10px;

    /* Nos aseguramos de que no tenga bordes propios */
    border: none;
    border-radius: var(--border-radius);
}


/* 6. Layout para MÓVIL */
@media (max-width: 1024px) {
    .live-room-content {
        grid-template-columns: 1fr;
    }
    .live-room-player {
        position: -webkit-sticky;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    .live-room-side {
        min-height: 500px;
    }
}

/* --- ESTILOS PARA MODAL DE INVESTIGADOR --- */
.investigator-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4000;
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.investigator-modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}
.investigator-modal {
    background-color: var(--color-surface);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    position: relative;
}
.investigator-modal-header {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    border-bottom: 1px solid var(--border-color);
}
.investigator-modal-close-btn {
    background: none;
    border: none;
    color: var(--color-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}
.investigator-modal-content {
    padding: 1.5rem;
    overflow-y: auto;
    text-align: center;
}
.investigator-modal-content img.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--color-accent);
    margin-bottom: 1rem;
}
.investigator-modal-content h3 {
    margin: 0 0 0.5rem;
}
.investigator-modal-content .project-info {
    background-color: var(--color-surface-light);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1.5rem;
    text-align: left;
}

/* --- ESTILOS PARA BOTÓN EN VIVO DEL CARRUSEL --- */
.blinking-live-btn {
    background-color: var(--color-accent);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 0.5rem 1rem;
    font-weight: bold;
    margin-top: 1rem;
    cursor: pointer;
    animation: blinking-animation 1.5s infinite;
}

@keyframes blinking-animation {
    0% {
        background-color: var(--color-accent);
        box-shadow: 0 0 5px var(--color-accent);
    }
    50% {
        background-color: #ff4d4d; /* Un rojo más brillante */
        box-shadow: 0 0 15px #ff4d4d;
    }
    100% {
        background-color: var(--color-accent);
        box-shadow: 0 0 5px var(--color-accent);
    }
}

/* --- Estilos para Indicadores en Tarjetas de Agenda --- */
.card-top-info {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 3;
    box-sizing: border-box;
}

.card-date, .card-live-indicator {
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 600;
}

.card-live-indicator {
    background-color: var(--color-accent);
    animation: blinking-animation 1.5s infinite;
}

/* --- Estilo de Texto para Tarjetas (Ajuste de Wrap) --- */

/* Estilo para los TÍTULOS (tanto en eventos como en videos) */
.event-card .card-info h5 {
    color: #FFFFFF; /* Forzamos el color a blanco, ignora el tema */
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 0.25rem 0;
    /* Permitimos que el texto ocupe varias líneas */
}

.event-card .card-info p {
    color: #E0E0E0; /* Un gris claro, ignora el tema */
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0;
    /* Permitimos que el texto ocupe varias líneas */
}

.video-card p {
    color: var(--color-primary);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4; /* Buena altura de línea para legibilidad */
    margin: 0;
    /* Se han eliminado las reglas de truncamiento de texto */
}

/* Estilo para el nombre del ORGANIZADOR (solo en eventos) */
.card-info p {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-secondary);
    margin-top: 0.25rem;
    /* Se han eliminado las reglas de truncamiento de texto */
}

/* Ajustes generales de padding y layout */
.card-info {
    padding: 1rem;
}
.video-card {
    display: flex;
    flex-direction: column;
}
.video-card p {
    padding: 1rem;
    flex-grow: 1;
}
.card-info h5 {
    margin-bottom: 0.25rem;
}

/* --- Estilos para Iconos de Usuario Dinámicos --- */

#user-icon-container {
    display: flex; /* Para alinear el avatar y el botón de logout */
    align-items: center;
    gap: 1rem; /* Mismo espaciado que los otros íconos */
}

#user-icon-container .nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-secondary);
    font-size: 1.5rem; /* Mismo tamaño que los otros íconos */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    transition: color 0.2s ease;
}

#user-icon-container .nav-icon:hover {
    color: var(--color-primary); /* Efecto hover */
}

#user-icon-container img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* --- Estilos para Modal de Login --- */
.login-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 4000;
    display: none; /* Oculto por defecto */
    align-items: center; justify-content: center;
    backdrop-filter: blur(5px);
}
.login-modal-overlay.is-visible {
    display: flex; /* Se muestra con JS */
}
.login-modal {
    background-color: var(--color-surface);
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 450px;
}
.login-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}
.login-modal .modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}
.login-modal .modal-close-btn {
    background: none; border: none; font-size: 2rem;
    color: var(--color-secondary); cursor: pointer;
}
.login-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}
.login-provider-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--color-primary);
    font-weight: 600;
    gap: 0.75rem;
}
.login-provider-btn:hover {
    background-color: var(--color-surface-light);
}

/* --- Estilos Mejorados para Modal de Investigador --- */
.profile-card__socials {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 1.5rem;
    margin: 1.5rem 0;
}
.profile-card__socials a {
    color: var(--color-secondary);
    transition: color 0.2s ease;
}
.profile-card__socials a:hover {
    color: var(--color-primary);
}
.investigator-bio {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--color-secondary);
}

/* --- Estilo Mejorado para Contador en Modal --- */
.live-room-countdown {
    background-color: var(--color-surface);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    border: 1px solid var(--border-color);
    margin-bottom: 0; /* 1.5rem Espacio extra debajo del contador */
}

#countdown-timer {
    font-size: 2.2rem; /* Hacemos el texto del reloj más grande */
    font-weight: 700;
    color: var(--color-primary);
    font-family: "SF Mono", "Consolas", "Menlo", monospace; /* Estilo de reloj digital */
    letter-spacing: 2px;
    margin-bottom: 1rem; /* Espacio entre el reloj y el botón */
}

#countdown-timer strong {
    color: var(--color-accent);
}

/* Estilo para el botón dentro del contador */
.live-room-countdown .btn-primary {
    margin-top: 1rem;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    font-weight: bold;
    background: var(--color-accent);
    color: white;           /* <-- CORRECCIÓN: asegura que el texto sea blanco */
    border: none;
    border-radius: 8px;     /* <-- CORRECCIÓN: esquinas redondeadas */
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    display: inline-block;
    width: auto;
}

.live-room-countdown .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* --- Estilo para Botón de Substack --- */
.btn-substack {
    background-color: #FF6719; /* Color oficial de Substack */
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s ease;
}
.btn-substack:hover {
    background-color: #e65c17; /* Un tono un poco más oscuro */
}

#live-room-primary-action {
    margin-top: -0.5rem; /* Reduce el espacio si el contador no está */
    margin-bottom: 1.5rem;
}

/* --- Estilos para Botones de Acción en el Modal --- */
.action-buttons-container .btn-primary,
.action-buttons-container .btn-secondary {
    background-color: #a70101;
    color: white;
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.action-buttons-container .btn-primary:hover,
.action-buttons-container .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* --- Estilos para el Modal de Investigador (Adicional) --- */
.project-info h5 {
    font-size: 1rem;
    margin: 0.5rem 0;
}
.project-authors, .project-description {
    font-size: 0.9rem;
    color: var(--color-secondary);
    margin-bottom: 1rem;
}

.doi-badge {
    display: inline-block;
    background-color: #0077b3; /* Un color azul estándar para DOI */
    color: white !important;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.2s;
}
.doi-badge:hover {
    background-color: #005f8f;
}

/* --- INICIO DE LA CORRECCIÓN DEFINITIVA DEL CARRUSEL EN MÓVIL --- */
/* Por favor, reemplaza el bloque @media anterior con este */

@media (max-width: 768px) {
    .featured-carousel {
        height: auto; /* La altura del carrusel se adaptará a su contenido */
        min-height: unset; /* Reseteamos la altura mínima de escritorio */
        padding: 1.5rem 0;
    }

    .carousel-track {
        /* Convertimos el track en un simple contenedor de scroll horizontal */
        display: flex;
        overflow-x: auto; /* Habilitamos el scroll con el dedo */
        gap: 1rem; /* Espacio entre cada tarjeta */
        padding: 0 1rem; /* Padding a los lados para que no se pegue a los bordes */

        /* Desactivamos por completo el comportamiento 3D y de posicionamiento absoluto */
        position: static;
        transform-style: flat;
        perspective: none;
    }

    .carousel-slide {
        /* Cada slide ahora es un item flexible que no se encoge */
        flex: 0 0 80%; /* Cada slide ocupará el 80% del ancho de la pantalla */
        max-width: 320px; /* Un ancho máximo por si el 80% es demasiado en tablets */
        
        /* Reseteamos el posicionamiento y las transformaciones del modo escritorio */
        position: static;
        transform: none !important;
        opacity: 1 !important;
        height: auto; /* La altura de la tarjeta se adapta a su contenido */
    }

    .slide-player {
        /* LA CLAVE: Forzamos la proporción correcta del video/imagen */
        aspect-ratio: 16 / 9;
        height: auto; /* La altura es automática, basada en el ancho y la proporción */
    }
    
    .slide-info-box {
        height: auto; /* La altura de la caja de texto se adapta a su contenido */
    }

    .carousel-nav {
        display: none; /* Ocultamos las flechas de navegación, se usa el scroll */
    }
}
/* --- FIN DE LA CORRECCIÓN --- */

/* --- INICIO DE ESTILOS DE NAVEGACIÓN (AÑADIR A LIVE.CSS) --- */

/* 1. NAVEGACIÓN DE ESCRITORIO */
.desktop-nav {
   padding: 1rem 0;
   position: sticky;
   top: 0;
   z-index: 1000;
   -webkit-backdrop-filter: blur(10px);
   backdrop-filter: blur(10px);
   transition: background-color 0.3s;
}
body.dark-theme .desktop-nav {
    /* Color de fondo para el tema oscuro con 80% de opacidad */
    background-color: rgba(24, 25, 26, 0.8);
}
/* Fondo oscuro por defecto (sin transparencia inicial) */
.desktop-nav {
   background-color: var(--color-background);
   background-color: rgba(240, 242, 245, 0.8);
}
/* Fondo claro para tema light (sin transparencia inicial) */
body.light-theme .desktop-nav {
   background-color: var(--color-background);
}
.desktop-nav .container { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    gap: 1rem; 
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}
.desktop-nav .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--color-primary);
    text-decoration: none;
}
.desktop-nav .logo img { 
    height: 40px; 
    display: block; 
}
.bento-box-nav { 
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
    background-color: var(--color-surface); 
    padding: 0.5rem; 
    border-radius: var(--border-radius); 
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); 
    transition: background-color 0.3s; 
}
.main-menu { 
    flex-grow: 1; 
    justify-content: center; 
}
.nav-icon { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    width: 44px; 
    height: 44px; 
    border-radius: 8px; 
    transition: background-color 0.2s ease, color 0.2s ease; 
    color: var(--color-secondary); 
    font-size: 1.1rem; 
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
}
.nav-icon:hover { 
    background-color: var(--color-background); 
    color: var(--color-accent); 
}
.nav-icon.active { 
    background-color: var(--color-accent); 
    color: white; 
}
.nav-icon img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* 2. NAVEGACIÓN MÓVIL */
.mobile-nav { 
    display: none; 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    z-index: 1000; 
    background-color: var(--color-surface); 
    border-top: 1px solid var(--border-color); 
    box-shadow: 0 -2px 5px rgba(0,0,0,0.05); 
    padding: 0.25rem 0; 
    justify-content: space-around; 
}
.mobile-nav__link { 
    flex-grow: 1; 
    color: var(--color-secondary); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    height: 54px; 
    font-size: 1.5rem; 
    background: none;
    border: none;
    cursor: pointer;
}
.mobile-nav__link.active { 
    color: var(--color-accent); 
}
.mobile-nav__text { display: none; }

/* 3. MENÚ DESPLEGABLE MÓVIL (MÁS OPCIONES) */
.mobile-more-menu { 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    z-index: 1002; 
    background-color: var(--color-surface); 
    border-top-left-radius: var(--border-radius); 
    border-top-right-radius: var(--border-radius); 
    box-shadow: 0 -5px 15px rgba(0,0,0,0.1); 
    transform: translateY(100%); 
    transition: transform 0.3s ease-out; 
} 
.mobile-more-menu.is-visible { 
    transform: translateY(0); 
}
.mobile-more-menu__content { 
    padding: 1.5rem; 
} 
.mobile-more-menu__item { 
    display: flex; 
    align-items: center; 
    gap: 1rem; 
    padding: 1rem; 
    font-size: 1rem; 
    font-weight: 500; 
    color: var(--color-primary); 
    border-radius: 8px; 
    width: 100%;
    text-decoration: none;
}
.mobile-more-menu__item:hover, .mobile-more-menu__item:active { 
    background-color: var(--color-background); 
}
.mobile-more-menu__item i { 
    width: 24px; 
    text-align: center; 
    font-size: 1.2rem; 
    color: var(--color-secondary); 
}
.mobile-more-menu__item img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.5); 
    z-index: 1001; 
    opacity: 0; 
    visibility: hidden; 
    transition: opacity 0.4s, visibility 0.4s; 
}
.overlay.is-visible { 
    opacity: 1; 
    visibility: visible; 
}

/* 4. AJUSTES RESPONSIVOS */
@media (max-width: 768px) {
    .desktop-nav { 
        display: none; 
    }
    .mobile-nav { 
        display: flex; 
    }
    body { 
        padding-bottom: 60px; /* Espacio para el menú móvil */
    }
}

/* 5. OTROS AJUSTES */
/* Reposicionamos la barra de búsqueda que movimos en el HTML */
.search-bar-wrapper {
    margin-bottom: 1.5rem;
}
/* Ocultamos el header original de live.css */
.main-header {
    display: none;
}
/* Hacemos que el body no tenga padding superior, ya que el nuevo menú es sticky */
body {
    padding-top: 0px; /* Altura del nuevo header + padding */
}

/* --- FIN DE ESTILOS DE NAVEGACIÓN --- */

/* --- Estilo para el indicador "Live" en el Header --- */

.header-logo .live-indicator {
    /* Reutilizamos el estilo del indicador de las tarjetas de evento */
    background-color: var(--color-accent);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1; /* Ayuda al centrado vertical */
    
    /* Reutilizamos la animación titilante que ya existe en tu CSS */
    animation: blinking-animation 1.5s infinite;
}

/* --- INICIO: ESTILOS PARA NOTIFICACIONES --- */

.nav-icon {
    position: relative; /* Asegura que el punto se ancle al icono */
}

.nav-icon.has-notifications::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background-color: var(--color-accent);
    border-radius: 50%;
    border: 2px solid var(--color-surface);
}

.notifications-modal {
    position: fixed;
    top: 70px; /* Debajo del header */
    right: 1.5rem;
    width: 350px;
    max-height: 400px;
    background-color: var(--color-surface);
    border-radius: var(--border-radius);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease-out;
}

.notifications-modal.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notifications-content {
    padding: 1rem;
    overflow-y: auto;
    max-height: 380px;
}

.notifications-content h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.75rem;
}

.notification-item {
    display: block;
    padding: 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--color-primary);
}

.notification-item:hover {
    background-color: var(--color-background);
}

.notification-item p {
    margin: 0 0 0.25rem 0;
    font-weight: 500;
}

.notification-item span {
    font-size: 0.8rem;
    color: var(--color-secondary);
}

/* --- FIN: ESTILOS PARA NOTIFICACIONES --- */

/* --- INICIO: ESTILOS DE ADVERTENCIA Y REPORTE --- */

.live-room-disclaimer, .live-room-report {
    background-color: var(--color-surface);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-top: 0; /* 1.5rem Asegura que esté al final y separado */
}

.live-room-disclaimer p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--color-secondary);
    line-height: 1.5;
    text-align: center;
}

.live-room-report {
    padding: 1rem;
    text-align: center;
}

.report-button {
    background: none;
    border: none;
    color: var(--color-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
}

.report-button:hover {
    color: var(--color-accent);
}

.report-button i {
    margin-right: 0.5rem;
}
/* --- INICIO: ESTILOS PARA EL CHAT DE BLUESKY --- */

/* 1. Contenedor Principal del Chat de Bluesky */
/* Este contenedor se asegura de que sus hijos (lista de mensajes y formulario) 
   se organicen verticalmente y ocupen todo el espacio disponible en #chat-box. */
#bsky-chat-container {
    display: flex;
    flex-direction: column;
    height: 100%; /* Ocupa toda la altura de su padre (#chat-box) */
    min-height: 0; /* Un truco de flexbox para evitar desbordamientos en contenedores anidados */
}

/* 2. Lista de Mensajes (La parte que hace scroll) */
/* Este es el corazón del chat. Crece para ocupar el espacio sobrante y permite el scroll. */
.chat-messages-list {
    flex-grow: 1; /* ¡MUY IMPORTANTE! Hace que esta área crezca y empuje el formulario hacia abajo. */
    overflow-y: auto; /* Habilita el scroll vertical cuando hay muchos mensajes. */
    padding: 0.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem; /* Espacio vertical entre cada mensaje. */
}

/* 3. Formulario de Entrada de Texto */
/* Organiza el <textarea> y el botón de enviar. */
.chat-input-form {
    display: flex;
    align-items: center; /* Centra el botón y el textarea verticalmente. */
    gap: 0.5rem;
    padding: 1rem 0 0 0; /* Espacio superior para separarlo de los mensajes. */
    margin-top: auto; /* Se asegura de que siempre esté pegado abajo. */
    border-top: 1px solid var(--border-color);
}

.chat-input-form textarea {
    flex-grow: 1; /* El área de texto ocupa todo el espacio posible. */
    border-radius: 18px; /* Le da una forma de "píldora". */
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-color);
    background-color: var(--color-background); /* Usa el fondo principal para que se integre. */
    color: var(--color-primary);
    resize: none; /* Deshabilita la opción de cambiar el tamaño. */
    font-family: inherit; /* Usa la misma fuente que el resto de la página. */
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.chat-input-form textarea:focus {
    outline: none;
    border-color: var(--color-accent); /* Resalta el borde al hacer foco. */
}

.chat-input-form .send-btn {
    flex-shrink: 0; /* Evita que el botón se encoja. */
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--color-accent);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s, transform 0.1s;
}

.chat-input-form .send-btn:hover {
    transform: scale(1.1);
}

.chat-input-form .send-btn:disabled {
    background-color: var(--color-secondary);
    cursor: not-allowed;
    transform: scale(1);
}

/* 4. Estilos para cada Mensaje Individual */
.chat-message {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start; /* Alinea el avatar con la parte superior del texto. */
}

.chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    margin-top: 2px;
}

.chat-message-content {
    display: flex;
    flex-direction: column;
}

.chat-message-content p {
    margin: 0.25rem 0 0 0;
    line-height: 1.4;
    word-wrap: break-word; /* Evita que texto muy largo rompa el layout. */
}

.chat-author strong {
    font-weight: 600;
}

.chat-author .chat-handle {
    color: var(--color-secondary);
    font-size: 0.9em;
    margin-left: 0.25rem;
}

/* 5. Mensajes del Sistema (Cargando..., Errores, etc.) */
.chat-system-message {
    text-align: center;
    color: var(--color-secondary);
    font-style: italic;
    padding: 1rem 0;
    margin: auto 0; /* Centra verticalmente el mensaje si es lo único en el chat */
}

.chat-system-message.error {
    color: var(--color-accent);
    font-weight: 500;
    font-style: normal;
}
/* --- AÑADE ESTOS ESTILOS AL FINAL DE LIVE.CSS --- */

/* Estilos para el prompt que pide al usuario iniciar sesión */
.chat-login-prompt {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 1rem;
    height: 100%;
    padding: 1rem;
}

.chat-login-prompt h4 {
    margin-bottom: 0;
}

.chat-login-prompt .login-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 280px;
}

/* Estilos para el prompt que pide conectar cuenta de Bluesky */
.chat-action-prompt {
    background-color: var(--color-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.chat-action-prompt p {
    margin: 0;
    font-weight: 500;
}

.chat-action-prompt .btn-secondary {
    background-color: var(--color-accent);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap; /* Evita que el texto del botón se rompa */
}
/* --- FIN: ESTILOS PARA EL CHAT DE BLUESKY --- */
/* --- AÑADE ESTOS ESTILOS AL FINAL DE LIVE.CSS --- */
/* CSS DEFINITIVO PARA EL MODAL DE CONEXIÓN DE BSKY */
#bsky-connect-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(18, 18, 18, 0.8); /* Fondo oscuro semitransparente */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#bsky-connect-modal .bento-box {
  background-color: var(--color-surface);
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  color: var(--color-primary);
  border: 1px solid var(--border-color);
}

.bsky-modal-close-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  background: var(--color-background);
  border-radius: 50%;
  border: 1px solid var(--border-color);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#bsky-connect-modal .btn {
    width: 100%;
    text-align: center;
    padding: 0.8rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    border: none;
}

#bsky-connect-modal .btn-primary {
    background-color: var(--color-accent);
    color: white;
}

#bsky-connect-modal .btn-secondary {
    background-color: var(--color-surface);
    color: var(--color-primary);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

/* El resto de los estilos del formulario que ya tenías */
#bsky-connect-modal h3, #bsky-connect-modal h4 { margin-top: 0; }
#bsky-connect-modal hr { border: none; border-top: 1px solid var(--border-color); margin: 1.5rem 0; }
#bsky-connect-modal .form-group { margin-bottom: 1rem; }
#bsky-connect-modal label { display: block; font-weight: 600; margin-bottom: 0.5rem; }
#bsky-connect-modal input { width: 100%; padding: 0.8rem; border-radius: 8px; border: 1px solid var(--border-color); background-color: var(--color-background); color: var(--color-primary); box-sizing: border-box; }
#bsky-connect-modal .form-hint, #bsky-connect-modal .troubleshooting-note { font-size: 0.9rem; color: var(--color-secondary); }
/* AÑADE ESTO AL FINAL DE LIVE.CSS */

/* Estilo para mensajes que se están enviando */
.chat-message.pending {
    opacity: 0.7;
}

/* Transición suave para cuando se confirma */
.chat-message.confirmed {
    transition: opacity 0.5s;
    opacity: 1;
}

/* Estilo para mensajes que fallaron al enviar */
.chat-message.failed {
    opacity: 0.5;
    background-color: rgba(255, 0, 0, 0.1);
    border-left: 3px solid var(--color-accent);
    padding-left: 10px;
}
/* AÑADE ESTO AL FINAL DE LIVE.CSS */

/* Ajustes al formulario del chat para el nuevo botón */
.chat-input-form {
    display: flex;
    align-items: flex-end; /* Alinea los botones con la parte de abajo del textarea */
    gap: 0.5rem;
}

/* Estilo para el botón de Emojis */
.emoji-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background-color: var(--color-surface);
    color: var(--color-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.emoji-btn:hover {
    background-color: var(--color-background);
}

/* Estilos para el Modal de Emojis */
#emoji-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 18, 18, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 6000; /* La capa más alta de todas */
    backdrop-filter: blur(5px);
}

.emoji-modal-content {
    background-color: var(--color-surface);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 360px; /* Tamaño ideal para un selector de emojis */
    display: flex;
    flex-direction: column;
}

.emoji-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.emoji-modal-header h3 {
    margin: 0;
    font-size: 1rem;
}

.emoji-modal-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-secondary);
    cursor: pointer;
}

#emoji-picker-container {
    height: 400px; /* Altura fija para el selector */
}
/* --- AÑADE ESTO AL FINAL DE LIVE.CSS --- */

/* Estilos para la Barra de Emojis Inline */
.emoji-bar {
  display: flex;
  justify-content: space-around;
  padding: 8px;
  background-color: var(--color-background);
  border-radius: 8px;
  margin-bottom: 8px;
}

.emoji-char {
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: transform 0.1s ease, background-color 0.2s;
}

.emoji-char:hover {
  background-color: var(--color-surface);
  transform: scale(1.2);
}
/* --- INICIO: ESTILOS MEJORADOS PARA EL FOOTER --- */

.site-footer {
    padding: 3rem 0;
    background-color: var(--color-background);
    border-top: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    font-size: var(--font-size-small);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap; /* Para que se ajuste bien en pantallas medianas */
    gap: 2rem;
}

.footer-column {
    flex: 1;
    min-width: 250px; /* Ancho mínimo para cada columna */
}

.footer-logo-text {
    font-weight: 600;
    color: var(--color-text-primary);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.footer-heading {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 1rem;
}

.footer-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

.footer-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--color-accent);
}

.footer-link i {
    font-size: 1.2rem;
}

/* Estilos para móvil */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-column {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-badges {
        align-items: center;
    }
}

/* --- FIN: ESTILOS MEJORADOS PARA EL FOOTER --- */
/* --- Estilos para la Barra de Compartir en LiveRoom --- */
.live-room-share-bar {
    background-color: var(--color-surface);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.share-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    color: var(--color-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 1.2rem;
    background-color: transparent;
    cursor: pointer;
}

.share-btn:hover {
    background-color: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}
/* --- AÑADE ESTO AL FINAL DE LIVE.CSS --- */
.chat-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}
.chat-tab {
    padding: 0.75rem 1rem;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--color-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    border-bottom: 3px solid transparent;
}
.chat-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-accent);
}
.chat-panels-container {
    flex-grow: 1;
    min-height: 0;
    position: relative;
}
.chat-tab-panel {
    display: none;
    height: 100%;
    width: 100%;
    position: absolute;
}
.chat-tab-panel.active {
    display: flex; /* Usamos flex para que el contenido se estire */
    flex-direction: column;
}
.chat-tab-panel iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}
.tabbed-chat-container {
    display: flex;
    flex-direction: column;
    min-height: 0; /* Un truco de flexbox para evitar desbordamientos */
}
.youtube-popup-link {
    margin-left: 1rem;
    align-self: center;
    
    /* Estilos para que se vea como un botón de icono */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%; /* Lo hacemos circular */
    background-color: var(--color-surface);
    color: var(--color-secondary);
    border: 1px solid var(--border-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.youtube-popup-link:hover {
    background-color: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}