/* =================================================================
 * ARCHIVO ACTUALIZADO: /inv/css/comunidad.css (Responsive & Gen Z)
 * ================================================================= */

:root {
    --color-background: #f4f7f9;
    --color-surface: #ffffff;
    --color-primary-text: #0f141a;
    --color-secondary-text: #5f6b7a;
    --color-accent: #b72a1e;
    --color-accent-hover: #962218;
    --color-accent-light: #fbeae9;
    --color-border: rgba(0, 0, 0, 0.05);
    --border-radius: 20px;
    --border-radius-sm: 12px;
    --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.08);
    --transition-speed: 0.3s;
}

body.dark-theme {
    --color-background: #121418;
    --color-surface: #1e2126;
    --color-primary-text: #f0f2f5;
    --color-secondary-text: #a0aab5;
    --color-border: rgba(255, 255, 255, 0.05);
    --color-accent-light: rgba(183, 42, 30, 0.15);
    --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; } /* CRÍTICO PARA RESPONSIVE */

.page-container {
    padding: 1.5rem 1rem;
    max-width: 1400px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --- SOLUCIÓN RESPONSIVE MÓVIL Y ESCRITORIO --- */
.community-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
/* Orden en MÓVIL: 1º Feed (Contenido), 2º Perfil, 3º Video/Podcast */
.main-column-feed { order: 1; }
.left-column { order: 2; }
.right-column { order: 3; }

/* Tablet y Escritorio */
@media (min-width: 1024px) {
    .community-layout {
        display: grid;
        grid-template-columns: 300px minmax(0, 1fr) 380px; 
        gap: 2rem;
    }
    /* Restauramos el orden visual para escritorio */
    .left-column { order: 1; }
    .main-column-feed { order: 2; }
    .right-column { order: 3; }
    
    .left-column, .right-column { position: sticky; top: 2rem; align-self: start; max-height: calc(100vh - 4rem); overflow-y: auto; }
    .left-column::-webkit-scrollbar, .right-column::-webkit-scrollbar { display: none; }
}

.bento-box {
    background-color: var(--color-surface);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft);
    transition: box-shadow var(--transition-speed), transform var(--transition-speed);
}
.bento-box:hover { box-shadow: var(--shadow-hover); }

/* --- COLUMNA IZQUIERDA --- */
.user-panel-box { text-align: center; position: relative; overflow: hidden; }
.user-panel-box::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 60px;
    background: linear-gradient(135deg, var(--color-accent) 0%, #d84537 100%); opacity: 0.1;
}
.user-panel-avatar {
    width: 80px; height: 80px; border-radius: 50%; object-fit: cover;
    margin-bottom: 0.8rem; border: 4px solid var(--color-surface);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); position: relative; z-index: 2;
}
.user-panel-box h3 { margin: 0 0 1rem 0; font-size: 1.2rem; color: var(--color-primary-text); font-weight: 700; }

.community-nav { display: flex; flex-direction: column; gap: 0.2rem; }
.community-nav-link {
    display: flex; align-items: center; gap: 1rem; padding: 0.8rem 1rem;
    border-radius: var(--border-radius-sm); text-decoration: none;
    color: var(--color-secondary-text); font-weight: 600; font-size: 1rem;
    transition: all var(--transition-speed) ease;
}
.community-nav-link:hover { background-color: var(--color-background); color: var(--color-primary-text); transform: translateX(5px); }
.community-nav-link.active { background-color: var(--color-accent-light); color: var(--color-accent); }
.community-nav-link i { width: 24px; font-size: 1.1rem; text-align: center; }

/* ==========================================================================
   INTERFAZ CREAR POST (Estilo Nativo Profesional)
   ========================================================================== */
.create-post-box h4 { display: none; } /* Ocultar el h4 que generaba JS viejo */
.create-post-box { padding: 1.5rem 1.5rem 0.5rem 1.5rem !important; }

.clean-post-form .textarea-container { 
    display: flex; 
    gap: 12px; 
    align-items: flex-start;
    width: 100%;
}

.clean-post-form .post-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.clean-post-form .post-input-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Magia: Quitar los bordes del textarea por completo */
.clean-post-form textarea {
    width: 100%;
    min-height: 80px;
    border: none !important;
    background: transparent !important;
    color: var(--color-primary-text) !important;
    font-size: 1.25rem;
    line-height: 1.4;
    font-family: inherit;
    resize: none;
    outline: none !important;
    box-shadow: none !important;
    padding: 8px 0;
}

.clean-post-form textarea::placeholder {
    color: var(--color-secondary-text);
    opacity: 0.6;
}

/* Iconos de acción (Azules estilo Bluesky/Twitter) */
.clean-post-form .create-post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--color-background);
    padding-top: 10px;
    margin-top: 10px;
}

.clean-post-form .action-icons {
    display: flex;
    gap: 4px;
}

.clean-post-form .post-action-icon {
    background: transparent;
    border: none;
    color: #0085ff; /* Color de link estándar profesional */
    font-size: 1.2rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.clean-post-form .post-action-icon:hover:not(.disabled-icon) {
    background: rgba(0, 133, 255, 0.1);
}

.clean-post-form .post-action-icon.disabled-icon {
    color: var(--color-secondary-text);
    opacity: 0.4;
    cursor: not-allowed;
}

/* Botón estilo Píldora redondeada */
.btn-pill {
    border-radius: 9999px !important;
    padding: 8px 20px !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
}

.form-submit-area {
    display: flex;
    align-items: center;
}
.feed-container { display: flex; flex-direction: column; gap: 1.2rem; margin-top: 1.5rem; }
.feed-post { padding: 1.5rem; border: 1px solid transparent; word-wrap: break-word; }
.feed-post:hover { transform: translateY(-2px); border: 1px solid var(--color-border); }
.feed-post .post-header { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1rem; }
.post-avatar { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; }
.post-author-info strong { font-size: 1rem; color: var(--color-primary-text); }
.post-handle { font-size: 0.85rem; color: var(--color-secondary-text); margin-top: 2px; display: block;}
.post-body p { margin: 0; line-height: 1.6; font-size: 1rem; color: var(--color-primary-text); }
.post-embed-image { margin-top: 1rem; }
.post-embed-image img { max-width: 100%; border-radius: var(--border-radius-sm); border: 1px solid var(--color-border); }
.post-footer {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 1.2rem; padding-top: 0.8rem; border-top: 1px solid var(--color-background);
}
.post-date { font-size: 0.8rem; color: var(--color-secondary-text); }
.post-actions { display: flex; gap: 1rem; }
/* FIX: Botones de acción del post (Like, Reply, Share) */
.post-action-btn {
    background: var(--color-background); 
    border: none; 
    color: var(--color-secondary-text); 
    cursor: pointer;
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
    font-size: 0.9rem; 
    padding: 0.4rem 0.8rem;
    border-radius: 20px; 
    transition: all 0.2s ease; 
    font-weight: 600;
    outline: none; /* Elimina el cuadro azul/negro al hacer clic en PC */
    -webkit-tap-highlight-color: transparent; /* Elimina el cuadro gris al tocar en celular */
}

.post-action-btn:focus, .post-action-btn:active {
    outline: none;
}

.post-action-btn:hover { 
    color: var(--color-accent); 
    background-color: var(--color-accent-light); 
    transform: scale(1.05); 
}

.post-action-btn.is-liked { 
    color: #e0245e; /* El corazón y el número se vuelven rojos */
    background-color: rgba(224, 36, 94, 0.1); /* Fondo rosado transparente y elegante */
}

/* --- COLUMNA DERECHA (Nuevos Elementos) --- */
.suggestions-box h4, .promo-box h4 {
    margin: 0 0 1rem 0; font-size: 1.05rem; color: var(--color-primary-text);
    display: flex; align-items: center; gap: 8px; font-weight: 700;
}
.members-list { list-style: none; padding: 0; margin: 0; }
.members-list li { padding: 0.8rem 0; border-bottom: 1px solid var(--color-background); color: var(--color-secondary-text); font-size: 0.9rem; }

/* Estilos Promo Box (Substack / YouTube) */
.promo-box p { font-size: 0.9rem; color: var(--color-secondary-text); margin-bottom: 1rem; line-height: 1.4; }
.w-100 { width: 100%; text-align: center; display: block; }
.mt-2 { margin-top: 0.8rem; }

.substack-box {
    background: linear-gradient(145deg, var(--color-surface), var(--color-accent-light));
    border-color: rgba(183, 42, 30, 0.1);
}
.youtube-box {
    background: linear-gradient(145deg, var(--color-surface), rgba(255,0,0,0.05));
}
.youtube-box h4 i { color: #FF0000; }

/* Placeholder EN VIVO (YouTube/Live) */
.live-placeholder {
    position: relative; margin-bottom: 1rem; border-radius: var(--border-radius-sm); overflow: hidden;
}
.live-thumbnail { width: 100%; aspect-ratio: 16/9; object-fit: cover; opacity: 0.8; }
.live-badge {
    position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,0.8); color: white;
    font-size: 0.75rem; font-weight: bold; padding: 4px 8px; border-radius: 4px;
    display: flex; align-items: center; gap: 6px; text-decoration: none; z-index: 2;
}
.pulse-dot {
    width: 8px; height: 8px; background-color: #ff3b30; border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7); animation: pulse-red 1.5s infinite;
}
@keyframes pulse-red {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(255, 59, 48, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

/* Eventos */
.event-list { list-style: none; padding: 0; margin: 0 0 1rem 0; }
.event-list li { font-size: 0.9rem; padding: 0.6rem 0; border-bottom: 1px solid var(--color-background); display: flex; flex-direction: column; }
.event-list li strong { color: var(--color-accent); font-size: 0.8rem; margin-bottom: 2px;}
.past-event { opacity: 0.6; }

/* Botones y Globales */
.btn-primary {
    background-color: var(--color-accent); color: white; border-radius: 30px; font-weight: 600; padding: 0.6rem 1.2rem;
    box-shadow: 0 4px 15px rgba(183, 42, 30, 0.3); border: none; cursor: pointer; text-decoration: none; transition: all 0.2s;
}
.btn-primary:hover { background-color: var(--color-accent-hover); transform: translateY(-2px); }
.btn-secondary {
    background-color: transparent; border: 1px solid var(--color-secondary-text); color: var(--color-primary-text);
    border-radius: 30px; padding: 0.6rem 1.2rem; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.btn-secondary:hover { background-color: var(--color-background); }

.fab {
    position: fixed; bottom: 2rem; right: 2rem; width: 56px; height: 56px; border-radius: 50%;
    background-color: var(--color-accent); color: white; border: none; font-size: 1.5rem;
    display: flex; justify-content: center; align-items: center; box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    cursor: pointer; z-index: 1000; transition: transform 0.2s ease;
}
.fab:hover { transform: scale(1.1); }
.link-preview-card { border-radius: var(--border-radius-sm); border: 1px solid var(--color-border); background: var(--color-background); text-decoration: none; color: inherit; display: block; overflow: hidden; margin-top: 1rem;}
.link-preview-image { 
    width: 100% !important; 
    height: auto !important; /* Liberamos el alto fijo */
    aspect-ratio: 1.91 / 1; /* Estándar de proporción de tarjetas web */
    object-fit: cover !important; 
    border-bottom: 1px solid var(--color-border); 
    display: block;
}

/* --- REPRODUCTOR 24/7 (Columna Izquierda) --- */
.live-247-box {
    position: relative;
    border: 1px solid rgba(239, 68, 68, 0.3) !important; /* Borde sutil rojo */
    box-shadow: 0 8px 30px rgba(239, 68, 68, 0.08) !important; /* Resplandor rojo en dark mode */
}

.live-badge-247 {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
    pointer-events: none; /* Para que los clics pasen al video */
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.1);
}

/* --- CONTROL REMOTO DEL REPRODUCTOR 24/7 --- */
.channel-switcher {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--color-surface);
    justify-content: center;
    align-items: center;
    border-top: 1px solid var(--color-border);
}

.channel-btn {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-secondary-text);
    border-radius: 50%; /* Botones circulares elegantes */
    width: 38px;
    height: 38px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
}

.channel-btn:hover {
    transform: scale(1.1);
    color: var(--color-primary-text);
    border-color: var(--color-secondary-text);
}

/* Estilo del botón cuando ese canal está activo */
.channel-btn.active {
    background: var(--color-accent-light);
    color: var(--color-accent);
    border-color: var(--color-accent);
    box-shadow: 0 0 10px rgba(183, 42, 30, 0.2);
}

/* Color específico para Spotify al hacer hover */
.channel-btn[data-src*="spotify"]:hover, .channel-btn[data-src*="spotify"].active {
    background: rgba(30, 215, 96, 0.1);
    color: #1ed760;
    border-color: #1ed760;
    box-shadow: 0 0 10px rgba(30, 215, 96, 0.2);
}

/* --- REPRODUCTOR PERSISTENTE --- */
.persistent-audio-player {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(10px);
    border-top: 1px solid var(--color-border); z-index: 9999;
    padding: 10px 20px; box-shadow: 0 -5px 25px rgba(0,0,0,0.5);
    animation: slideUp 0.3s ease; color: white;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* --- DISEÑO CORREGIDO DEL REPRODUCTOR --- */
.player-content { display: flex; align-items: center; justify-content: space-between; max-width: 1400px; margin: 0 auto; gap: 15px; }

/* FIX SUPERPOSICIÓN: min-width: 0 obliga al texto a cortarse con "..." sin aplastar botones */
.track-info { display: flex; align-items: center; gap: 12px; width: 280px; flex-shrink: 0; min-width: 0; }
.track-info img { width: 50px; height: 50px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.track-text { min-width: 0; flex-grow: 1; }
#player-track-title { margin: 0 0 4px 0; font-size: 0.9rem; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#player-track-author { margin: 0; font-size: 0.75rem; color: var(--color-secondary-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.player-controls { display: flex; align-items: center; gap: 15px; flex-shrink: 0; }
.player-controls button { background: none; border: none; color: white; font-size: 1.2rem; cursor: pointer; transition: 0.2s; }
.player-controls button:hover { color: var(--color-accent); transform: scale(1.1); }
#player-play-btn { width: 45px; height: 45px; background: white; color: black; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
#player-play-btn:hover { background: var(--color-accent); color: white; }

.player-timeline { display: flex; align-items: center; gap: 10px; flex-grow: 1; max-width: 500px; min-width: 150px; }
.player-timeline span { font-size: 0.8rem; color: var(--color-secondary-text); min-width: 40px; text-align: center; }
.player-timeline input[type="range"] { flex-grow: 1; accent-color: var(--color-accent); cursor: pointer; }

.player-volume { display: flex; align-items: center; gap: 10px; width: 150px; flex-shrink: 0;}
.player-volume input[type="range"] { width: 80px; accent-color: var(--color-accent); cursor: pointer; }
#player-close-btn { background: none; border: none; color: var(--color-secondary-text); font-size: 1.5rem; cursor: pointer; flex-shrink: 0;}
#player-close-btn:hover { color: #ef4444; }

/* --- DISEÑO DE LA LISTA FLOTANTE --- */
.podcast-playlist-panel {
    position: absolute; bottom: 100%; left: 20px; width: 320px; max-height: 400px;
    background: rgba(15, 23, 42, 0.98); border: 1px solid var(--color-border);
    border-bottom: none; border-radius: 12px 12px 0 0; display: flex; flex-direction: column;
    box-shadow: 0 -10px 25px rgba(0,0,0,0.5); z-index: 10;
}
.playlist-header { display: flex; justify-content: space-between; align-items: center; padding: 15px; border-bottom: 1px solid var(--color-border); }
.playlist-header h4 { margin: 0; font-size: 0.95rem; color: white; }
#close-playlist-btn { background: none; border: none; color: var(--color-secondary-text); font-size: 1.2rem; cursor: pointer; }
#close-playlist-btn:hover { color: white; }
#podcast-playlist-list { list-style: none; padding: 0; margin: 0; overflow-y: auto; flex-grow: 1; }
.playlist-item { padding: 12px 15px; border-bottom: 1px solid rgba(255,255,255,0.05); cursor: pointer; display: flex; gap: 10px; align-items: center; transition: 0.2s; }
.playlist-item:hover { background: rgba(255,255,255,0.05); }
.playlist-item.active { background: rgba(183, 42, 30, 0.1); border-left: 3px solid var(--color-accent); }
.playlist-item-img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }
.playlist-item-info { min-width: 0; }
.playlist-item-title { margin: 0; font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: white; }
.playlist-item-date { margin: 3px 0 0; font-size: 0.7rem; color: var(--color-secondary-text); }

/* --- FIX: Contenedor de Vista Previa de Imagen en el Asistente --- */
#image-preview-container {
    position: relative;
    margin-top: 10px;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
}

#image-preview-container img {
    width: 100%;
    max-height: 300px;
    object-fit: cover; /* Recorta la imagen sin deformarla */
    display: block;
    border-radius: 12px;
    border: 1px solid var(--color-border);
}

/* El botón de eliminar la imagen sobre la previa */
#image-preview-container button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.2s;
}
#image-preview-container button:hover {
    background: var(--color-accent);
    transform: scale(1.1);
}
/* Forzar contención de imagen en el modal y feed para NO CORTAR verticales */
#image-preview-container img, 
.post-embed-image img {
    max-width: 100% !important;
    max-height: 500px !important; /* Más alto para acomodar verticales */
    object-fit: contain !important; /* CRÍTICO: Ajusta la imagen completa, no la recorta */
    background-color: var(--color-background); /* Rellena el espacio sobrante con el color de fondo */
    display: block;
    margin: 10px auto 0 auto;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    transition: transform 0.2s ease;
}

/* Efecto visual de "Clickeable" solo en el feed */
.post-embed-image img:hover {
    transform: scale(1.02);
    cursor: zoom-in;
}

/* Evitar que el modal crezca más que la pantalla */
.modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

/* ==========================================
   HISTORIAS / INVESTIGADORES DESTACADOS
   ========================================== */
.stories-container {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Oculta scrollbar en Firefox */
}
.stories-container::-webkit-scrollbar { display: none; } /* Oculta scrollbar en Chrome/Safari */

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    min-width: 68px;
    max-width: 76px;
}

/* El anillo por defecto (Gris/Neutro) */
.story-avatar-container {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--color-border); /* Anillo neutro cuando no están en vivo */
    padding: 3px; 
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease;
}

/* El anillo brillante SOLO cuando están EN VIVO */
.story-item.is-live .story-avatar-container {
    background: linear-gradient(45deg, #ef4444, #b72a1e);
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.story-item:hover .story-avatar-container {
    transform: scale(1.08); /* Crece al pasar el ratón */
}

/* La imagen dentro del anillo */
.story-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--color-surface); /* Aro invisible para separar foto del degradado */
    object-fit: cover;
}

.story-username {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary-text);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}
/* ==========================================================================
   AJUSTES MÓVILES PARA LA COMUNIDAD (PWA)
   ========================================================================== */
@media (max-width: 768px) {
    .fab {
        bottom: 100px !important; /* Lo subimos para que respete los 65px del menú móvil */
        right: 1.2rem !important;
        width: 50px !important; /* Un poquito más pequeño para no estorbar la lectura */
        height: 50px !important;
        font-size: 1.2rem !important;
    }
    
    /* Le damos espacio extra al final del feed para que el menú no tape el último post */
    .main-column-feed {
        padding-bottom: 70px;
    }
}
/* ==========================================================================
   TABS MÓVILES (Estilo App Nativa)
   ========================================================================== */
.community-mobile-tabs { display: none; }

@media (max-width: 1024px) {
    .community-mobile-tabs {
        display: flex;
        background: rgba(255, 255, 255, 0.85) !important;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        position: sticky;
        top: 0px; /* Se pega justo debajo del header */
        padding-top: env(safe-area-inset-top, 0px);
        z-index: 900;
        border-bottom: 1px solid var(--color-border);
        margin: -1.5rem -1rem 1.5rem -1rem; /* Compensa el padding general */
    }
    body.dark-theme .community-mobile-tabs {
        background: rgba(18, 20, 24, 0.85) !important;
    }
    .community-tab-btn {
        flex: 1;
        padding: 14px 0;
        background: transparent;
        border: none;
        border-bottom: 3px solid transparent;
        color: var(--color-secondary-text);
        font-weight: 700;
        font-size: 0.95rem;
        cursor: pointer;
        transition: color 0.2s;
    }
    .community-tab-btn.active {
        color: var(--color-accent);
        border-bottom-color: var(--color-accent);
    }
    
    /* Magia: Ocultar columnas que no están activas en móvil */
    .community-layout > main, .community-layout > aside {
        display: none;
    }
    .community-layout > .is-active-tab {
        display: flex;
        flex-direction: column;
        animation: fadeIn 0.3s ease;
    }
}
/* ==========================================================================
   FIX: REPRODUCTOR DE PODCAST EN MÓVIL WEB Y PWA
   ========================================================================== */
@media (max-width: 768px) {
    /* 1. Elevar el reproductor sobre la barra de navegación móvil (aprox 65px) */
    .persistent-audio-player {
        bottom: calc(65px + env(safe-area-inset-bottom, 0px)) !important;
        padding: 12px 15px !important;
        border-radius: 16px 16px 0 0 !important; /* Parecerá una tarjeta que emerge */
        border-bottom: 1px solid var(--color-border);
    }

    /* 2. Romper la fila única y permitir que los elementos bajen (Wrap) */
    .player-content {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
    }

    /* --- FILA 1: Carátula, Títulos y Botón Cerrar --- */
    .track-info {
        width: calc(100% - 40px) !important; /* Deja espacio para la X */
        max-width: none !important;
        margin-bottom: 5px;
    }
    .track-info img {
        width: 45px !important; 
        height: 45px !important;
    }
    #player-close-btn {
        position: absolute;
        top: 15px;
        right: 15px;
    }

    /* --- FILA 2: Línea de tiempo (Ocupa el 100% del ancho) --- */
    .player-timeline {
        width: 100% !important;
        max-width: none !important;
        order: 2; /* Obligamos a que baje a la segunda posición */
        margin-top: 5px;
    }

    /* --- FILA 3: Controles centrados y grandes --- */
    .player-controls {
        width: 100% !important;
        justify-content: center !important;
        gap: 30px !important; /* Más separación para no equivocarse al tocar */
        order: 3; /* Obligamos a que baje a la última posición */
        margin-top: 5px;
    }

    /* Ocultamos el control de volumen (en móvil se usan los botones físicos del celular) */
    .player-volume {
        display: none !important;
    }

    /* Ajuste para que la lista de episodios emergente no se salga de los bordes del celular */
    .podcast-playlist-panel {
        width: calc(100vw - 30px) !important;
        left: 15px !important;
        bottom: calc(100% + 5px) !important;
        max-height: 50vh !important;
    }

    /* --- BOTÓN DE MINIMIZAR --- */
    #player-minimize-btn {
        display: block; /* Lo mostramos en móvil */
        position: absolute;
        top: -12px; /* Flotando en el borde superior */
        left: 50%;
        transform: translateX(-50%);
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        color: var(--color-secondary-text);
        width: 36px;
        height: 24px;
        border-radius: 12px 12px 0 0;
        cursor: pointer;
        display: flex;
        justify-content: center;
        align-items: center;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    }

    /* Transición suave para todo el reproductor */
    .persistent-audio-player {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    /* ==========================================================================
       ESTADO MINIMIZADO (Cuando se activa por JS)
       ========================================================================== */
    .persistent-audio-player.is-minimized {
        padding: 8px 15px !important;
    }
    
    /* Cambiamos la flecha hacia arriba */
    .persistent-audio-player.is-minimized #player-minimize-btn i {
        transform: rotate(180deg);
    }
    
    /* Ocultamos lo que no es necesario (Línea de tiempo, adelante/atrás, playlist) */
    .persistent-audio-player.is-minimized .player-timeline,
    .persistent-audio-player.is-minimized #player-rewind-btn,
    .persistent-audio-player.is-minimized #player-forward-btn,
    .persistent-audio-player.is-minimized #player-playlist-btn {
        display: none !important;
    }
    
    /* Forzamos a que vuelva a ser una sola fila (como en escritorio) */
    .persistent-audio-player.is-minimized .player-content {
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
    }
    
    /* Achicamos la foto, el texto y forzamos el corte con puntos suspensivos */
    .persistent-audio-player.is-minimized .track-info {
        flex: 1 1 0% !important; /* Absorbe el espacio disponible pero permite encogerse */
        min-width: 0 !important; /* CRÍTICO: Obliga a Flexbox a respetar el límite de la pantalla */
        margin-bottom: 0 !important;
        overflow: hidden !important;
    }
    .persistent-audio-player.is-minimized .track-info img {
        width: 35px !important; 
        height: 35px !important;
    }
    
    /* Reacomodamos el botón de Play y la X de cerrar en la misma fila */
    .persistent-audio-player.is-minimized .player-controls {
        width: auto !important; 
        order: 2 !important; 
        margin-top: 0 !important; 
        gap: 10px !important;
    }
    .persistent-audio-player.is-minimized #player-play-btn {
        width: 35px !important; 
        height: 35px !important; 
        font-size: 0.9rem !important;
    }
    .persistent-audio-player.is-minimized #player-close-btn {
        position: static !important; /* Lo sacamos de la esquina superior */
        order: 3 !important; 
        margin-left: 5px !important;
    }
}
/* --- OPTIMIZACIÓN CABECERA EN COMUNIDAD --- */

/* Forzamos que el botón Acceder mantenga su estilo sólido de YouTube */
.btn-nav-access {
    background-color: var(--color-accent);
    color: white !important;
    padding: 8px 18px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    border: 1px solid var(--color-accent);
    cursor: pointer;
    transition: 0.3s;
}
.btn-nav-access:hover {
    background-color: transparent;
    color: var(--color-accent) !important;
}

/* Estados del Botón Crear */
.create-locked { opacity: 0.5; cursor: help !important; }
.create-unlocked { color: var(--color-accent) !important; }

/* --- TOAST ARRIBA Y VISIBLE --- */
#global-toast {
    position: fixed; 
    top: 25px; 
    left: 50%; 
    transform: translateX(-50%);
    background: #1e293b; 
    color: white; 
    padding: 14px 28px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4); 
    z-index: 10000; 
    font-size: 0.95rem;
    font-weight: 500;
    border-bottom: 3px solid var(--color-accent);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
}
.toast-hidden { opacity: 0; visibility: hidden; top: -10px !important; }

/* --- BOTÓN DE CERRAR MODAL (LA 'X') --- */
.modal-close-btn {
    position: absolute; 
    top: 15px; 
    right: 15px; 
    width: 40px; 
    height: 40px; 
    background: rgba(0,0,0,0.05); 
    color: var(--color-secondary-text); 
    border-radius: 50%; 
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: 0.2s;
    z-index: 100;
}
.modal-close-btn:hover {
    background: var(--color-accent-light);
    color: var(--color-accent);
    transform: rotate(90deg);
}

/* Ajuste para que el avatar no se vea gigante */
.nav-icon-avatar img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    object-fit: cover;
}
/* ==========================================================================
   FIX: MENÚ CENTRAL AMONTONADO
   ========================================================================== */

/* 1. Obligamos al contenedor a separar los botones */
.desktop-nav .main-menu {
    gap: 8px !important; 
}

/* 2. Liberamos el ancho de los botones con texto para que no se aplasten */
.desktop-nav .main-menu .nav-icon,
#create-dropdown-container .nav-icon {
    width: auto !important; /* Libera cualquier tamaño cuadrado forzado */
    min-width: max-content !important; /* Obliga al fondo rojo/gris a abrazar todo el texto */
    padding: 0 16px !important; /* Devuelve el aire a los lados del texto */
    white-space: nowrap !important; /* Evita que el texto intente bajar a otra línea */
}

/* 3. Aseguramos que el texto sea visible */
.desktop-nav .main-menu .nav-text {
    display: inline-block !important;
}

/* 4. Opcional: Si en laptops pequeñas (menos de 1100px) no cabe todo el texto, 
      lo ocultamos elegantemente y devolvemos los botones a modo cuadrado */
@media (max-width: 1100px) {
    .desktop-nav .main-menu .nav-text {
        display: none !important;
    }
    .desktop-nav .main-menu .nav-icon {
        width: 44px !important;
        min-width: 44px !important;
        padding: 0 !important;
    }
}
/* ==========================================================================
   FIX: GAMIFICACIÓN EN PANEL LATERAL (Comunidad)
   ========================================================================== */

.profile-badges-container {
    display: flex; gap: 8px; justify-content: center; margin: 10px 0; flex-wrap: wrap;
}

.badge-icon {
    width: 32px; height: 32px; border-radius: 50%; background: var(--color-background);
    border: 1px solid var(--color-border); display: flex; align-items: center; justify-content: center;
    color: var(--color-secondary-text); font-size: 1rem; filter: grayscale(100%); opacity: 0.4;
    transition: all 0.3s ease;
}

/* Luces encendidas */
.badge-icon.active-citizen { color: #10b981; filter: grayscale(0%); opacity: 1; background: #d1fae5; border-color: #10b981; transform: scale(1.05); }
.badge-icon.active-social { color: #0085ff; filter: grayscale(0%); opacity: 1; background: #e0f2fe; border-color: #0085ff; transform: scale(1.05); }
.badge-icon.active-academic { color: #a6ce39; filter: grayscale(0%); opacity: 1; background: #f4fce3; border-color: #a6ce39; transform: scale(1.05); }
.badge-icon.active-founder { color: #f59e0b; background: #fef3c7; border-color: #f59e0b; filter: grayscale(0%); opacity: 1; transform: scale(1.05); }
.badge-icon.active-divulgador { color: #8b5cf6; background: #ede9fe; border-color: #8b5cf6; filter: grayscale(0%); opacity: 1; transform: scale(1.05); }
.badge-icon.active-member { color: #ec4899; background: #fce7f3; border-color: #ec4899; filter: grayscale(0%); opacity: 1; transform: scale(1.05); }

/* Check PRO */
.verified-check {
    color: var(--color-accent); font-size: 0.85em; margin-left: 6px; vertical-align: middle;
    filter: drop-shadow(0 2px 4px rgba(183, 42, 30, 0.3));
}
/* --- ESTILOS PARA SLOGAN Y BIO EN PANEL LATERAL --- */
.user-panel-slogan {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-primary-text);
    margin: 0.5rem 0;
    font-style: italic;
    opacity: 0.7;
    line-height: 1.2;
}

.user-panel-bio {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--color-secondary-text);
    margin-bottom: 1rem;
    padding: 0 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Cortamos a 3 líneas para que no se haga infinito */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================
   BOTÓN FLOTANTE CENTRAL (GoLive Mobile)
   ========================================== */
.mobile-golive-fab {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1.4; 
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    /* CLAVE 1: Fijamos una altura para que no estire el menú */
    height: 60px; 
}

.mobile-golive-fab .fab-inner {
    /* CLAVE 2: Lo hacemos absoluto para que 'flote' fuera de la barra sin empujarla */
    position: absolute; 
    bottom: 15px; /* Qué tanto sobresale hacia arriba (Ajústalo a tu gusto) */
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #ef4444, #b72a1e);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
    border: 4px solid var(--color-surface); 
    transition: transform 0.2s ease, box-shadow 0.2s ease, bottom 0.2s ease;
}

.mobile-golive-fab:active .fab-inner {
    bottom: 12px; /* Efecto al presionar */
    transform: scale(0.95);
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
}

@keyframes fab-pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.mobile-golive-fab .fab-inner {
    animation: fab-pulse 3s infinite;
}

/* ==========================================
   SPEED DIAL FAB (Menú Flotante Desplegable)
   ========================================== */
.fab-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
}

.fab-main {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--color-accent);
    color: white;
    border: none;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(183, 42, 30, 0.4);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.2s;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
}

/* Al abrir, el (+) rota para convertirse en una (X) */
.fab-container.is-open .fab-main {
    transform: rotate(135deg);
    background-color: var(--color-surface);
    color: var(--color-accent);
    border: 2px solid var(--color-accent);
}

.fab-action {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    transform: translateY(20px) scale(0.5);
    pointer-events: none; /* Inactivo cuando está oculto */
    position: absolute;
}

.fab-action.fab-post {
    background-color: var(--color-surface);
    color: var(--color-primary-text);
    bottom: 0;
}

.fab-action.fab-golive {
    background: linear-gradient(135deg, #ef4444, #b72a1e);
    color: white;
    bottom: 0;
}

/* Animación de apertura */
.fab-container.is-open .fab-action {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Posiciones finales de los botones flotantes */
.fab-container.is-open .fab-action.fab-post { bottom: 70px; }
.fab-container.is-open .fab-action.fab-golive { bottom: 130px; }

/* Ajustes exactos para Móvil (PWA) */
@media (max-width: 768px) {
    .fab-container {
        bottom: 85px !important; /* Elevado sobre la barra de navegación */
        right: 1.2rem !important;
    }
    .fab-main { width: 50px; height: 50px; font-size: 1.2rem; }
    .fab-action { width: 42px; height: 42px; font-size: 1.1rem; }
    .fab-container.is-open .fab-action.fab-post { bottom: 65px; }
    .fab-container.is-open .fab-action.fab-golive { bottom: 120px; }
}

/* ==========================================
   ESTUDIO EXPRESS GOLIVE V2
   ========================================== */
#golive-fullscreen-studio {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: #000; z-index: 99999;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
}
#golive-fullscreen-studio.hidden { display: none !important; }

/* Capa Multimedia */
.media-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }
#golive-local-video { width: 100%; height: 100%; object-fit: cover; }
#golive-local-video.hidden { display: none; }

/* Modo Solo-Audio */
#golive-audio-mode {
    width: 100%; height: 100%; display: flex; flex-direction: column; 
    justify-content: center; align-items: center; background: radial-gradient(circle, #1e293b 0%, #000000 100%);
}
#golive-audio-mode.hidden { display: none; }
#golive-audio-avatar { width: 150px; height: 150px; border-radius: 50%; border: 4px solid var(--color-accent); box-shadow: 0 0 30px rgba(183, 42, 30, 0.5); z-index: 2; margin-bottom: 20px;}
#golive-visualizer { width: 100%; height: 200px; position: absolute; bottom: 150px; z-index: 1; opacity: 0.8;}

/* Fase 1: Panel de Setup */
#golive-setup-panel {
    position: relative; z-index: 20; background: var(--color-surface); width: 90%; max-width: 400px;
    border-radius: 16px; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    display: flex; flex-direction: column;
}
#golive-setup-panel.hidden { display: none; }
.setup-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; background: rgba(0,0,0,0.2); }
.setup-header h3 { margin: 0; font-size: 1.1rem; }
.setup-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.device-select { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--color-border); background: var(--color-background); color: var(--color-primary-text); margin-bottom: 10px; }
.setup-footer { padding: 15px 20px; border-top: 1px solid var(--color-border); }

/* Fase 2: Interfaz en Vivo */
#golive-live-ui { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
#golive-live-ui.hidden { display: none; }
#golive-live-ui > * { pointer-events: auto; } /* Reactivar clics en los hijos */

.studio-gradient { position: absolute; left: 0; width: 100%; height: 150px; z-index: 1; pointer-events: none; }
.studio-gradient.top { top: 0; background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, transparent 100%); }
.studio-gradient.bottom { bottom: 0; background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%); }

.studio-header-ui { position: relative; z-index: 10; display: flex; justify-content: space-between; padding: 20px; align-items: center; }
.live-indicator { background: #ef4444; color: white; padding: 6px 12px; border-radius: 20px; font-weight: bold; font-size: 0.85rem; display: flex; align-items: center; gap: 8px; }
.live-indicator .dot { width: 8px; height: 8px; background: white; border-radius: 50%; animation: blink 1s infinite; }

/* Controles Inferiores (Arreglados para móvil) */
.studio-controls-ui { position: relative; z-index: 10; padding: 20px 0 40px 0; width: 100%; display: flex; justify-content: center;}
.controls-wrapper { display: flex; align-items: center; justify-content: space-evenly; width: 100%; max-width: 400px; gap: 20px; }

.icon-btn { background: transparent; border: none; color: white; font-size: 1.5rem; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; cursor: pointer; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.icon-btn.glass { background: rgba(255,255,255,0.2); border-radius: 50%; backdrop-filter: blur(10px); width: 50px; height: 50px; }

.btn-transmitir { width: 70px; height: 70px; border-radius: 50%; background: transparent; border: 4px solid rgba(255,255,255,0.5); display: flex; justify-content: center; align-items: center; cursor: pointer; padding: 0; transition: 0.3s; flex-shrink: 0; }
.btn-transmitir .inner-circle { width: 54px; height: 54px; background: #ef4444; border-radius: 12px; transition: 0.3s; transform: scale(0.6); }

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ==========================================
   SISTEMA DE CHAT GOLIVE (ESPECTADOR Y BROADCASTER)
   Arquitectura Inmersiva y Transparente
   ========================================== */

/* 1. VISOR DEL ESPECTADOR (PANTALLA COMPLETA) */
.live-agora-fullscreen {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh;
    background: #000; z-index: 99999; display: flex; flex-direction: column;
}

.video-background-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;
}

.video-background-layer iframe {
    width: 100%; height: 100%; border: none; pointer-events: auto;
}

.video-overlay-info {
    position: absolute; top: 15px; left: 15px; z-index: 10; display: flex; align-items: center; gap: 10px; pointer-events: none;
}

.badge-live {
    background: #ef4444; color: white; padding: 4px 8px; border-radius: 6px; font-weight: bold; font-size: 0.8rem; display: flex; align-items: center; gap: 6px; box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
}
.badge-live .dot { width: 6px; height: 6px; background: white; border-radius: 50%; animation: blink 1s infinite; }
.user-handle { color: white; font-weight: bold; text-shadow: 0 2px 4px rgba(0,0,0,0.9); }

/* Capa del Chat Inferior Transparente */
.chat-overlay-layer {
    position: relative; z-index: 10; margin-top: auto; 
    height: 45dvh; /* Toma el 45% inferior de la pantalla */
    display: flex; flex-direction: column; justify-content: flex-end;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.5) 60%, transparent 100%);
    pointer-events: none; /* Permite clics en el video */
}

.chat-scroll-area {
    overflow-y: auto; padding: 15px; display: flex; flex-direction: column; gap: 12px;
    pointer-events: auto; /* Reactiva interacción para scrollear */
    mask-image: linear-gradient(to top, black 80%, transparent 100%);
    -webkit-mask-image: linear-gradient(to top, black 80%, transparent 100%);
}
.chat-scroll-area::-webkit-scrollbar { display: none; }

.chat-controls-area {
    padding: 15px; padding-bottom: max(15px, env(safe-area-inset-bottom));
    pointer-events: auto; 
}

/* Input y Botones */
.chat-input-wrapper {
    display: flex; gap: 10px; background: rgba(0,0,0,0.6); backdrop-filter: blur(10px);
    padding: 6px; border-radius: 30px; border: 1px solid rgba(255,255,255,0.2);
}
.chat-input-wrapper input {
    flex-grow: 1; background: transparent; border: none; color: white; padding: 10px 15px; outline: none; font-size: 0.95rem;
}
.chat-input-wrapper input::placeholder { color: rgba(255,255,255,0.7); }
.chat-input-wrapper button {
    background: var(--color-accent); color: white; border: none; width: 42px; height: 42px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.chat-login-prompt {
    text-align: center; background: rgba(0,0,0,0.6); backdrop-filter: blur(10px);
    padding: 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.2); pointer-events: auto;
}
.chat-login-prompt p { margin: 0 0 8px 0; color: white; font-size: 0.85rem; }

/* Estilo de los Mensajes */
.golive-chat-msg-row { display: flex; gap: 10px; animation: fadeIn 0.3s ease; }
.golive-chat-msg-row img { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; border: 2px solid rgba(255,255,255,0.1); }
.golive-chat-msg-name { font-weight: 700; font-size: 0.85rem; text-shadow: 0 1px 3px rgba(0,0,0,0.9); }
.golive-chat-msg-text { margin: 2px 0 0 0; font-size: 0.95rem; color: rgba(255,255,255,0.95); line-height: 1.3; word-break: break-word; text-shadow: 0 1px 3px rgba(0,0,0,0.9); }


/* 2. CHAT DEL BROADCASTER (EL QUE EMITE) */
#studio-chat-overlay {
    position: absolute; bottom: 120px; left: 10px; right: 10px; height: 35dvh; 
    display: flex; flex-direction: column; z-index: 15; pointer-events: auto;
}
#studio-chat-overlay.hidden { display: none !important; }
#studio-chat-messages {
    flex-grow: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-bottom: 10px;
    mask-image: linear-gradient(to top, black 70%, transparent 100%);
    -webkit-mask-image: linear-gradient(to top, black 70%, transparent 100%);
}
#studio-chat-messages::-webkit-scrollbar { display: none; }

.studio-chat-msg { 
    background: rgba(0,0,0,0.6); padding: 8px 14px; border-radius: 16px; width: fit-content; max-width: 85%; color: white; font-size: 0.9rem; backdrop-filter: blur(8px); animation: fadeIn 0.3s ease; border: 1px solid rgba(255,255,255,0.1);
}
.studio-chat-msg strong { color: #38bdf8; font-weight: 700; margin-right: 5px; } 

.studio-chat-input-area { display: flex; gap: 8px; margin-top: 5px; }
#studio-chat-input { 
    flex-grow: 1; border-radius: 25px; padding: 12px 18px; border: 1px solid rgba(255,255,255,0.3); background: rgba(0,0,0,0.7); color: white; font-size: 0.95rem;
}
#btn-send-studio-chat { 
    background: var(--color-accent); color: white; border: none; border-radius: 50%; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* Animación de inactividad para el Estudio del Emisor */
#studio-chat-overlay, .studio-controls-ui {
    transition: opacity 0.5s ease;
}

/* ==========================================
   ANIMACIONES DE REACCIONES (BROADCAST)
   ========================================== */
.floating-reaction {
    position: absolute;
    bottom: 80px;
    right: 20px;
    font-size: 2rem;
    pointer-events: none; /* No interfiere con clics */
    z-index: 9999;
    animation: floatUp 2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

@keyframes floatUp {
    0% { transform: translateY(0) scale(0.5); opacity: 0; }
    20% { transform: translateY(-20px) scale(1.2); opacity: 1; }
    100% { transform: translateY(-150px) scale(1); opacity: 0; }
}

/* Estilo para el botón de reaccionar */
.btn-reaction {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 1.2rem; transition: 0.2s;
    backdrop-filter: blur(5px);
}
.btn-reaction:active { transform: scale(0.8); }

/* ==========================================================================
   SUB-TABS DE ÁGORAS (FILTROS DE FEED)
   ========================================================================== */
.community-feed-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0 15px 0;
    margin-bottom: 5px;
    scrollbar-width: none;
    position: sticky;
    top: 92px; /* En escritorio se pega debajo del menú principal */
    background: var(--color-background);
    z-index: 90;
}

.community-feed-tabs::-webkit-scrollbar { 
    display: none; 
}

.feed-agora-tab {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-primary-text);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.9rem;
    transition: 0.2s;
}

.feed-agora-tab.active {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

/* --- LA MAGIA PARA MÓVILES --- */
@media (max-width: 1024px) {
    .community-feed-tabs {
        top: 90px; /* Altura exacta de tus tabs móviles principales para cerrar el hueco */
        
        /* Efecto cristal para fusionarse visualmente con el menú de arriba */
        background: rgba(240, 242, 245, 0.8); 
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        
        /* Estiramos la barra a los bordes de la pantalla del celular */
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
        padding-top: 12px;
        padding-bottom: 12px;
        
        /* Línea divisoria elegante */
        border-bottom: 0px solid var(--color-border);
    }

    /* --- AJUSTE MILIMÉTRICO PARA CELULARES --- */
    @media (max-width: 768px) {
        .community-feed-tabs {
            top: 50px !important; /* Cierra el hueco de 1px exacto en pantallas móviles */
        }
    }

    /* Respetar tu Modo Oscuro a la perfección */
    body.dark-theme .community-feed-tabs {
        background: rgba(18, 20, 24, 0.85);
    }
}