/* IRS Basquet - Estilos del Chat - Versión 2.3 - Márgenes Forzados */

/* Reset completo para eliminar todos los márgenes y scrollbars de WordPress */
html,
body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow-x: hidden !important;
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important; /* IE y Edge */
}

/* Eliminar scrollbars webkit globalmente para elementos del chat */
html::-webkit-scrollbar,
body::-webkit-scrollbar,
body:has(#irs-basquet-chat-container)::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    background: transparent !important;
}

/* Ocultar completamente la admin bar de WordPress cuando el chat está activo */
#wpadminbar,
body:has(#irs-basquet-chat-container) #wpadminbar,
body:has(#irs-basquet-login-container) #wpadminbar {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    top: -9999px !important;
    left: -9999px !important;
    z-index: -99999 !important;
}

/* Forzar que el body no tenga margin-top de la admin bar y tape completamente */
body:has(#irs-basquet-chat-container),
body:has(#irs-basquet-login-container) {
    margin-top: 0 !important;
    padding-top: 0 !important;
    position: relative !important;
}

/* Asegurar que html no tenga margin-top y ocupe toda la pantalla */
html:has(#irs-basquet-chat-container),
html:has(#irs-basquet-login-container) {
    margin-top: 0 !important;
    padding-top: 0 !important;
    height: 100vh !important;
    overflow-x: hidden !important;
}

/* SOLUCIÓN DEFINITIVA ANTI-ADMIN BAR */
/* Eliminar completamente el comportamiento de admin-bar */
.admin-bar,
body.admin-bar,
html.admin-bar,
body:has(#irs-basquet-chat-container).admin-bar,
body:has(#irs-basquet-login-container).admin-bar,
body:has(#irs-basquet-chat-container),
body:has(#irs-basquet-login-container) {
    margin-top: 0 !important;
    padding-top: 0 !important;
    border-top: none !important;
}

html:has(#irs-basquet-chat-container).admin-bar,
html:has(#irs-basquet-login-container).admin-bar,
html:has(#irs-basquet-chat-container),
html:has(#irs-basquet-login-container) {
    margin-top: 0 !important;
    padding-top: 0 !important;
    border-top: none !important;
}

/* Usar negative margin para contrarrestar el espacio de WordPress */
@media screen and (min-width: 783px) {
    body:has(#irs-basquet-chat-container).admin-bar,
    body:has(#irs-basquet-login-container).admin-bar {
        margin-top: -32px !important;
        padding-top: 32px !important;
    }
}

@media screen and (max-width: 782px) {
    body:has(#irs-basquet-chat-container).admin-bar,
    body:has(#irs-basquet-login-container).admin-bar {
        margin-top: -46px !important;
        padding-top: 46px !important;
    }
}

/* Forzar que el contenido comience exactamente en la posición 0 */
body.admin-bar:has(#irs-basquet-chat-container),
body.admin-bar:has(#irs-basquet-login-container) {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

html.admin-bar:has(#irs-basquet-chat-container),
html.admin-bar:has(#irs-basquet-login-container) {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* SOLUCIÓN ESPECÍFICA: Remover efectos de la clase admin-bar cuando hay chat activo */
body:has(#irs-basquet-chat-container) {
    /* Anular cualquier CSS que WordPress aplique con .admin-bar */
    margin-top: 0 !important;
    padding-top: 0 !important;
    position: relative !important;
}

/* Forzar que el chat comience exactamente en el pixel 0 */
#irs-basquet-chat-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: translateY(0) !important;
}

#irs-basquet-login-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: translateY(0) !important;
}

/* REGLA ANTI-WORDPRESS: Forzar que no haya NINGÚN espacio superior */
body:has(#irs-basquet-chat-container),
body:has(#irs-basquet-login-container) {
    --wp-admin--admin-bar--height: 0px !important;
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
    padding-block-start: 0 !important;
    padding-block-end: 0 !important;
}

/* Anular margin-top que WordPress podría estar aplicando dinámicamente */
body:has(#irs-basquet-chat-container)[style*="margin-top"],
body:has(#irs-basquet-login-container)[style*="margin-top"] {
    margin-top: 0 !important;
}

/* Anular padding-top que WordPress podría estar aplicando dinámicamente */  
body:has(#irs-basquet-chat-container)[style*="padding-top"],
body:has(#irs-basquet-login-container)[style*="padding-top"] {
    padding-top: 0 !important;
}

/* Fuerza bruta: hacer que el viewport comience en 0,0 */
html:has(#irs-basquet-chat-container),
html:has(#irs-basquet-login-container) {
    scroll-padding-top: 0 !important;
    scroll-margin-top: 0 !important;
}

/* SOLUCIÓN ESPECÍFICA PARA USUARIOS LOGUEADOS EN WORDPRESS */
/* Anular TODOS los estilos que WordPress aplica cuando hay admin bar */
.admin-bar:has(#irs-basquet-chat-container),
.admin-bar:has(#irs-basquet-login-container) {
    /* Anular el margin-top que WordPress aplica automáticamente */
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Forzar que el HTML no tenga el comportamiento de admin-bar */
html.admin-bar:has(#irs-basquet-chat-container),
html.admin-bar:has(#irs-basquet-login-container) {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Anular específicamente los 32px que WordPress añade en desktop */
@media screen and (min-width: 783px) {
    .admin-bar:has(#irs-basquet-chat-container),
    .admin-bar:has(#irs-basquet-login-container) {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    html.admin-bar:has(#irs-basquet-chat-container),
    html.admin-bar:has(#irs-basquet-login-container) {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
}

/* Anular específicamente los 46px que WordPress añade en móviles */
@media screen and (max-width: 782px) {
    .admin-bar:has(#irs-basquet-chat-container),
    .admin-bar:has(#irs-basquet-login-container) {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    html.admin-bar:has(#irs-basquet-chat-container),
    html.admin-bar:has(#irs-basquet-login-container) {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
}

/* SUPER ESPECÍFICO: Anular margin-top de 32px y 46px que WordPress aplica */
body.admin-bar:has(#irs-basquet-chat-container),
body.admin-bar:has(#irs-basquet-login-container) {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Usar transform para forzar posición exacta */
body.admin-bar:has(#irs-basquet-chat-container) #irs-basquet-chat-container,
body.admin-bar:has(#irs-basquet-login-container) #irs-basquet-login-container {
    transform: translateY(0) !important;
    top: 0 !important;
    position: fixed !important;
}

/* Eliminar cualquier offset que WordPress pueda aplicar */
body.admin-bar:has(#irs-basquet-chat-container),
body.admin-bar:has(#irs-basquet-login-container) {
    --wp-admin--admin-bar--position-offset: 0px !important;
}

/* REGLA DEFINITIVA: Simular que NO hay admin-bar cuando el chat está activo */
/* Esto anula completamente el comportamiento de WordPress para usuarios logueados */
body:has(#irs-basquet-chat-container).admin-bar,
body:has(#irs-basquet-login-container).admin-bar {
    /* Comportarse como si NO fuera .admin-bar */
    margin-top: 0 !important;
    padding-top: 0 !important;
    position: relative !important;
}

/* Forzar que los contenedores ocupen TODA la pantalla sin excepción */
body.admin-bar #irs-basquet-chat-container,
body.admin-bar #irs-basquet-login-container,
#irs-basquet-chat-container,
#irs-basquet-login-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    min-height: 100vh !important;
    z-index: 999999 !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    border: none !important;
}

/* HACK ESPECÍFICO: Anular los CSS custom properties de WordPress */
:root:has(#irs-basquet-chat-container),
:root:has(#irs-basquet-login-container) {
    --wp-admin--admin-bar--height: 0px !important;
}

/* Si WordPress usa JavaScript para aplicar estilos, los anulamos */
body[style*="margin-top"]:has(#irs-basquet-chat-container),
body[style*="margin-top"]:has(#irs-basquet-login-container) {
    margin-top: 0 !important;
}

body[style*="padding-top"]:has(#irs-basquet-chat-container),
body[style*="padding-top"]:has(#irs-basquet-login-container) {
    padding-top: 0 !important;
}

/* Última línea de defensa: usar negative margin si es necesario */
html.admin-bar:has(#irs-basquet-chat-container) body,
html.admin-bar:has(#irs-basquet-login-container) body {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    position: relative !important;
    top: 0 !important;
    bottom: 0 !important;
}

/* ELIMINAR FRANJA GRIS INFERIOR - Reglas específicas para margin/padding inferior */
body:has(#irs-basquet-chat-container),
body:has(#irs-basquet-login-container) {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
    height: 100vh !important;
    max-height: 100vh !important;
    min-height: 100vh !important;
    overflow-y: hidden !important;
}

html:has(#irs-basquet-chat-container),
html:has(#irs-basquet-login-container) {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
    height: 100vh !important;
    max-height: 100vh !important;
    min-height: 100vh !important;
}

/* Eliminar cualquier espacio que WordPress pueda agregar al final */
body:has(#irs-basquet-chat-container) *:not(#irs-basquet-chat-container):not(#irs-basquet-chat-container *),
body:has(#irs-basquet-login-container) *:not(#irs-basquet-login-container):not(#irs-basquet-login-container *) {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Forzar que no haya scroll ni espacios adicionales */
body:has(#irs-basquet-chat-container),
body:has(#irs-basquet-login-container) {
    overflow: hidden !important;
    position: fixed !important;
    width: 100vw !important;
    height: 100vh !important;
}

/* Eliminar cualquier footer o elemento al final de la página */
body:has(#irs-basquet-chat-container) footer,
body:has(#irs-basquet-chat-container) .site-footer,
body:has(#irs-basquet-chat-container) #colophon,
body:has(#irs-basquet-login-container) footer,
body:has(#irs-basquet-login-container) .site-footer,
body:has(#irs-basquet-login-container) #colophon {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* SOLUCIÓN DEFINITIVA PARA FRANJA INFERIOR */
/* Asegurar que el contenido del chat ocupe exactamente el viewport completo */
#irs-basquet-chat-container .chat-container,
#irs-basquet-login-container {
    height: 100vh !important;
    max-height: 100vh !important;
    overflow-y: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-sizing: border-box !important;
}

/* Eliminar cualquier pseudo-elemento que pueda crear espacio */
body:has(#irs-basquet-chat-container)::after,
body:has(#irs-basquet-login-container)::after,
html:has(#irs-basquet-chat-container)::after,
html:has(#irs-basquet-login-container)::after {
    display: none !important;
    content: none !important;
}

/* Forzar que NO haya espacio después del último elemento */
body:has(#irs-basquet-chat-container) > *:last-child,
body:has(#irs-basquet-login-container) > *:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Usar viewport units para asegurar cobertura total */
body:has(#irs-basquet-chat-container),
body:has(#irs-basquet-login-container) {
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    width: 100vw !important;
    min-width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* Elementos de cobertura eliminados para evitar problemas */

/* COBERTURA TOTAL DE EMERGENCIA - Fondo transparente solo para chat */
html:has(#irs-basquet-chat-container) {
    background: transparent !important;
}

body:has(#irs-basquet-chat-container) {
    background: transparent !important;
}

/* Mantener el fondo del login */
html:has(#irs-basquet-login-container) {
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-yellow), var(--accent-gold)) !important;
}

body:has(#irs-basquet-login-container) {
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-yellow), var(--accent-gold)) !important;
}

/* HACK FINAL - Eliminar clases problemáticas de WordPress */
body:has(#irs-basquet-chat-container),
body:has(#irs-basquet-login-container) {
    /* Simular que NO es admin-bar */
    --wp-admin--admin-bar--height: 0px !important;
}

/* Forzar posición absoluta del contenido para ignorar admin-bar */
body.admin-bar:has(#irs-basquet-chat-container) #irs-basquet-chat-container,
body.admin-bar:has(#irs-basquet-login-container) #irs-basquet-login-container {
    position: fixed !important;
    top: 0 !important;
    transform: translateY(0) !important;
}

/* Eliminar dinámicamente el margin-top que WordPress aplica via JS */
body[style*="margin-top"]:has(#irs-basquet-chat-container),
body[style*="margin-top"]:has(#irs-basquet-login-container) {
    margin-top: 0 !important;
}

/* Reset de márgenes para WordPress */
#irs-basquet-chat-container *,
#irs-basquet-login-container * {
    box-sizing: border-box;
}

/* Eliminar márgenes de contenedores de WordPress */
body.irs-basquet-active,
body:has(#irs-basquet-login-container),
body:has(#irs-basquet-chat-container) {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow-x: hidden !important;
}

/* Eliminar cualquier borde azul de WordPress o temas */
#irs-basquet-chat-container *,
#irs-basquet-chat-container .chat-sidebar *,
#irs-basquet-chat-container .chat-container *,
#irs-basquet-chat-container .chat-messages *,
.chat-sidebar,
.chat-container,
.chat-messages {
    border-left: none !important;
    border-right: none !important;
}

/* Específicamente para elementos que pueden tener bordes azules */
.chat-sidebar::before,
.chat-container::before,
.chat-messages::before,
.chat-sidebar::after,
.chat-container::after,
.chat-messages::after {
    display: none !important;
    content: none !important;
}

/* Ocultar botón de toggle del chat que causa la barra azul */
.chat-toggle-btn,
#chat-toggle-btn {
    display: none !important;
    visibility: hidden !important;
}

/* Eliminar márgenes de todos los contenedores padre de WordPress */
.site,
.site-content,
.content-area,
.container,
.row,
.wrap,
.wrapper,
.main,
.content,
.page,
.post,
.entry,
.entry-content,
.wp-site-blocks,
.wp-block-group,
.alignwide,
.alignfull {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: none !important;
}

/* Ocultar header, footer y navegación de WordPress */
body:has(#irs-basquet-login-container) header,
body:has(#irs-basquet-login-container) .site-header,
body:has(#irs-basquet-login-container) #masthead,
body:has(#irs-basquet-login-container) .header,
body:has(#irs-basquet-login-container) nav,
body:has(#irs-basquet-login-container) .navigation,
body:has(#irs-basquet-login-container) .navbar,
body:has(#irs-basquet-login-container) footer,
body:has(#irs-basquet-login-container) .site-footer,
body:has(#irs-basquet-login-container) #colophon,
body:has(#irs-basquet-login-container) .footer,
body:has(#irs-basquet-chat-container) header,
body:has(#irs-basquet-chat-container) .site-header,
body:has(#irs-basquet-chat-container) #masthead,
body:has(#irs-basquet-chat-container) .header,
body:has(#irs-basquet-chat-container) nav,
body:has(#irs-basquet-chat-container) .navigation,
body:has(#irs-basquet-chat-container) .navbar,
body:has(#irs-basquet-chat-container) footer,
body:has(#irs-basquet-chat-container) .site-footer,
body:has(#irs-basquet-chat-container) #colophon,
body:has(#irs-basquet-chat-container) .footer {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Ocultar sidebars y widgets */
body:has(#irs-basquet-login-container) aside,
body:has(#irs-basquet-login-container) .sidebar,
body:has(#irs-basquet-login-container) .widget,
body:has(#irs-basquet-login-container) .widget-area,
body:has(#irs-basquet-chat-container) aside,
body:has(#irs-basquet-chat-container) .sidebar,
body:has(#irs-basquet-chat-container) .widget,
body:has(#irs-basquet-chat-container) .widget-area {
    display: none !important;
}

/* Hacer que el contenido principal ocupe toda la pantalla */
body:has(#irs-basquet-login-container) .site-content,
body:has(#irs-basquet-login-container) .content-area,
body:has(#irs-basquet-login-container) main,
body:has(#irs-basquet-login-container) .main,
body:has(#irs-basquet-login-container) .entry-content,
body:has(#irs-basquet-chat-container) .site-content,
body:has(#irs-basquet-chat-container) .content-area,
body:has(#irs-basquet-chat-container) main,
body:has(#irs-basquet-chat-container) .main,
body:has(#irs-basquet-chat-container) .entry-content {
    width: 100vw !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

/* Si hay un contenedor padre de WordPress, quitarle padding también */
.wp-site-blocks:has(#irs-basquet-login-container),
.entry-content:has(#irs-basquet-login-container),
.wp-site-blocks:has(#irs-basquet-chat-container),
.entry-content:has(#irs-basquet-chat-container) {
    padding-left: 0 !important;
    padding-right: 0 !important;
    max-width: none !important;
    margin: 0 !important;
}

#irs-basquet-chat-container {
    position: fixed !important;
    top: 0 !important; /* Sin espacio para admin bar ya que la ocultamos */
    bottom: 0 !important; /* Anclado al fondo para eliminar franja gris */
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important; /* Altura completa sin restar admin bar */
    display: flex !important;
    flex-direction: column !important;
    background: transparent !important; /* Fondo transparente para no crear franja */
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 999999 !important; /* Z-index alto ya que no hay admin bar */
    box-sizing: border-box !important;
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important; /* IE y Edge */
}

/* Font-family para texto general (excluyendo iconos) */
#irs-basquet-chat-container *:not(i):not(.fas):not(.far):not(.fab) {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* CRÍTICO: Forzar Font Awesome en chat */
#irs-basquet-chat-container i, 
#irs-basquet-chat-container .fas, 
#irs-basquet-chat-container .far, 
#irs-basquet-chat-container .fab, 
#irs-basquet-chat-container [class*="fa-"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome" !important;
    font-weight: 900 !important;
    font-style: normal !important;
}

/* Eliminar scrollbars de webkit en el contenedor principal */
#irs-basquet-chat-container::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    background: transparent !important;
}

/* Ajustes para móviles - también ocultamos admin bar */
@media screen and (max-width: 782px) {
    #irs-basquet-chat-container {
        top: 0 !important; /* Sin admin bar en móviles también */
        height: 100vh !important;
    }
}

/* En todos los casos, usar pantalla completa sin admin bar */
#irs-basquet-chat-container {
    top: 0 !important;
    height: 100vh !important;
}

/* Header compacto */
.irs-chat-header {
    background: linear-gradient(45deg, #FF6B35, #F7931E) !important;
    color: white !important;
    padding: 8px 15px !important; /* Padding aún más reducido */
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
    z-index: 100 !important;
    width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    min-height: 45px; /* Altura mínima más reducida */
    position: relative;
    visibility: visible !important;
    opacity: 1 !important;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px; /* Gap reducido */
    width: 100%;
    justify-content: flex-start;
    position: relative;
}

.user-details {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-name {
    font-size: 1.1rem; /* Tamaño reducido */
    font-weight: bold;
}

.team-name {
    font-size: 1rem;
    opacity: 0.9;
}

.user-type {
    padding: 4px 12px !important;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    box-sizing: border-box !important;
}

.user-type-irs { 
    background: rgba(40, 167, 69, 0.3);
    border: 1px solid rgba(40, 167, 69, 0.5);
}

.user-type-switch { 
    background: rgba(0, 123, 255, 0.3);
    border: 1px solid rgba(0, 123, 255, 0.5);
}

.user-type-admin { 
    background: rgba(220, 53, 69, 0.3);
    border: 1px solid rgba(220, 53, 69, 0.5);
}

/* Estilos para información RTMP (solo switches) */
.rtmp-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: auto;
    min-width: auto;
    max-width: fit-content;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.rtmp-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
}

.rtmp-label {
    font-weight: bold;
    min-width: 30px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    padding: 2px 6px !important;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    box-sizing: border-box !important;
}

.rtmp-value {
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px !important;
    border-radius: 3px;
    color: #fff;
    font-size: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    user-select: all; /* Permite seleccionar todo el texto fácilmente */
    white-space: nowrap;
    box-sizing: border-box !important;
}

.rtmp-copy-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0 !important;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    box-sizing: border-box !important;
}

.rtmp-copy-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

.rtmp-copy-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.5);
}

.rtmp-copy-btn i {
    font-size: 0.6rem;
    line-height: 1;
    margin: 0;
    padding: 0;
}

/* Responsividad para información RTMP */
@media (max-width: 768px) {
    .user-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .rtmp-info {
        align-self: center;
        gap: 10px;
        padding: 4px 8px;
    }
    
    .rtmp-item {
        font-size: 0.75rem;
        gap: 4px;
    }
    
    .rtmp-label {
        min-width: 30px;
    }
    
    .rtmp-value {
        font-size: 0.7rem;
        padding: 1px 4px;
    }
    
    .rtmp-copy-btn {
        width: 20px;
        height: 20px;
        min-width: 20px;
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .user-details {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .rtmp-info {
        width: 100%;
        justify-content: space-around;
        gap: 8px;
        padding: 4px 6px;
    }
    
    .rtmp-value {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #dc3545;
    animation: pulse 1s infinite;
}

.status-dot.connected {
    background: #28a745;
    animation: none;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 12px !important;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.8rem;
    white-space: nowrap;
    box-sizing: border-box !important;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Tabs para admin */
.irs-admin-tabs {
    background: white;
    display: flex;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

.tab-btn.active {
    background: #f8f9fa;
    border-bottom-color: #FF6B35;
    color: #FF6B35;
    font-weight: bold;
}

.tab-btn:hover:not(.active) {
    background: #f8f9fa;
    color: #666;
}

/* Contenido */
.irs-chat-content {
    flex: 1;
    overflow: hidden !important;
    position: relative;
    padding: 0 !important;
    margin: 0 !important;
}

.tab-content {
    height: 100%;
    display: none;
    padding: 0 !important; /* Sin padding */
    margin: 0 !important; /* Sin margin */
    overflow: hidden !important; /* Control de overflow en hijos */
}

.tab-content.active {
    display: flex; /* Cambio a flexbox para layout horizontal */
    flex-direction: row; /* Horizontal en lugar de vertical */
    gap: 0; /* Sin espacio entre columnas */
    overflow: hidden !important; /* Eliminar cualquier scroll */
}

/* Selector de salas */
.room-selector {
    background: white;
    padding: 15px 10px; /* Reducido padding lateral */
    border-radius: 0; /* Sin bordes redondeados en los laterales */
    margin-bottom: 10px; /* Reducido margen */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.room-selector label {
    font-weight: bold;
    color: #333;
}

.room-selector select {
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    min-width: 200px;
    background: white;
}

.room-status {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

/* Layout de dos columnas optimizado: video maximizado, chat compacto */
.main-video-area {
    flex: 1; /* Toma todo el espacio disponible */
    display: flex;
    flex-direction: column;
    background: #000; /* Fondo negro para video */
    overflow: hidden !important; /* Sin scroll para maximizar video */
    border: none !important; /* Eliminar borde que causaba la línea azul */
    border-bottom: none !important; /* Eliminar cualquier línea negra inferior */
    padding: 0 !important; /* Sin padding para maximizar video */
    margin: 0 !important; /* Sin margin para maximizar video */
    width: 100% !important;
    height: 100% !important; /* Altura relativa al contenedor */
}

.chat-sidebar {
    width: 319px; /* Aumentado 10% (de 290px a 319px) */
    min-width: 319px; 
    max-width: 352px; /* Aumentado proporcionalmente */
    margin-right: 0; /* Eliminado margen derecho */
    padding-right: 8px; /* Padding derecho reducido */
    display: flex;
    flex-direction: column;
    background: white;
    border: none !important; /* Forzar eliminación de todos los bordes */
    border-left: none !important; /* Específicamente eliminar borde izquierdo */
    border-right: none !important; /* Específicamente eliminar borde derecho */
    box-shadow: none; /* Eliminada sombra */
    height: 100%; /* Tomar toda la altura del contenedor padre */
}

/* Selector de salas compacto */
.main-video-area .room-selector {
    margin-bottom: 0 !important; /* Sin margen */
    padding: 5px 8px !important; /* Padding mínimo */
    background: rgba(255,255,255,0.95); /* Semi-transparente */
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    backdrop-filter: blur(5px);
    position: absolute;
    top: 5px;
    left: 5px;
    z-index: 100;
}

/* Reproductor de video maximizado */
.video-player-container {
    background: black;
    border-radius: 0 !important; /* Sin bordes para maximizar */
    padding: 0 !important;
    margin: 0 !important; /* Sin margen para llegar hasta abajo */
    box-shadow: none !important; /* Sin sombra para eliminar líneas */
    border: none !important; /* Eliminar cualquier borde */
    border-bottom: none !important; /* Específicamente eliminar línea negra inferior */
    position: relative;
    width: 100% !important; /* Máximo ancho posible */
    height: 100% !important; /* Altura completa sin restar nada */
    min-height: 100% !important; /* Altura mínima completa */
    max-height: 100% !important; /* Altura máxima completa */
    overflow: hidden !important; /* Eliminar barras de desplazamiento */
    display: block;
    transition: none !important; /* Eliminar transiciones que pueden causar problemas */
}

/* Para contenido HTML/iframe, usar toda la altura disponible */
.video-player-container[data-video-type="iframe"] {
    height: 100% !important; /* Altura máxima completa */
    padding: 0 !important;
    margin: 0 !important;
    min-height: 100% !important; /* Altura mínima completa */
    max-height: 100% !important; /* Altura máxima completa */
    overflow: hidden !important;
}

.video-player-container:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.video-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.3rem;
    text-align: center;
    z-index: 15;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.9), rgba(255, 107, 53, 0.7));
    padding: 40px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 80%;
    max-width: 400px;
}

.video-placeholder h3 {
    margin: 0 0 15px 0;
    font-size: 1.8rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.video-placeholder p {
    margin: 10px 0;
    opacity: 0.9;
    line-height: 1.4;
}

.video-placeholder small {
    opacity: 0.7;
    display: block;
    margin-top: 15px;
}

.video-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.95), rgba(255, 107, 53, 0.85));
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 20;
    backdrop-filter: blur(10px);
    color: white;
}

.video-error {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.95), rgba(220, 53, 69, 0.85));
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 20;
    backdrop-filter: blur(10px);
    color: white;
}

.loading-message,
.error-message {
    text-align: center;
    padding: 20px;
}

.loading-message h3,
.error-message h3 {
    color: white;
    margin-bottom: 10px;
    font-size: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.hide-loading-btn,
.retry-btn,
.external-link-btn {
    background: white;
    color: #FF6B35;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hide-loading-btn:hover,
.retry-btn:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.external-link-btn {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.external-link-btn:hover {
    background: white;
    color: #dc3545;
}

/* Video elements maximizados */
.video-iframe,
#video-element {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important; /* Sin bordes */
    border: none !important;
    background: black;
    z-index: 10;
    display: block !important;
    visibility: visible !important;
    /* OCULTO POR DEFECTO - solo mostrar cuando stream esté confirmado */
    opacity: 0 !important;
    pointer-events: none !important;
    object-fit: cover; /* Cubrir todo el espacio disponible */
    overflow: hidden !important; /* Eliminar barras de desplazamiento del video */
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    max-height: none !important;
}

.video-iframe.video-hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.video-iframe.video-visible {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transition: opacity 0.5s ease;
}

/* Controles del video deshabilitados para maximizar espacio */
.video-controls {
    display: none !important; /* Ocultar completamente */
}

/* Eliminar scrollbars de todo el área de video */
.main-video-area *,
.video-player-container *,
.video-iframe,
#video-element {
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important; /* IE y Edge */
}

.main-video-area *::-webkit-scrollbar,
.video-player-container *::-webkit-scrollbar,
.video-iframe::-webkit-scrollbar,
#video-element::-webkit-scrollbar {
    display: none !important; /* Chrome, Safari y Opera */
    width: 0 !important;
    background: transparent !important;
}

.video-btn {
    display: none !important; /* Ocultar todos los botones de video */
}

.video-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    color: white;
    text-decoration: none;
}

.video-btn:active {
    transform: translateY(0);
}

/* Estados especiales del video */
.video-player-container.loading .video-iframe,
.video-player-container.loading #video-element {
    opacity: 0.3;
}

.video-player-container.error .video-iframe,
.video-player-container.error #video-element {
    opacity: 0.1;
}

/* Fullscreen support */
.video-player-container:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    padding-bottom: 0;
    border-radius: 0;
}

.video-player-container:-moz-full-screen {
    width: 100vw;
    height: 100vh;
    padding-bottom: 0;
    border-radius: 0;
}

.video-player-container:fullscreen {
    width: 100vw;
    height: 100vh;
    padding-bottom: 0;
    border-radius: 0;
}

/* Chat container como sidebar */
.chat-container {
    background: white;
    border-radius: 0;
    height: 100% !important; /* Altura relativa al contenedor padre */
    display: flex;
    flex-direction: column;
    box-shadow: none;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important; /* Forzar eliminación de todos los bordes */
    border-left: none !important; /* Específicamente eliminar borde izquierdo */
    border-right: none !important; /* Eliminar borde derecho */
    border-bottom: none !important; /* Eliminar borde inferior */
}

.chat-messages {
    flex: 1; /* Tomar todo el espacio disponible */
    padding: 4px 6px !important; /* Padding mínimo para maximizar espacio */
    overflow-y: auto; /* Barra de desplazamiento para el chat */
    background: #fafbfc;
    border-radius: 0;
    font-size: 14px; /* Texto más pequeño para sidebar compacto */
    max-height: none; /* Sin límite de altura máxima */
    height: auto; /* Altura automática */
    scrollbar-width: thin; /* Firefox - mostrar scrollbar delgado */
    scrollbar-color: #c1c1c1 #f1f1f1; /* Firefox - colores del scrollbar */
}

/* Scrollbar personalizado para Webkit - restaurado */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Selector más específico para forzar el padding izquierdo del chat */
#irs-basquet-chat-container .chat-sidebar .chat-messages {
    padding-left: 6px !important;
    padding-right: 6px !important;
}

/* Para móviles */
@media (max-width: 768px) {
    #irs-basquet-chat-container .chat-sidebar .chat-messages {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }
}

.welcome-message {
    position: sticky; /* Hacer que se quede fija arriba */
    top: 0; /* Pegada a la parte superior */
    z-index: 10; /* Por encima de otros elementos */
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 8px 12px; /* Padding mucho más compacto */
    background: white; /* Fondo blanco sólido 100% sin opacidad */
    border-radius: 6px; /* Menos redondeado */
    border: 1px solid rgba(255, 107, 53, 0.3);
    margin-bottom: 4px; /* Margen inferior muy reducido */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* Sombra sutil */
    display: none; /* Oculto por defecto - solo visible cuando tenga contenido */
}

.welcome-message:not(:empty) {
    display: block; /* Mostrar solo cuando tenga contenido */
}

.welcome-message p {
    margin: 3px 0; /* Márgenes más pequeños */
}

.welcome-message small {
    display: block;
    margin-top: 6px; /* Margen reducido */
    font-size: 0.8rem; /* Texto más pequeño */
    color: #FF6B35;
}

/* Input del chat - más compacto para sidebar */
.chat-input-container {
    padding: 3px 6px 5px 6px !important; /* Padding lateral aumentado para evitar corte de bordes */
    margin: 0 !important; /* Sin márgenes laterales */
    border-top: 1px solid rgba(0,0,0,0.05); /* Borde superior muy sutil */
    background: white;
    border-radius: 0;
    flex-shrink: 0; /* No permitir que se reduzca */
    overflow: visible; /* Asegurar que los bordes sean visibles */
}

.typing-indicator {
    min-height: 0; /* Sin altura mínima para eliminar espacio vacío */
    margin-bottom: 4px; /* Margen reducido */
    font-size: 0.85rem; /* Texto más pequeño */
    color: #666;
    font-style: italic;
    display: block; /* Solo visible cuando hay contenido */
}

.chat-input-wrapper {
    display: flex;
    gap: 6px !important; /* Gap mínimo */
    margin-bottom: 3px !important; /* Margen mínimo */
    padding: 0 !important; /* Sin padding */
}

#message-input {
    flex: 1;
    padding: 2px 10px !important; /* Padding vertical mínimo */
    margin: 0 !important; /* Sin márgenes */
    border: 2px solid #c1c1c1; /* Borde más grueso y destacado */
    border-radius: 4px; /* Muy poco redondeado */
    outline: none;
    font-size: 14px; /* Texto más pequeño */
    background: #ffffff; /* Fondo blanco más destacado */
    transition: all 0.3s ease;
    line-height: 1.1; /* Line-height aún más compacto */
    height: auto; /* Altura automática */
    min-height: 20px; /* Altura mínima muy pequeña */
    color: #333; /* Color del texto */
    cursor: text; /* Cursor de texto */
    user-select: text; /* Permitir selección de texto */
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

#message-input::placeholder {
    color: #999;
    opacity: 1;
    font-style: italic;
}

#message-input:focus {
    border-color: #FF6B35;
    border-width: 2px; /* Mantener grosor en focus */
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15); /* Sombra más visible */
}

.send-btn {
    background: #FF6B35;
    color: white;
    border: none;
    border-radius: 4px; /* Muy poco redondeado */
    width: 30px; /* Aún más compacto */
    height: 30px; /* Aún más compacto */
    cursor: pointer;
    font-size: 0.9rem; /* Más pequeño */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 1px 4px rgba(255, 107, 53, 0.3);
}

.send-btn:hover {
    background: #e55a2b;
    transform: scale(1.05);
}

.send-btn:active {
    transform: scale(0.95);
}

/* Botones rápidos - reorganizados en filas */
.quick-buttons {
    display: grid;
    grid-template-columns: 1fr; /* Primera fila: 1 columna */
    gap: 10px;
    justify-content: center;
    margin: 10px 15px 15px 5px !important; /* Margen izquierdo reducido */
}

/* Layout específico para los botones por filas */
.quick-btn.first-row {
    grid-column: 1 / -1; /* Ocupa toda la fila */
    justify-self: center;
    max-width: 200px; /* Límite de ancho */
}

.quick-btn.second-row,
.quick-btn.third-row {
    grid-column: span 1;
}

/* Configurar las filas usando CSS Grid areas */
.quick-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto auto;
    gap: 5px; /* Gap ligeramente aumentado para mejor separación */
    justify-content: center;
    margin: 3px 0 3px 0 !important; /* Márgenes ligeramente aumentados */
    padding: 1px 6px !important; /* Padding lateral para evitar corte de bordes */
    overflow: visible; /* Asegurar visibilidad de bordes */
}

.quick-btn.first-row {
    grid-column: 1 / -1; /* Botón central que ocupa toda la primera fila */
    justify-self: center;
    max-width: 220px;
}

.quick-btn {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.1); /* Borde sutil */
    border-radius: 5px; /* Un poco más redondeado para mejor apariencia */
    padding: 5px 9px; /* Padding ligeramente aumentado */
    cursor: pointer;
    font-size: 0.75rem; /* Texto aún más pequeño */
    font-weight: 600; /* Peso de fuente aumentado para mayor contraste */
    transition: all 0.3s ease;
    color: #374151; /* Color de texto más oscuro */
    text-align: center;
    min-height: 28px; /* Altura mínima ligeramente mayor */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.12); /* Sombra ligeramente más pronunciada */
}

/* Botón especial primario (PREPARA ÚLTIMA JUGADA) */
.quick-btn-primary {
    background: linear-gradient(135deg, #FF6B35, #F7931E);
    color: white;
    border: 2px solid #FF6B35; /* Borde para mayor definición */
    font-weight: 700; /* Peso de fuente más alto */
    font-size: 0.9rem;
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.4); /* Sombra más pronunciada */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); /* Sombra en el texto para mayor contraste */
}

.quick-btn-primary:hover {
    background: linear-gradient(135deg, #e55a2b, #e08419);
    transform: translateY(-3px); /* Movimiento más pronunciado */
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.5); /* Sombra más intensa */
    border-color: #e55a2b;
}

/* Botón especial de éxito (Revisión finalizada) */
.quick-btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.quick-btn-success:hover {
    background: linear-gradient(135deg, #218838, #1da88a);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

.quick-btn:hover {
    background: #f3f4f6;
    border-color: #FF6B35;
    color: #FF6B35;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2); /* Sombra más pronunciada en hover */
    border-width: 2px; /* Mantener grosor del borde */
}

/* Mensajes del chat */
.message {
    margin-bottom: 8px; /* Reducido de 15px a 8px para mensajes más cercanos */
    animation: messageAppear 0.3s ease-out;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.message-user {
    font-weight: bold;
    color: #333;
}

.message-user.irs {
    color: #28a745;
}

.message-user.switch {
    color: #007bff;
}

.message-user.admin {
    color: #dc3545;
}

.message-time {
    font-size: 0.8rem;
    color: #666;
}

/* Wrapper que contiene el contenido del mensaje y el check */
.message-content-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-right: 4px; /* Margen derecho reducido */
    max-width: 100%;
}

.message-content {
    background: white;
    padding: 8px 12px; /* Reducido el padding para hacer el badge más compacto */
    border-radius: 15px;
    border-left: 3px solid transparent; /* Borde transparente para mantener alineación */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); /* Sombra más sutil */
    flex: 1;
    min-height: fit-content;
    word-wrap: break-word;
    max-width: calc(100% - 10px); /* Reducido para dar más espacio */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centrar verticalmente el contenido */
}

.message.own .message-content {
    background: rgba(255, 107, 53, 0.1);
    border-left-color: #FF6B35;
}

/* Estilos para el texto dentro del mensaje */
.message-content p {
    margin: 0; /* Eliminar márgenes de los párrafos */
    padding: 0;
    line-height: 1.4;
}

.message-content p:not(:last-child) {
    margin-bottom: 4px; /* Espacio entre párrafos si hay múltiples */
}

/* 🔹 MENSAJES DEL SISTEMA - Estilo discreto y compacto */
.message.system-message {
    margin-bottom: 8px; /* Menos espacio que mensajes normales */
    animation: systemMessageAppear 0.2s ease-out;
}

@keyframes systemMessageAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.system-message-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(108, 117, 125, 0.08); /* Gris muy suave */
    border-radius: 20px;
    border: 1px solid rgba(108, 117, 125, 0.15);
    font-size: 0.85rem;
    color: #6c757d;
    text-align: center;
    margin: 0 20px; /* Margen lateral para centrarlo más */
}

.system-icon {
    font-size: 0.8rem;
    opacity: 0.7;
}

.system-text {
    flex-grow: 1;
    font-style: italic;
    font-weight: normal;
}

.system-time {
    font-size: 0.75rem;
    opacity: 0.6;
    white-space: nowrap;
}

/* Hover effect sutil para mensajes del sistema */
.message.system-message:hover .system-message-content {
    background: rgba(108, 117, 125, 0.12);
    border-color: rgba(108, 117, 125, 0.25);
}

/* Responsivo - En móviles hacer los mensajes del sistema aún más compactos */
@media (max-width: 768px) {
    .system-message-content {
        margin: 0 10px;
        padding: 4px 10px;
        font-size: 0.8rem;
        gap: 6px;
    }
    
    .system-time {
        font-size: 0.7rem;
    }
}

/* Notificaciones */
.chat-notifications {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
}

.notification {
    background: white;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease-out;
    max-width: 300px;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification.success {
    border-left: 4px solid #28a745;
}

.notification.error {
    border-left: 4px solid #dc3545;
}

.notification.info {
    border-left: 4px solid #007bff;
}

/* Reglas globales de botones eliminadas para evitar conflictos */

/* Estados de carga */
.loading-message {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

/* Responsividad */
/* Responsividad mejorada para reproductor de video */
@media (max-width: 768px) {
    .tab-content.active {
        flex-direction: column !important; /* Vertical en móviles */
        height: 100%;
    }
    
    .main-video-area {
        border: none; /* Sin bordes que causen líneas */
        border-bottom: 1px solid #e9ecef;
        flex: 0 0 auto; /* No expandir */
        padding: 0; /* Sin padding */
    }
    
    .chat-sidebar {
        width: 100%;
        min-width: auto;
        max-width: none;
        height: 300px; /* Altura fija en móviles */
        border: none !important; /* Sin bordes */
        border-left: none !important;
        border-top: 1px solid #e9ecef;
        flex: 1; /* Tomar espacio restante */
        margin-right: 0; /* Sin margen derecho en móviles */
        padding-right: 10px; /* Padding derecho reducido en móviles */
    }
    
    .chat-messages {
        padding: 10px 10px 10px 11px !important; /* Reducido padding para móviles */
    }
    
    .chat-input-container {
        padding: 12px 20px 20px 8px !important; /* Padding izquierdo reducido para móviles */
        margin: 0 10px 0 2px !important; /* Margen izquierdo mínimo para móviles */
    }
    
    .video-player-container {
        padding-bottom: 42.5%; /* Aspect ratio más compacto en móviles */
        margin: 0; /* Sin margen */
        width: 100%; /* Ancho completo */
        border-radius: 0; /* Sin bordes redondeados */
        box-shadow: none; /* Sin sombra */
    }
    
    .video-controls {
        margin: 8px;
        padding: 10px;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .video-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
        flex: 1;
        min-width: calc(50% - 3px);
    }
    
    .loading-message h3,
    .error-message h3 {
        font-size: 1.2rem;
    }
    
    .hide-loading-btn,
    .retry-btn,
    .external-link-btn {
        padding: 10px 20px;
        font-size: 13px;
        margin: 5px;
    }
    
    .video-placeholder {
        padding: 20px;
        font-size: 1.1rem;
    }
}

/* Tablet y escritorio pequeño */
@media (max-width: 1024px) and (min-width: 769px) {
    .chat-sidebar {
        width: 352px; /* Aumentado proporcionalmente (10% más) */
        min-width: 319px;
        margin-right: 2%; /* Mantener margen derecho */
        padding-right: 15px; /* Mantener padding derecho */
    }
    
    .video-player-container {
        margin: 0; /* Sin margen */
        width: 100%; /* Ancho completo */
        box-shadow: none; /* Sin sombra */
    }
    
    .video-controls {
        margin: 12px;
        gap: 8px;
    }
}

/* Escritorio grande */
@media (min-width: 1200px) {
    .video-player-container {
        margin: 0; /* Sin margen para máxima área */
        width: 100%; /* Ancho completo */
        box-shadow: none; /* Sin sombra que cause líneas */
    }
    
    .video-controls {
        display: none !important; /* Ocultar controles en escritorio grande también */
    }
    
    .video-btn {
        display: none !important; /* Ocultar todos los botones */
    }
}

/* Orientación horizontal en móviles */
@media (max-width: 768px) and (orientation: landscape) {
    .tab-content.active {
        flex-direction: row !important;
    }
    
    .main-video-area {
        border: none; /* Sin borde que cause líneas azules */
        border-bottom: none;
        flex: 1;
    }
    
    .chat-sidebar {
        width: 330px; /* Aumentado proporcionalmente (10% más) */
        height: 100%;
        border: none !important; /* Sin bordes */
        border-left: none !important;
        margin-right: 1.5%; /* Margen reducido para pantallas más pequeñas */
        padding-right: 12px; /* Padding derecho intermedio */
    }
    
    .video-player-container {
        padding-bottom: 45%;
    }
}

/* Pantalla completa mejorada */
@media (max-width: 768px) {
    .video-player-container:-webkit-full-screen,
    .video-player-container:-moz-full-screen,
    .video-player-container:fullscreen {
        width: 100vw;
        height: 100vh;
        padding-bottom: 0;
        border-radius: 0;
        margin: 0;
    }
    
    .video-player-container:-webkit-full-screen .video-controls,
    .video-player-container:-moz-full-screen .video-controls,
    .video-player-container:fullscreen .video-controls {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        margin: 0;
        z-index: 1000;
    }
}

@media (max-width: 768px) {
    .user-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .video-iframe {
        height: 200px;
    }
    
    .chat-container {
        height: calc(100vh - 350px);
    }
    
    .quick-buttons {
        justify-content: flex-start;
        grid-template-columns: 1fr; /* En móvil, todos los botones en una columna */
        gap: 6px;
        margin: 10px 10px 15px 2px !important; /* Margen izquierdo mínimo para móviles */
    }
    
    .quick-btn.first-row,
    .quick-btn.second-row,
    .quick-btn.third-row {
        grid-column: 1; /* Todos ocupan una columna en móvil */
        max-width: none;
        font-size: 0.8rem;
        padding: 8px 12px;
        min-height: 38px;
    }
    
    .irs-admin-tabs {
        overflow-x: auto;
    }
    
    .tab-btn {
        min-width: 100px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .irs-chat-header {
        padding: 8px 5px; /* Padding mínimo en móviles pequeños */
        min-height: 40px; /* Altura aún más pequeña en móviles */
    }
    
    .tab-content {
        padding: 10px 0; /* Sin padding lateral en móviles */
    }
    
    .chat-container {
        height: calc(100vh - 280px); /* Ajustado con header más pequeño */
        border-radius: 0; /* Asegurar sin bordes en móvil */
    }
    
    .video-iframe {
        height: 200px; /* Ligeramente más alto para móviles */
    }
    
    .video-player-container {
        margin: 0; /* Sin margen en móviles */
        width: 100vw;
        height: calc(100vh - 280px); /* Altura optimizada */
    }
}

/* === CONTROLES DE AUDIO === */

/* Controles de audio más compactos en una línea */
.audio-controls {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 8px; /* Padding reducido */
    margin: 12px 8px; /* Agregar margen izquierdo y derecho */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.audio-controls-inline {
    display: flex;
    align-items: center;
    gap: 10px; /* Espacio entre elementos */
    justify-content: space-between;
}

/* Botón de micrófono con SVG */
.record-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; /* Más pequeño */
    height: 40px;
    padding: 0;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    flex-shrink: 0; /* No se encoja */
}

.record-btn:not(:disabled):hover {
    background: #5a6268;
    transform: scale(1.05);
}

.record-btn:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

.record-btn.recording {
    background: #dc3545; /* Rojo cuando graba */
    animation: recordingPulse 1.5s ease-in-out infinite;
    transform: scale(1.05);
}

.record-btn.recording:hover {
    background: #c82333;
}

/* Icono SVG del micrófono */
.mic-icon {
    width: 18px;
    height: 18px;
    transition: all 0.3s ease;
}

.record-btn.recording .mic-icon {
    color: white;
    animation: micRecording 0.8s ease-in-out infinite alternate;
}

@keyframes micRecording {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

@keyframes recordingPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    50% { box-shadow: 0 0 0 6px rgba(220, 53, 69, 0); }
}

/* Selector de micrófono en línea */
.microphone-select {
    flex: 1; /* Toma el espacio disponible */
    min-width: 120px;
    padding: 6px 10px; /* Padding ajustado */
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    font-size: 0.75rem; /* Texto pequeño */
    color: #495057;
    height: 32px; /* Altura fija para alinear */
}

.microphone-select:focus {
    outline: none;
    border-color: #FF6B35;
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.25);
}

/* Opciones del selector más pequeñas */
.microphone-select option {
    font-size: 0.75rem;
    padding: 1px 3px;
}

/* Indicador de nivel de audio en línea */
.audio-level-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* No se encoja */
}

/* Barras de nivel de audio más compactas */
.audio-level-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 20px;
}

.level-bar {
    width: 3px; /* Más delgadas */
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    transition: all 0.1s ease;
}

/* Estados activos de las barras */
.level-bar[data-level="1"].active {
    height: 6px;
    background: #28a745;
}

.level-bar[data-level="2"].active {
    height: 10px;
    background: #28a745;
}

.level-bar[data-level="3"].active {
    height: 14px;
    background: #ffc107;
}

.level-bar[data-level="4"].active {
    height: 18px;
    background: #fd7e14;
}

.level-bar[data-level="5"].active {
    height: 20px;
    background: #dc3545;
    animation: levelBarPulse 0.5s ease-in-out infinite alternate;
}

@keyframes levelBarPulse {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

.record-btn:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

.record-btn.recording {
    background: #dc3545; /* Rojo cuando graba */
    animation: recordingPulse 1.5s ease-in-out infinite;
    transform: scale(1.1);
}

.record-btn.recording:hover {
    background: #c82333;
}

@keyframes recordingPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    50% { box-shadow: 0 0 0 8px rgba(220, 53, 69, 0); }
}

.record-icon {
    font-size: 1.1em;
}

/* Mensaje de audio en el chat */
.audio-message {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 8px;
    padding: 12px;
    margin: 8px 0;
    display: flex;
    align-items: flex-start; /* Cambiar a flex-start para mejor alineación */
    gap: 10px;
}

.audio-message-icon {
    font-size: 1.2em;
    color: #1976d2;
    margin-top: 4px; /* Alinear con el audio player */
}

.audio-player {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.audio-player audio {
    width: 100%;
    height: 32px;
}

/* Indicador visual para audio pendiente de reproducción */
.audio-player.audio-pending {
    position: relative;
    animation: audioPulse 2s infinite;
}

.audio-player.audio-pending::before {
    content: "🔊 Click para reproducir";
    position: absolute;
    top: -25px;
    left: 0;
    font-size: 0.7rem;
    background: #FF6B35;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    z-index: 10;
    animation: fadeInOut 2s infinite;
}

@keyframes audioPulse {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.4);
    }
    50% { 
        box-shadow: 0 0 0 8px rgba(255, 107, 53, 0.1);
    }
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.audio-transcription {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
    margin: 0; /* Quitar margin-top ya que usamos gap en flex */
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    border-left: 3px solid #1976d2;
}

/* Responsivo para audio */
@media (max-width: 768px) {
    .audio-controls-inline {
        gap: 8px; /* Menos espacio en móviles */
    }
    
    .microphone-select {
        min-width: 100px; /* Más pequeño en móvil */
        font-size: 0.7rem; /* Texto más pequeño */
        padding: 4px 6px;
        height: 30px; /* Altura ajustada */
    }
    
    .record-btn {
        width: 35px; /* Más pequeño en móviles */
        height: 35px;
    }
    
    .mic-icon {
        width: 16px;
        height: 16px;
    }
    
    .level-bar {
        width: 2px; /* Barras más delgadas en móvil */
    }
}

/* ===== TRANSCRIPCIÓN EN TIEMPO REAL ===== */
.transcription-display {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    margin: 10px 0;
    padding: 0;
    max-height: 120px;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    animation: slideDown 0.3s ease-out;
}

.transcription-header {
    background: linear-gradient(135deg, #007cba, #0056b3);
    color: white;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    gap: 6px;
}

.transcription-text {
    padding: 10px 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #333;
    max-height: 80px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.transcription-text .interim {
    color: #6c757d;
    font-style: italic;
    opacity: 0.8;
}

.transcription-text:empty::before {
    content: "Escuchando...";
    color: #6c757d;
    font-style: italic;
    opacity: 0.7;
}

/* Scrollbar personalizado para transcripción */
.transcription-text::-webkit-scrollbar {
    width: 4px;
}

.transcription-text::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.transcription-text::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.transcription-text::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animación de aparición */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 120px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .transcription-display {
        margin: 8px 0;
        max-height: 100px;
    }
    
    .transcription-header {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    
    .transcription-text {
        padding: 8px 10px;
        font-size: 0.85rem;
        max-height: 65px;
    }
}

/* Sistema de notificaciones y alertas de escritura */
.typing-indicator {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 10001;
    animation: fadeInOut 0.3s ease-in-out;
}

.typing-indicator .dots {
    display: inline-block;
    margin-left: 5px;
}

.typing-indicator .dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #FF6B35;
    margin-right: 2px;
    animation: typingDots 1.4s infinite;
}

.typing-indicator .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDots {
    0%, 60%, 100% { opacity: 0.3; }
    30% { opacity: 1; }
}

/* Notificación flotante cuando la página no está visible */
.floating-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #FF6B35, #e55a2b);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 10002;
    max-width: 300px;
    animation: slideInRight 0.5s ease-out;
}

.floating-notification.call-notification {
    background: linear-gradient(135deg, #dc3545, #c82333);
    animation: callPulse 1s infinite, slideInRight 0.5s ease-out;
}

/* Notificación más llamativa para ventana inactiva */
.floating-notification.urgent-notification {
    background: linear-gradient(135deg, #ff4757, #ff3742);
    animation: urgentPulse 0.8s infinite, slideInRight 0.5s ease-out;
    border: 2px solid #ffffff;
    box-shadow: 0 4px 30px rgba(255, 71, 87, 0.5);
}

@keyframes urgentPulse {
    0%, 100% { 
        transform: scale(1) translateX(0);
        box-shadow: 0 4px 30px rgba(255, 71, 87, 0.5);
    }
    25% { 
        transform: scale(1.05) translateX(0);
        box-shadow: 0 8px 40px rgba(255, 71, 87, 0.8);
    }
    50% { 
        transform: scale(1.02) translateX(0);
        box-shadow: 0 6px 35px rgba(255, 71, 87, 0.6);
    }
    75% { 
        transform: scale(1.08) translateX(0);
        box-shadow: 0 10px 45px rgba(255, 71, 87, 0.9);
    }
}

.floating-notification .notification-icon {
    display: inline-block;
    margin-right: 10px;
    font-size: 1.2rem;
}

.floating-notification .notification-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.floating-notification .notification-text {
    font-weight: 400;
    opacity: 0.9;
}

.floating-notification .notification-close {
    position: absolute;
    top: 5px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.8;
}

.floating-notification .notification-close:hover {
    opacity: 1;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Botón de llamada para IRS */
.call-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(40, 167, 69, 0.4);
    margin-left: 5px;
}

.call-btn:hover {
    background: linear-gradient(135deg, #20c997, #28a745);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.6);
}

.call-btn:active {
    transform: translateY(0);
}

.call-btn.calling {
    animation: callPulse 1s infinite;
}

@keyframes callPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 3px 12px rgba(40, 167, 69, 0.4);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 5px 20px rgba(40, 167, 69, 0.8);
    }
}

/* Indicador de página inactiva */
.page-inactive-indicator {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 107, 53, 0.9);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 10003;
    animation: fadeInOut 0.3s ease-in-out;
}

/* Notificación global para audios pendientes */
.audio-pending-notification {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #1976d2, #1565c0);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    z-index: 10004;
    animation: slideUpBounce 0.5s ease-out;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(25, 118, 210, 0.3);
}

.audio-pending-notification:hover {
    background: linear-gradient(135deg, #1565c0, #1976d2);
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 20px rgba(25, 118, 210, 0.4);
}

.audio-pending-notification .notification-icon {
    margin-right: 8px;
}

@keyframes slideUpBounce {
    0% {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    60% {
        transform: translateX(-50%) translateY(-10px);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Indicador de mensaje urgente en esquina superior izquierda */
.urgent-message-indicator {
    position: fixed;
    top: 10px;
    left: 10px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ff4757, #ff3742);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    z-index: 10005;
    animation: urgentBounce 0.6s infinite, glowPulse 2s infinite;
    cursor: pointer;
    border: 3px solid #ffffff;
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.8);
}

.urgent-message-indicator:hover {
    transform: scale(1.1);
}

@keyframes urgentBounce {
    0%, 100% { 
        transform: translateY(0) scale(1);
    }
    25% { 
        transform: translateY(-8px) scale(1.05);
    }
    50% { 
        transform: translateY(-4px) scale(1.02);
    }
    75% { 
        transform: translateY(-12px) scale(1.08);
    }
}

@keyframes glowPulse {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(255, 71, 87, 0.8);
    }
    50% { 
        box-shadow: 0 0 40px rgba(255, 71, 87, 1), 0 0 60px rgba(255, 71, 87, 0.6);
    }
}

/* Estados de mensajes - Similar a WhatsApp */
.message-status {
    text-align: right;
    margin-top: 4px;
}

.seen-indicator {
    font-size: 0.75rem;
    color: #ccc; /* Gris claro inicial (enviado) */
    transition: color 0.3s ease;
    flex-shrink: 0;
    align-self: flex-end;
    margin-bottom: 3px; /* Alineado con la parte inferior del badge */
    line-height: 1;
    height: fit-content;
}

.seen-indicator.delivered {
    color: #999; /* Gris oscuro (entregado) */
}

.seen-indicator.seen {
    color: #4fc3f7; /* Azul similar a WhatsApp cuando se ve */
}

/* Animación para el cambio de estado */
.seen-indicator {
    display: inline-block;
    transform-origin: center;
}

.seen-indicator.seen {
    animation: seenPulse 0.3s ease-out;
}

@keyframes seenPulse {
    0% {
        transform: scale(1);
        color: #999;
    }
    50% {
        transform: scale(1.2);
        color: #4fc3f7;
    }
    100% {
        transform: scale(1);
        color: #4fc3f7;
    }
}

/* ESTILOS ESPECÍFICOS PARA FORZAR MÁRGENES - ALTA PRIORIDAD */
#irs-basquet-chat-container .chat-sidebar .chat-input-container {
    padding: 3px 6px 5px 6px !important; /* Padding lateral para evitar corte */
    margin: 0 !important;
}

#irs-basquet-chat-container .chat-sidebar .chat-input-wrapper {
    padding: 0 !important;
    margin-bottom: 3px !important;
}

#irs-basquet-chat-container .chat-sidebar #message-input {
    padding: 2px 10px !important; /* Padding vertical mínimo */
    margin: 0 !important;
}

#irs-basquet-chat-container .chat-sidebar .quick-buttons {
    margin: 3px 0 3px 0 !important;
    padding: 1px 6px !important; /* Padding lateral para evitar corte */
}

/* Para móviles - Estilos específicos */
@media (max-width: 768px) {
    #irs-basquet-chat-container .chat-sidebar .chat-input-container {
        padding: 1px 4px 2px 4px !important; /* Padding lateral para evitar corte */
        margin: 0 !important;
    }
    
    #irs-basquet-chat-container .chat-sidebar .quick-buttons {
        margin: 1px 0 1px 0 !important;
        padding: 1px 4px !important; /* Padding lateral para móviles */
    }
}

/* ====== INDICADOR DE CONEXIÓN COMPACTO ====== */
.connection-status-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 10px;
    padding: 0;
    background: none;
    border: none;
    font-size: 11px;
    color: #ccc;
}

.connection-status-inline .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffa500;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

.connection-status-inline.connected {
    color: #000;
}

.connection-status-inline.connected .status-dot {
    background: #4caf50;
    animation: none;
}

.connection-status-inline.disconnected {
    color: #000;
}

.connection-status-inline.disconnected .status-dot {
    background: #f44336;
    animation: pulse 2s infinite;
}

.connection-status-inline .status-text {
    font-size: 11px;
    font-weight: 500;
    font-style: italic;
    color: #000;
    white-space: nowrap;
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.3);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive para indicador compacto */
@media (max-width: 768px) {
    .connection-status-inline {
        font-size: 10px;
        margin-right: 8px;
    }
    
    .connection-status-inline .status-dot {
        width: 8px;
        height: 8px;
    }
    
    .connection-status-inline .status-text {
        font-size: 10px;
        color: #000;
        font-style: italic;
    }
}

/* ===============================================
   SISTEMA DE EMOTICONES - Moderno y Discreto
   =============================================== */

/* Botón de emoticones */
.emoji-btn {
    background: none;
    border: none;
    padding: 8px;
    margin-right: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.emoji-btn:hover {
    background: rgba(0, 123, 255, 0.1);
    transform: scale(1.1);
}

.emoji-btn.active {
    background: rgba(0, 123, 255, 0.2);
}

.emoji-icon {
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.emoji-btn:hover .emoji-icon {
    transform: scale(1.1);
}

/* Panel de emoticones */
.emoji-panel {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    margin-bottom: 8px;
    z-index: 9999 !important; /* Z-index muy alto para estar por encima de todo */
    max-height: 280px;
    animation: emojiPanelSlideUp 0.2s ease-out;
    overflow: hidden;
}

@keyframes emojiPanelSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header del panel con categorías */
.emoji-panel-header {
    border-bottom: 1px solid #f0f0f0;
    padding: 8px;
}

.emoji-categories {
    display: flex;
    gap: 4px;
    justify-content: space-around;
}

.emoji-category-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
    opacity: 0.6;
}

.emoji-category-btn:hover {
    background: rgba(0, 123, 255, 0.1);
    opacity: 1;
}

.emoji-category-btn.active {
    background: rgba(0, 123, 255, 0.15);
    opacity: 1;
}

/* Contenido del panel */
.emoji-panel-content {
    padding: 8px;
    max-height: 200px;
    overflow-y: auto;
}

/* Grid de emoticones */
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    padding: 4px;
}

.emoji-item {
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-size: 1.2rem;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
}

.emoji-item:hover {
    background: rgba(0, 123, 255, 0.1);
    transform: scale(1.2);
}

/* Responsivo para móviles */
@media (max-width: 768px) {
    .emoji-panel {
        max-height: 250px;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .emoji-item {
        font-size: 1.1rem;
        padding: 4px;
    }
}

/* Ajustar el input wrapper para incluir el botón de emojis */
.chat-input-wrapper {
    position: relative !important; /* Para que el panel se posicione correctamente */
    z-index: 1;
}

.chat-input-container {
    position: relative !important;
    z-index: 1;
}

.chat-input-wrapper #message-input {
    padding-left: 52px !important; /* Espacio para el botón de emoji */
}

/* ===============================================
   EMOJIS EN MENSAJES - Tamaño Aumentado
   =============================================== */

/* Hacer que los emojis en los mensajes sean más grandes */
.message-content p {
    font-size: 0.9rem; /* Tamaño base del texto reducido */
    line-height: 1.4;
}

/* Detectar y agrandar emojis dentro de los mensajes */
.message-content p,
.message-content {
    /* Usar una fuente que renderice bien los emojis */
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}

/* Específicamente para emojis - usar CSS que detecte caracteres Unicode de emojis */
.message-content p:has-emoji,
.message-content:has-emoji {
    font-size: 1.4rem; /* Tamaño aumentado para texto con emojis */
}

/* Alternativa más específica usando selectores de contenido */
.message-content p span.emoji,
.message-content .emoji {
    font-size: 1.8rem; /* Doble del tamaño normal */
    line-height: 1.2;
    vertical-align: middle;
}

/* Para mensajes que contienen principalmente emojis */
.message-content p:not(:has(text)):has(emoji),
.message-content.emoji-message {
    font-size: 2rem;
    line-height: 1.3;
}

/* Asegurar que los emojis se vean bien en todos los navegadores */
.message-content {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Clase específica para emojis grandes */
.emoji-large {
    font-size: 2rem !important; /* Exactamente el doble del tamaño normal */
    line-height: 1.2 !important;
    vertical-align: middle;
    display: inline-block;
    margin: 0 2px; /* Pequeño espacio alrededor de cada emoji */
}

/* Hacer que el texto normal tenga un tamaño consistente */
.message-content p {
    font-size: 0.85rem; /* Tamaño base normal reducido */
    line-height: 1.4;
}

/* Asegurar que los emojis grandes se vean bien junto al texto */
.message-content p:has(.emoji-large) {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
}

/* Eliminar márgenes y bordes grises adicionales */
#irs-basquet-chat-container {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* Eliminar márgenes del contenedor principal del chat */
.chat-container {
    margin: 0 !important;
    padding: 0 !important;
    border-right: none !important;
    border-bottom: none !important;
}

/* Asegurar que no hay espacios en blanco innecesarios */
body:has(#irs-basquet-chat-container) {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* Reglas adicionales para ocultar completamente la admin bar de WordPress */
#wpadminbar {
    transform: translateY(-200%) translateX(-200%) !important;
    position: absolute !important;
    top: -200px !important;
    left: -9999px !important;
    width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
    overflow: hidden !important;
    z-index: -99999 !important;
    clip: rect(0,0,0,0) !important;
    pointer-events: none !important;
}

/* Eliminar margin-top que WordPress añade cuando hay admin bar */
body.admin-bar,
html.admin-bar,
body:has(#irs-basquet-chat-container).admin-bar,
body:has(#irs-basquet-login-container).admin-bar {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Forzar que el viewport sea completamente utilizado */
body:has(#irs-basquet-chat-container),
body:has(#irs-basquet-login-container) {
    position: relative !important;
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    overflow-x: hidden !important;
}

/* Asegurar que tampoco se vea en login */
body:has(#irs-basquet-login-container) #wpadminbar {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    top: -500px !important;
}

/* Eliminar cualquier espacio superior en WordPress */
#wpwrap,
#wpcontent,
#wpbody,
#wpbody-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Forzar que los contenedores de WordPress no interfieran */
body:has(#irs-basquet-chat-container) #wpwrap,
body:has(#irs-basquet-chat-container) #wpcontent,
body:has(#irs-basquet-chat-container) #wpbody,
body:has(#irs-basquet-chat-container) #wpbody-content,
body:has(#irs-basquet-login-container) #wpwrap,
body:has(#irs-basquet-login-container) #wpcontent,
body:has(#irs-basquet-login-container) #wpbody,
body:has(#irs-basquet-login-container) #wpbody-content {
    margin: 0 !important;
    padding: 0 !important;
    position: static !important;
}

/* COBERTURA ESPECÍFICA PARA FRANJA GRIS SUPERIOR - Solo para chat */
body:has(#irs-basquet-chat-container):before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100vw;
    height: 50px; /* Cubrir área donde aparece la franja */
    background: var(--accent-orange); /* Color del tema para tapar */
    z-index: -1; /* Detrás del contenido pero delante del fondo */
    display: block;
    pointer-events: none;
}

/* Para login no necesita cobertura ya que tiene su propio fondo */
body:has(#irs-basquet-login-container):before {
    display: none !important;
}

/* Asegurar que el contenido esté completamente pegado arriba */
#irs-basquet-chat-container {
    z-index: 1 !important; /* Por encima de la cobertura (-1) */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important; /* Fondo transparente para chat */
}

#irs-basquet-login-container {
    z-index: 1 !important; /* Por encima de la cobertura (-1) */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-yellow), var(--accent-gold)) !important; /* Fondo del login */
}

/* Eliminar cualquier fondo gris del body cuando hay chat/login activo */
body:has(#irs-basquet-chat-container),
body:has(#irs-basquet-login-container) {
    background: transparent !important;
    overflow: hidden !important;
}

/* Reglas específicas para diferentes temas de WordPress */
.admin-bar body:has(#irs-basquet-chat-container),
.admin-bar body:has(#irs-basquet-login-container) {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Fuerza bruta final - ocultar completamente elementos que puedan causar la franja */
body:has(#irs-basquet-chat-container) .admin-bar,
body:has(#irs-basquet-login-container) .admin-bar,
body:has(#irs-basquet-chat-container) #adminmenumain,
body:has(#irs-basquet-login-container) #adminmenumain,
body:has(#irs-basquet-chat-container) #adminmenuback,
body:has(#irs-basquet-login-container) #adminmenuback {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* REGLAS SUPER AGRESIVAS - Eliminar CUALQUIER cosa que pueda crear espacio arriba */
body:has(#irs-basquet-chat-container) *:not(#irs-basquet-chat-container):not(#irs-basquet-chat-container *),
body:has(#irs-basquet-login-container) *:not(#irs-basquet-login-container):not(#irs-basquet-login-container *) {
    margin-top: 0 !important;
    padding-top: 0 !important;
    top: 0 !important;
}

/* Forzar que TODOS los elementos de WordPress sean invisibles */
body:has(#irs-basquet-chat-container) #wpwrap > *:not(#irs-basquet-chat-container),
body:has(#irs-basquet-login-container) #wpwrap > *:not(#irs-basquet-login-container),
body:has(#irs-basquet-chat-container) body > *:not(#irs-basquet-chat-container):not(script):not(style),
body:has(#irs-basquet-login-container) body > *:not(#irs-basquet-login-container):not(script):not(style) {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    top: -9999px !important;
    left: -9999px !important;
}

/* Reglas específicas para elementos problemáticos */
body:has(#irs-basquet-chat-container) .wp-toolbar,
body:has(#irs-basquet-login-container) .wp-toolbar,
body:has(#irs-basquet-chat-container) #wp-toolbar,
body:has(#irs-basquet-login-container) #wp-toolbar {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    position: absolute !important;
    top: -500px !important;
}

/* SOLUCIÓN NUCLEAR - Forzar que HTML y BODY no tengan NINGÚN espacio superior */
html:has(#irs-basquet-chat-container),
html:has(#irs-basquet-login-container) {
    margin: 0 !important;
    padding: 0 !important;
    height: 100% !important;
    min-height: 100% !important;
    background: transparent !important; /* Cambiar a transparente */
    overflow-x: hidden !important;
}

body:has(#irs-basquet-chat-container),
body:has(#irs-basquet-login-container) {
    margin: 0 !important;
    padding: 0 !important;
    height: 100vh !important;
    min-height: 100vh !important;
    background: transparent !important; /* Cambiar a transparente */
    overflow-x: hidden !important;
    position: relative !important;
}

/* Asegurar que la página comience exactamente en 0,0 */
html, body {
    border: none !important;
    outline: none !important;
}

/* Eliminar elemento de cobertura que estaba tapando todo */
/* Comentado para que no tape el contenido
body:has(#irs-basquet-chat-container):after,
body:has(#irs-basquet-login-container):after {
    content: "";
    position: fixed;
    top: -10px;
    left: 0;
    right: 0;
    width: 100vw;
    height: 100px;
    background: #FF6B35;
    z-index: 999999;
    pointer-events: none;
    display: block;
}
*/
