.messages-container-loading {
    position: relative;
    min-height: 160px;
    background-color: transparent !important;
}

.messages-container-loading .message {
    opacity: 0;
}

/* ===== FUENTES ===== */
@font-face {
    font-family: 'DM Sans';
    src: url('../assets/fuentes/DM_Sans,Oxanium/DM_Sans/DMSans-VariableFont_opsz,wght.ttf') format('truetype-variations');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'DM Sans';
    src: url('../assets/fuentes/DM_Sans,Oxanium/DM_Sans/DMSans-Italic-VariableFont_opsz,wght.ttf') format('truetype-variations');
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Oxanium';
    src: url('../assets/fuentes/DM_Sans,Oxanium/Oxanium/Oxanium-VariableFont_wght.ttf') format('truetype-variations');
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
}

/* ===== FUENTES PERSONALIZADAS ===== */
@font-face {
    font-family: 'DM Sans';
    src: url('../assets/fuentes/DM_Sans,Oxanium/DM_Sans/DMSans-VariableFont_opsz,wght.ttf') format('truetype-variations');
    font-weight: 100 1000;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'DM Sans';
    src: url('../assets/fuentes/DM_Sans,Oxanium/DM_Sans/DMSans-Italic-VariableFont_opsz,wght.ttf') format('truetype-variations');
    font-weight: 100 1000;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Oxanium';
    src: url('../assets/fuentes/DM_Sans,Oxanium/Oxanium/Oxanium-VariableFont_wght.ttf') format('truetype-variations');
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
}

/* ===== VARIABLES CSS ===== */
:root {
    /* Colores principales - Paleta definida */
    --primary-color: #00bfff;      /* Cian principal */
    --secondary-color: #EB00B6;    /* Fucsia secundario */
    --accent-color: #F7FF25;       /* Amarillo terciario */
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    
    /* Colores de fondo */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --bg-quaternary: #dee2e6;
    
    /* Colores de texto - Ajustados para legibilidad en degradado blanco-morado */
    --text-primary: #1a1a1a;        /* Negro suave para máximo contraste */
    --text-secondary: #4a4a4a;      /* Gris oscuro para texto secundario */
    --text-muted: #6a6a6a;         /* Gris medio para texto deshabilitado */
    
    /* Colores de borde */
    --border-color: #dee2e6;
    --border-light: #e9ecef;
    
    /* Tipografía */
    --font-primary: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-secondary: 'Oxanium', 'Courier New', monospace;
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
    
    /* Espaciado */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Bordes redondeados */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Transiciones */
    --transition-fast: 0.15s ease-in-out;
    --transition-medium: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
    
    /* Sombras */
    --shadow-light: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 8px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* ===== TEMA CLARO ===== */
/* Estilos específicos cuando NO está en tema oscuro (tema claro por defecto) */
:root:not([data-theme="dark"]),
html:not([data-theme="dark"]) {
    /* Fondo blanco plano para tema claro */
    background: #ebebeb;
    /* Bordes en color #0D0326 para tema claro */
    --border-color: #0D0326;
    --border-light: #0D0326;
}

/* Aplicar fondo blanco a contenedores principales en tema claro */
:root:not([data-theme="dark"]) #authContainer,
html:not([data-theme="dark"]) #authContainer {
    background: #ebebeb;
}

:root:not([data-theme="dark"]) #appContainer,
html:not([data-theme="dark"]) #appContainer {
    background: #ebebeb;
}

:root:not([data-theme="dark"]) .chat-messages,
html:not([data-theme="dark"]) .chat-messages {
    background: #ebebeb;
}

:root:not([data-theme="dark"]) .message-input,
html:not([data-theme="dark"]) .message-input {
    background: #ebebeb;
}

:root:not([data-theme="dark"]) .room-item,
html:not([data-theme="dark"]) .room-item {
    background: #ffffff;
    border: 1px solid #0D0326;
    border-left: 3px solid #EB00B6;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(13, 3, 38, 0.08);
    transition: all 0.3s ease;
}

:root:not([data-theme="dark"]) .room-item:hover,
html:not([data-theme="dark"]) .room-item:hover {
    background: #f8f8f8;
    border-color: #EB00B6;
    box-shadow: 0 4px 12px rgba(235, 0, 182, 0.15);
    transform: translateY(-2px);
}

:root:not([data-theme="dark"]) .room-item.pinned,
html:not([data-theme="dark"]) .room-item.pinned {
    background: #ffffff;
    border: 1px solid #EB00B6;
    border-left: 3px solid #EB00B6;
    box-shadow: 0 2px 8px rgba(235, 0, 182, 0.2);
}

:root:not([data-theme="dark"]) .room-item.pinned:hover,
html:not([data-theme="dark"]) .room-item.pinned:hover {
    background: #fff5fc;
    border-color: #EB00B6;
    box-shadow: 0 4px 16px rgba(235, 0, 182, 0.25);
    transform: translateY(-2px);
}

:root:not([data-theme="dark"]) .room-item.pinned.active,
html:not([data-theme="dark"]) .room-item.pinned.active {
    background: #0D0326 !important;
    border: 1px solid #EB00B6 !important;
    color: #ffffff !important;
}

:root:not([data-theme="dark"]) .room-item.pinned.active *,
html:not([data-theme="dark"]) .room-item.pinned.active * {
    color: #ffffff !important;
}

:root:not([data-theme="dark"]) .participants-header,
html:not([data-theme="dark"]) .participants-header {
    border-bottom: 1px solid #0D0326 !important;
}

:root:not([data-theme="dark"]) .chat-header,
html:not([data-theme="dark"]) .chat-header {
    border-bottom: 1px solid #0D0326 !important;
}

:root:not([data-theme="dark"]) .empty-chat,
html:not([data-theme="dark"]) .empty-chat {
    background: #ebebeb;
}

:root:not([data-theme="dark"]) .modal-body,
html:not([data-theme="dark"]) .modal-body {
    background: #ffffff;
    border-radius: 0 0 12px 12px;
}

:root:not([data-theme="dark"]) form#createRoomForm.create-room-form,
html:not([data-theme="dark"]) form#createRoomForm.create-room-form {
    background: #ebebeb;
}

:root:not([data-theme="dark"]) .preview-room,
html:not([data-theme="dark"]) .preview-room {
    background: #ebebeb;
}

:root:not([data-theme="dark"]) .modal-preview,
html:not([data-theme="dark"]) .modal-preview {
    background: #ebebeb;
}

:root:not([data-theme="dark"]) .preview-container,
html:not([data-theme="dark"]) .preview-container {
    background: #ebebeb;
}

:root:not([data-theme="dark"]) .preview-messages,
html:not([data-theme="dark"]) .preview-messages {
    background: #ebebeb;
}

:root:not([data-theme="dark"]) .dashboard-section,
html:not([data-theme="dark"]) .dashboard-section {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(13, 3, 38, 0.1);
    border: 1px solid rgba(13, 3, 38, 0.12);
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
}

:root:not([data-theme="dark"]) .dashboard-section::before,
html:not([data-theme="dark"]) .dashboard-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

:root:not([data-theme="dark"]) .dashboard-section:hover,
html:not([data-theme="dark"]) .dashboard-section:hover {
    box-shadow: 0 8px 24px rgba(13, 3, 38, 0.15);
    transform: translateY(-4px);
    border-color: rgba(235, 0, 182, 0.2);
}

:root:not([data-theme="dark"]) .dashboard-section:hover::before,
html:not([data-theme="dark"]) .dashboard-section:hover::before {
    opacity: 1;
}

:root:not([data-theme="dark"]) .popular-room-card,
html:not([data-theme="dark"]) .popular-room-card {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(13, 3, 38, 0.1);
    border: 1px solid rgba(13, 3, 38, 0.1);
    transition: all 0.3s ease;
}

:root:not([data-theme="dark"]) .popular-room-card:hover,
html:not([data-theme="dark"]) .popular-room-card:hover {
    box-shadow: 0 4px 12px rgba(13, 3, 38, 0.15);
    transform: translateY(-2px);
}

/* Estilos de botones y elementos interactivos en tema claro */
:root:not([data-theme="dark"]) .btn-primary,
html:not([data-theme="dark"]) .btn-primary {
    background: linear-gradient(135deg, #00bfff 0%, #EB00B6 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 191, 255, 0.3);
    transition: all 0.3s ease;
    border: none;
}

:root:not([data-theme="dark"]) .btn-primary:hover,
html:not([data-theme="dark"]) .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 191, 255, 0.4);
}

:root:not([data-theme="dark"]) .btn-primary:active,
html:not([data-theme="dark"]) .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 191, 255, 0.3);
}

:root:not([data-theme="dark"]) .user-menu-btn,
html:not([data-theme="dark"]) .user-menu-btn {
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.1), rgba(235, 0, 182, 0.1)) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

:root:not([data-theme="dark"]) .user-menu-btn:hover,
html:not([data-theme="dark"]) .user-menu-btn:hover {
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.2), rgba(235, 0, 182, 0.2)) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 4px 12px rgba(0, 191, 255, 0.3) !important;
}

:root:not([data-theme="dark"]) .user-menu-btn.active,
html:not([data-theme="dark"]) .user-menu-btn.active {
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.25), rgba(235, 0, 182, 0.25)) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 4px 12px rgba(0, 191, 255, 0.4) !important;
}

:root:not([data-theme="dark"]) .dropdown-item:hover,
html:not([data-theme="dark"]) .dropdown-item:hover {
    background: #ebebeb;
}

:root:not([data-theme="dark"]) .dropdown-item.logout-item,
html:not([data-theme="dark"]) .dropdown-item.logout-item {
    color: #ef4444 !important;
}

:root:not([data-theme="dark"]) .dropdown-item.logout-item:hover,
html:not([data-theme="dark"]) .dropdown-item.logout-item:hover {
    background: transparent !important;
    color: #dc2626 !important;
    transform: translateX(4px);
}

:root:not([data-theme="dark"]) .modal-header,
html:not([data-theme="dark"]) .modal-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: var(--spacing-lg) !important;
    border-bottom: 1px solid var(--border-color) !important;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color)) !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    color: white !important;
}

:root:not([data-theme="dark"]) .modal-header *,
html:not([data-theme="dark"]) .modal-header * {
    color: white !important;
}

:root:not([data-theme="dark"]) .modal-title,
html:not([data-theme="dark"]) .modal-title {
    font-family: 'Oxanium', sans-serif !important;
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    color: white !important;
    margin: 0 !important;
}

:root:not([data-theme="dark"]) .modal-close-btn,
html:not([data-theme="dark"]) .modal-close-btn {
    color: #1a1a1a !important;
}

:root:not([data-theme="dark"]) .modal-close-btn:hover,
html:not([data-theme="dark"]) .modal-close-btn:hover {
    color: #1a1a1a !important;
    background: rgba(0, 0, 0, 0.05) !important;
}

:root:not([data-theme="dark"]) .dialog-header,
html:not([data-theme="dark"]) .dialog-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 20px 24px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color)) !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    position: relative !important;
    overflow: hidden !important;
}

:root:not([data-theme="dark"]) .dialog-header::before,
html:not([data-theme="dark"]) .dialog-header::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%) !important;
    pointer-events: none !important;
}

:root:not([data-theme="dark"]) .dialog-header *,
html:not([data-theme="dark"]) .dialog-header * {
    color: white !important;
}

:root:not([data-theme="dark"]) .dialog-title,
html:not([data-theme="dark"]) .dialog-title {
    font-family: 'Oxanium', sans-serif !important;
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    color: white !important;
    margin: 0 !important;
    text-align: left !important;
    flex: 1 !important;
    letter-spacing: 0.5px !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

:root:not([data-theme="dark"]) .modal-footer .modal-confirm,
html:not([data-theme="dark"]) .modal-footer .modal-confirm {
    background: #ebebeb;
}

:root:not([data-theme="dark"]) .preview-buttons .modal-confirm,
html:not([data-theme="dark"]) .preview-buttons .modal-confirm {
    background: #ebebeb;
}

:root:not([data-theme="dark"]) .dashboard-header,
html:not([data-theme="dark"]) .dashboard-header {
    background: #ebebeb;
}

/* Estilos para dropdown-menu (userDropdownMenu) en tema claro */
:root:not([data-theme="dark"]) .dropdown-menu,
html:not([data-theme="dark"]) .dropdown-menu {
    background: #ffffff !important;
    border: 1px solid rgba(13, 3, 38, 0.15) !important;
    color: #1a1a1a !important;
    box-shadow: 0 4px 16px rgba(13, 3, 38, 0.15) !important;
    border-radius: 10px !important;
}

:root:not([data-theme="dark"]) .dropdown-menu .dropdown-item,
html:not([data-theme="dark"]) .dropdown-menu .dropdown-item {
    color: #1a1a1a !important;
}

:root:not([data-theme="dark"]) .dropdown-menu .user-email-info,
html:not([data-theme="dark"]) .dropdown-menu .user-email-info {
    color: #1a1a1a !important;
}

/* Estilos para modal-container en tema claro */
:root:not([data-theme="dark"]) .modal-container,
html:not([data-theme="dark"]) .modal-container {
    background: #ffffff !important;
    border: 1px solid rgba(13, 3, 38, 0.15) !important;
    color: #1a1a1a !important;
    box-shadow: 0 8px 32px rgba(13, 3, 38, 0.2) !important;
    border-radius: 16px !important;
}

/* Asegurar legibilidad de textos en tema claro */
:root:not([data-theme="dark"]) body,
html:not([data-theme="dark"]) body {
    color: #1a1a1a;
}

:root:not([data-theme="dark"]) h1,
:root:not([data-theme="dark"]) h2,
:root:not([data-theme="dark"]) h3,
:root:not([data-theme="dark"]) h4,
:root:not([data-theme="dark"]) h5,
:root:not([data-theme="dark"]) h6,
html:not([data-theme="dark"]) h1,
html:not([data-theme="dark"]) h2,
html:not([data-theme="dark"]) h3,
html:not([data-theme="dark"]) h4,
html:not([data-theme="dark"]) h5,
html:not([data-theme="dark"]) h6 {
    color: #1a1a1a;
}

:root:not([data-theme="dark"]) p,
:root:not([data-theme="dark"]) span,
:root:not([data-theme="dark"]) div,
:root:not([data-theme="dark"]) label,
html:not([data-theme="dark"]) p,
html:not([data-theme="dark"]) span,
html:not([data-theme="dark"]) div,
html:not([data-theme="dark"]) label {
    color: #1a1a1a;
}

:root:not([data-theme="dark"]) .text-secondary,
html:not([data-theme="dark"]) .text-secondary {
    color: #4a4a4a !important;
}

:root:not([data-theme="dark"]) .text-muted,
html:not([data-theme="dark"]) .text-muted {
    color: #6a6a6a !important;
}

/* Textos en botones y elementos interactivos */
:root:not([data-theme="dark"]) .btn-primary,
html:not([data-theme="dark"]) .btn-primary {
    color: #ffffff !important;
}

:root:not([data-theme="dark"]) .user-menu-btn,
html:not([data-theme="dark"]) .user-menu-btn {
    color: white !important;
}

:root:not([data-theme="dark"]) .dropdown-item,
html:not([data-theme="dark"]) .dropdown-item {
    color: #1a1a1a !important;
}

:root:not([data-theme="dark"]) .room-item,
html:not([data-theme="dark"]) .room-item {
    color: #1a1a1a !important;
}

:root:not([data-theme="dark"]) .room-item.active,
html:not([data-theme="dark"]) .room-item.active {
    background: #0D0326 !important;
    color: #ffffff !important;
}

:root:not([data-theme="dark"]) .room-item.active *,
html:not([data-theme="dark"]) .room-item.active * {
    color: #ffffff !important;
}

:root:not([data-theme="dark"]) .message-content,
html:not([data-theme="dark"]) .message-content {
    color: #1a1a1a !important;
}

:root:not([data-theme="dark"]) .modal-body,
html:not([data-theme="dark"]) .modal-body {
    color: #1a1a1a !important;
}

:root:not([data-theme="dark"]) input,
:root:not([data-theme="dark"]) textarea,
:root:not([data-theme="dark"]) select,
html:not([data-theme="dark"]) input,
html:not([data-theme="dark"]) textarea,
html:not([data-theme="dark"]) select {
    color: #1a1a1a !important;
}

:root:not([data-theme="dark"]) input::placeholder,
:root:not([data-theme="dark"]) textarea::placeholder,
html:not([data-theme="dark"]) input::placeholder,
html:not([data-theme="dark"]) textarea::placeholder {
    color: #6a6a6a !important;
}

/* ===== TEMA OSCURO ===== */
[data-theme="dark"] {
    /* Colores de fondo - Grises suaves */
    --bg-primary: #2d3748;
    --bg-secondary: #4a5568;
    --bg-tertiary: #718096;
    --bg-quaternary: #a0aec0;
    
    /* Colores de texto */
    --text-primary: #f7fafc;
    --text-secondary: #e2e8f0;
    --text-muted: #a0aec0;
    
    /* Colores de borde */
    --border-color: #4a5568;
    --border-light: #718096;
    
    /* Sombras ajustadas para tema oscuro */
    --shadow-light: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-medium: 0 4px 8px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Estilos específicos del tema oscuro para input container */
[data-theme="dark"] .input-container {
    background-color: #0f0123;
}

/* Estilos específicos del tema oscuro para layout principal */
[data-theme="dark"] .sidebar-left,
[data-theme="dark"] .sidebar-right,
[data-theme="dark"] .main-content {
    background-color: #0f0123;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Estilos específicos del tema oscuro para chat input */
[data-theme="dark"] .chat-input {
    background-color: #2d3748;
    border-top: 2px solid #4a5568;
}

/* Estilos específicos del tema oscuro para área de mensajes */
[data-theme="dark"] .chat-messages {
    background: linear-gradient(180deg, rgba(13, 3, 38, 0.7) 0%, rgba(8, 6, 24, 0.7) 100%);
}

/* Estilos específicos del tema oscuro para scrollbar */
[data-theme="dark"] .chat-messages::-webkit-scrollbar-track {
    background: #4a5568;
}

[data-theme="dark"] .chat-messages::-webkit-scrollbar-thumb {
    background: #718096;
}

[data-theme="dark"] .chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Estilos para la scrollbar del messageInput en tema oscuro */
[data-theme="dark"] .message-input::-webkit-scrollbar {
    width: 8px;
}

[data-theme="dark"] .message-input::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .message-input::-webkit-scrollbar-thumb {
    background: var(--border-color);
}

[data-theme="dark"] .message-input::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Para Firefox */
[data-theme="dark"] .message-input {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-tertiary);
}


/* Estilos específicos del tema oscuro para headers de sidebar */
[data-theme="dark"] .sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    position: relative;
}

/* Estilos específicos del tema oscuro para notificaciones */
[data-theme="dark"] .notification {
    background-color: #4a5568;
    color: #f7fafc;
    border-left: 4px solid #718096;
}

[data-theme="dark"] .notification-close {
    color: #a0aec0;
}

[data-theme="dark"] .notification-close:hover {
    color: #f7fafc;
}

/* Estilos específicos del tema oscuro para elementos de input */
[data-theme="dark"] .message-input {
    background: linear-gradient(180deg, rgba(13, 3, 38, 0.7) 0%, rgba(8, 6, 24, 0.7) 100%);
    color: #f7fafc;
    border: 1px solid #718096;
}

[data-theme="dark"] .message-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.2);
}

[data-theme="dark"] .message-input::placeholder {
    color: #a0aec0;
}

/* El botón de emojis ya usa variables CSS que se adaptan automáticamente */

/* Estilos específicos del tema oscuro para headers específicos */
[data-theme="dark"] .chat-header {
    background-color: #0f0123;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    position: relative;
}

[data-theme="dark"] .chat-header,
[data-theme="dark"] .chat-header * {
    color: white !important;
}

[data-theme="dark"] .chat-header .room-title {
    color: white !important;
}

[data-theme="dark"] .chat-header .connection-status {
    color: white !important;
}

[data-theme="dark"] .sidebar-header {
    background-color: #0f0123;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    position: relative;
}

[data-theme="dark"] .participants-header {
    background-color: #0f0123;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    position: relative;
}


/* Estilos específicos del tema oscuro para elementos de listas */
[data-theme="dark"] .room-list,
[data-theme="dark"] .participants-list {
    background-color: #2d3748;
}

/* Estilos específicos del tema oscuro para elementos de mensajes */
[data-theme="dark"] .message-content {
    background-color: #4a5568;
    color: #f7fafc;
}

/* Estilos específicos del tema oscuro para títulos */
[data-theme="dark"] .room-title,
[data-theme="dark"] .participants-title {
    color: #f7fafc;
}

[data-theme="dark"] .participant-count {
    color: #a0aec0;
}

/* Estilos específicos del tema oscuro para input de ID de sala */
[data-theme="dark"] .join-room-input {
    background-color: #4a5568;
    color: #f7fafc;
    border: 1px solid #718096;
}

[data-theme="dark"] .join-room-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.2);
}

[data-theme="dark"] .join-room-input::placeholder {
    color: #a0aec0;
}

/* Estilos específicos del tema oscuro para room items */
[data-theme="dark"] .room-item {
    background: linear-gradient(180deg, #0D0326 0%, #080618 100%);
    color: #f7fafc;
    border-left: 3px solid #EB00B6;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .room-item:hover {
    background: linear-gradient(180deg, #0D0326 0%, #080618 100%);
    border-color: rgba(0, 191, 255, 0.3);
}

[data-theme="dark"] .room-item.active {
    background-color: #2d3748;
    border-left-color: var(--primary-color);
}

[data-theme="dark"] .room-name {
    color: #f7fafc;
}

/* Estilos específicos del tema oscuro para salas pineadas */
[data-theme="dark"] .room-item.pinned {
    background: linear-gradient(180deg, #0D0326 0%, #080618 100%);
    border-left: 3px solid var(--accent-color);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .room-item.pinned:hover {
    background: linear-gradient(180deg, #0D0326 0%, #080618 100%);
    border-color: rgba(0, 191, 255, 0.3);
}

[data-theme="dark"] .room-item.pinned.active {
    background-color: #2d3748;
    border-left-color: var(--primary-color);
}

/* Estilos del botón de pin (tema claro y oscuro) */
.pin-room-btn {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    font-size: 1.2rem;
    transition: color var(--transition-fast);
    padding: 2px;
    margin-right: 8px;
}

.pin-room-btn:hover {
    color: var(--accent-color);
}

.pin-room-btn.pinned {
    color: var(--accent-color);
}

/* Estilos específicos del tema oscuro para botón de pin */
[data-theme="dark"] .pin-room-btn {
    color: #a0aec0;
}

[data-theme="dark"] .pin-room-btn:hover {
    color: var(--accent-color);
}

[data-theme="dark"] .pin-room-btn.pinned {
    color: var(--accent-color);
}

/* Estilos específicos del tema oscuro para botón de emojis */
[data-theme="dark"] .emoji-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
}

[data-theme="dark"] .emoji-btn:hover {
    background-color: #d4009e;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(235, 0, 182, 0.4);
}

[data-theme="dark"] .emoji-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(235, 0, 182, 0.4);
}

/* Aplicar estilos del tema oscuro al tema claro */
:root:not([data-theme="dark"]) .emoji-btn,
html:not([data-theme="dark"]) .emoji-btn {
    background-color: var(--secondary-color) !important;
    color: white !important;
    border: none !important;
}

:root:not([data-theme="dark"]) .emoji-btn:hover,
html:not([data-theme="dark"]) .emoji-btn:hover {
    background-color: #d4009e !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(235, 0, 182, 0.4) !important;
}

:root:not([data-theme="dark"]) .emoji-btn:active,
html:not([data-theme="dark"]) .emoji-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(235, 0, 182, 0.4) !important;
}

/* Estilos específicos del tema oscuro para botón de enviar */
[data-theme="dark"] .send-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

[data-theme="dark"] .send-btn:hover {
    background-color: #0099cc;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 191, 255, 0.4);
}

[data-theme="dark"] .send-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 191, 255, 0.4);
}

[data-theme="dark"] .send-btn:disabled {
    background-color: #718096;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Estilos específicos del tema oscuro para menú desplegable */
[data-theme="dark"] .dropdown-menu {
    background: rgba(13, 3, 38, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .dropdown-item {
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .dropdown-item:hover {
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.15), rgba(235, 0, 182, 0.15));
    color: rgba(255, 255, 255, 1);
}

[data-theme="dark"] .dropdown-item.logout-item:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.2));
    color: #ef4444;
}

[data-theme="dark"] .dropdown-icon {
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .dropdown-divider {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

/* Estilos específicos del tema oscuro para botón del menú */
[data-theme="dark"] .user-menu-btn {
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.1), rgba(235, 0, 182, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .user-menu-btn:hover {
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.2), rgba(235, 0, 182, 0.2));
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 12px rgba(0, 191, 255, 0.3);
}

[data-theme="dark"] .user-menu-btn.active {
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.25), rgba(235, 0, 182, 0.25));
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 191, 255, 0.4);
}

/* Estilos específicos del tema oscuro para formularios de autenticación */
[data-theme="dark"] .auth-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .form-group label {
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .form-group input {
    background-color: #4a5568;
    color: #f7fafc;
    border: 2px solid #718096;
}

[data-theme="dark"] .form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.2);
}

[data-theme="dark"] .form-group input::placeholder {
    color: #a0aec0;
}

[data-theme="dark"] .form-group input.error {
    border-color: #ff6b6b;
}

[data-theme="dark"] .field-error {
    color: #ff6b6b;
}

[data-theme="dark"] .auth-buttons button {
    background-color: var(--primary-color);
    color: white;
}

[data-theme="dark"] .auth-buttons button:hover {
    background-color: #0099cc;
}

[data-theme="dark"] .auth-buttons button.secondary {
    background-color: var(--secondary-color);
}

[data-theme="dark"] .auth-buttons button.secondary:hover {
    background-color: #d4009e;
}

/* Estilos específicos del tema oscuro para header del login */
[data-theme="dark"] .app-header {
    color: #f7fafc;
}

[data-theme="dark"] .app-subtitle {
    color: #e2e8f0;
}

/* Estilos específicos del tema oscuro para texto de login */
[data-theme="dark"] .auth-form h2 {
    color: #f7fafc;
}

/* Estilos específicos del tema oscuro para selector de idioma - OCULTO */
[data-theme="dark"] .language-select,
[data-theme="dark"] .language-selector,
[data-theme="dark"] .custom-language-selector,
[data-theme="dark"] .custom-language-button {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
}

/* Hacer visible el selector de idioma en el login - SOBRESCRIBIR ESTILOS DE OCULTACIÓN */
#authContainer .app-header .language-selector,
[data-theme="dark"] #authContainer .app-header .language-selector,
:root #authContainer .app-header .language-selector,
:root:not([data-theme="dark"]) #authContainer .app-header .language-selector {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: auto !important;
    height: auto !important;
}

#authContainer .app-header #languageSelector,
#authContainer .app-header .language-select,
[data-theme="dark"] #authContainer .app-header #languageSelector,
[data-theme="dark"] #authContainer .app-header .language-select,
:root #authContainer .app-header #languageSelector,
:root #authContainer .app-header .language-select,
:root:not([data-theme="dark"]) #authContainer .app-header #languageSelector,
:root:not([data-theme="dark"]) #authContainer .app-header .language-select {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: auto !important;
    height: auto !important;
    position: absolute !important;
    left: -9999px !important;
    pointer-events: none !important;
}

[data-theme="dark"] .language-select:focus {
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.2), rgba(235, 0, 182, 0.2)) !important;
    border-color: rgba(0, 191, 255, 0.5) !important;
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.2) !important;
}

/* Estilos específicos del tema oscuro para textbox del login - mayor especificidad */
[data-theme="dark"] .auth-container .form-group input {
    background-color: rgba(13, 3, 38, 0.6) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

[data-theme="dark"] .auth-container .form-group input:focus {
    background-color: rgba(13, 3, 38, 0.8) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.2) !important;
}

[data-theme="dark"] .auth-container .form-group input::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

[data-theme="dark"] .auth-container .form-group input.error {
    border-color: #ff6b6b !important;
}

/* Estilos específicos del tema oscuro para botones del login - mayor especificidad */
[data-theme="dark"] .auth-container .auth-buttons button {
    background-color: var(--primary-color) !important;
    color: white !important;
    border: none !important;
}

[data-theme="dark"] .auth-container .auth-buttons button:hover {
    background-color: #0099cc !important;
}

[data-theme="dark"] .auth-container .auth-buttons button.secondary {
    background-color: var(--secondary-color) !important;
}

[data-theme="dark"] .auth-container .auth-buttons button.secondary:hover {
    background-color: #d4009e !important;
}

/* Estilos específicos del tema oscuro para inputs específicos del login */
[data-theme="dark"] #loginEmail,
[data-theme="dark"] #loginPassword {
    background-color: #4a5568 !important;
    color: #f7fafc !important;
    border: 2px solid #718096 !important;
}

[data-theme="dark"] #loginEmail:focus,
[data-theme="dark"] #loginPassword:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.2) !important;
}

[data-theme="dark"] #loginEmail::placeholder,
[data-theme="dark"] #loginPassword::placeholder {
    color: #a0aec0 !important;
}

/* Estilos específicos del tema oscuro para inputs del registro */
[data-theme="dark"] #registerEmail,
[data-theme="dark"] #registerPassword {
    background-color: #4a5568 !important;
    color: #f7fafc !important;
    border: 2px solid #718096 !important;
}

/* Estilos para logos según el tema */
/* Tema claro: logo positivo */
#authContainer .app-logo,
:root:not([data-theme="dark"]) #authContainer .app-logo,
html:not([data-theme="dark"]) #authContainer .app-logo {
    content: url('../assets/logos/logo_positivo_tagline.svg');
}

/* Tema oscuro: logo negativo */
[data-theme="dark"] #authContainer .app-logo {
    content: url('../assets/logos/logo_negativo_tagine_colores.svg');
}

/* Logo en el formulario de login - tema claro: positivo */
.login-logo,
:root:not([data-theme="dark"]) .login-logo,
html:not([data-theme="dark"]) .login-logo {
    content: url('../assets/logos/logo_positivo_tagline.svg');
}

/* Logo en el formulario de login - tema oscuro: negativo */
[data-theme="dark"] .login-logo {
    content: url('../assets/logos/logo_negativo_tagine_colores.svg');
}

/* Logo en el formulario de registro - tema claro: positivo */
.register-logo,
:root:not([data-theme="dark"]) .register-logo,
html:not([data-theme="dark"]) .register-logo {
    content: url('../assets/logos/logo_positivo_tagline.svg');
}

/* Logo en el formulario de registro - tema oscuro: negativo */
[data-theme="dark"] .register-logo {
    content: url('../assets/logos/logo_negativo_tagine_colores.svg');
}

[data-theme="dark"] #registerEmail:focus,
[data-theme="dark"] #registerPassword:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.2) !important;
}

[data-theme="dark"] #registerEmail::placeholder,
[data-theme="dark"] #registerPassword::placeholder {
    color: #a0aec0 !important;
}

/* Estilos adicionales de tema oscuro para auth (movidos desde auth.css) */
[data-theme="dark"] .form-group input {
    background-color: #4a5568 !important;
    color: #f7fafc !important;
    border: 2px solid #718096 !important;
}

[data-theme="dark"] .form-group input:focus {
    background-color: #4a5568 !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.2) !important;
}

[data-theme="dark"] .form-group input::placeholder {
    color: #a0aec0 !important;
}

[data-theme="dark"] .auth-buttons .btn {
    background-color: var(--primary-color) !important;
    color: white !important;
    border: none !important;
}

[data-theme="dark"] .auth-buttons .btn:hover {
    background-color: #0099cc !important;
}

[data-theme="dark"] .auth-buttons .btn.secondary {
    background-color: var(--secondary-color) !important;
}

[data-theme="dark"] .auth-buttons .btn.secondary:hover {
    background-color: #d4009e !important;
}

/* Estilos ultra específicos para inputs del login - máxima prioridad */
[data-theme="dark"] #authContainer .form-group input,
[data-theme="dark"] #authContainer #loginEmail,
[data-theme="dark"] #authContainer #loginPassword,
[data-theme="dark"] #authContainer #registerEmail,
[data-theme="dark"] #authContainer #registerPassword {
    background-color: #4a5568 !important;
    color: #f7fafc !important;
    border: 2px solid #718096 !important;
}

[data-theme="dark"] #authContainer .form-group input:focus,
[data-theme="dark"] #authContainer #loginEmail:focus,
[data-theme="dark"] #authContainer #loginPassword:focus,
[data-theme="dark"] #authContainer #registerEmail:focus,
[data-theme="dark"] #authContainer #registerPassword:focus {
    background-color: #4a5568 !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.2) !important;
}

/* Estilos con máxima especificidad posible - forzar aplicación */
html[data-theme="dark"] #authContainer .form-group input,
html[data-theme="dark"] #authContainer #loginEmail,
html[data-theme="dark"] #authContainer #loginPassword,
html[data-theme="dark"] #authContainer #registerEmail,
html[data-theme="dark"] #authContainer #registerPassword {
    background-color: #4a5568 !important;
    background: #4a5568 !important;
    color: #f7fafc !important;
    border: 2px solid #718096 !important;
}

html[data-theme="dark"] #authContainer .form-group input:focus,
html[data-theme="dark"] #authContainer #loginEmail:focus,
html[data-theme="dark"] #authContainer #loginPassword:focus,
html[data-theme="dark"] #authContainer #registerEmail:focus,
html[data-theme="dark"] #authContainer #registerPassword:focus {
    background-color: #4a5568 !important;
    background: #4a5568 !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.2) !important;
}

/* Estilos específicos del tema oscuro para scrollbars de listas */
[data-theme="dark"] .rooms-list::-webkit-scrollbar-track,
[data-theme="dark"] #participantsList::-webkit-scrollbar-track {
    background: #4a5568;
}

[data-theme="dark"] .rooms-list::-webkit-scrollbar-thumb,
[data-theme="dark"] #participantsList::-webkit-scrollbar-thumb {
    background: #718096;
}

[data-theme="dark"] .rooms-list::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] #participantsList::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* ===== ESTILOS GLOBALES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow: hidden;
}

/* Permitir scroll cuando authContainer está visible */
html:has(#authContainer:not(.hidden)),
html.auth-page {
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100vh;
}

body {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-regular);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    margin: 0;
    padding: 0;
    overflow: hidden; /* Evita scrollbars innecesarios */
}

/* Permitir scroll cuando authContainer está visible */
body:has(#authContainer:not(.hidden)),
body.auth-page {
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100vh;
    display: flex !important;
    flex-direction: column !important;
    padding-bottom: 0 !important;
}

.hidden {
    display: none !important;
}

/* ===== CONTENEDORES PRINCIPALES ===== */
#authContainer {
    min-height: 100vh;
    padding: 20px;
    padding-bottom: 60px;
    background: 
        radial-gradient(ellipse at 20% 80%, rgba(0, 191, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(235, 0, 182, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(13, 3, 38, 1) 0%, rgba(8, 6, 24, 1) 100%);
    display: flex;
    flex-direction: column;
    position: relative;
    box-sizing: border-box;
}

/* Ocultar logo cuando se muestra el registro o login, pero mantener el selector de idioma */
#authContainer:has(#registerForm:not(.hidden)) .app-header .logo-container,
#authContainer:has(#loginForm:not(.hidden)) .app-header .logo-container {
    display: none !important;
}

/* Asegurar que el background cubra toda la página cuando se muestra el registro */
#authContainer:has(#registerForm:not(.hidden)) {
    min-height: 100vh;
    background: 
        radial-gradient(ellipse at 20% 80%, rgba(0, 191, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(235, 0, 182, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(13, 3, 38, 1) 0%, rgba(8, 6, 24, 1) 100%);
}

#appContainer {
    height: calc(100vh - 50px);
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: 
        radial-gradient(ellipse at 20% 80%, rgba(0, 191, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(235, 0, 182, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(13, 3, 38, 1) 0%, rgba(8, 6, 24, 1) 100%);
}

/* ===== TIPOGRAFÍA Y TÍTULOS ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-secondary);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0 0 var(--spacing-md) 0;
}

h1 {
    font-size: 2.5rem;
    font-weight: var(--font-weight-bold);
    color: var(--primary-color);
}

h2 {
    font-size: 2rem;
    font-weight: var(--font-weight-semibold);
    color: var(--secondary-color);
}

h3 {
    font-size: 1.5rem;
    font-weight: var(--font-weight-medium);
}

h4 {
    font-size: 1.25rem;
    font-weight: var(--font-weight-medium);
}

h5 {
    font-size: 1.125rem;
    font-weight: var(--font-weight-regular);
}

h6 {
    font-size: 1rem;
    font-weight: var(--font-weight-regular);
}

/* ===== HEADER Y TÍTULO ===== */
.app-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.logo-container {
    margin-bottom: var(--spacing-md);
    margin-top: 40px;
}

.app-logo {
    height: 120px;
    width: auto;
    max-width: 250px;
    object-fit: contain;
    object-position: center;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    transition: transform var(--transition-fast);
}

.app-logo:hover {
    transform: scale(1.05);
}

.app-title {
    font-family: var(--font-secondary);
    font-size: 2.5rem;
    font-weight: var(--font-weight-bold);
    color: var(--primary-color);
    margin-bottom: 10px;
}

.app-subtitle {
    font-family: var(--font-secondary);
    font-size: 1.8rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
    margin-top: 10px;
    font-weight: var(--font-weight-bold);
    letter-spacing: 2px;
}

/* ===== HEADER PRINCIPAL DE LA APLICACIÓN ===== */
.app-header-main {
    background: 
        radial-gradient(ellipse at 20% 80%, rgba(0, 191, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(235, 0, 182, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(13, 3, 38, 1) 0%, rgba(8, 6, 24, 1) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: white;
    padding: 6px var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Aplicar estilos del tema oscuro al tema claro */
:root:not([data-theme="dark"]) .app-header-main,
html:not([data-theme="dark"]) .app-header-main {
    background: 
        radial-gradient(ellipse at 20% 80%, rgba(0, 191, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(235, 0, 182, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(13, 3, 38, 1) 0%, rgba(8, 6, 24, 1) 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    color: white !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    flex-shrink: 0; /* Evita que el header se comprima */
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 0;
    margin: 0;
}

.header-left .logo-container {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    overflow: visible;
}

.header-left .app-logo {
    max-height: 50px;
    height: auto;
    width: 100%;
    max-width: 200px;
    object-fit: contain;
    object-position: center;
    /* Logo con colores originales en fondo oscuro */
}

.header-left .app-title {
    font-family: var(--font-secondary);
    font-size: 1.35rem;
    font-weight: var(--font-weight-bold);
    color: white;
    margin: 0;
}

/* Ajustar color del título en tema claro */
:root:not([data-theme="dark"]) .header-left .app-title,
html:not([data-theme="dark"]) .header-left .app-title {
    color: #1a1a1a !important;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.header-right .user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    height: 45px;
}

.header-right .user-email {
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: var(--font-weight-semibold);
    color: rgba(255, 255, 255, 1);
    margin: 0;
    line-height: 1.3;
    background-color: rgba(0, 0, 0, 0.4);
    padding: 6px 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    height: 30px;
    box-sizing: border-box;
}

.header-right .btn-danger {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 0.9rem;
    padding: 10px 16px;
    transition: all var(--transition-fast);
    height: 45px;
    display: flex;
    align-items: center;
}

.header-right .btn-danger:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

/* ===== MENÚ DESPLEGABLE DE USUARIO ===== */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-menu-btn {
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.1), rgba(235, 0, 182, 0.1));
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 8px 13px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Ajustar color del botón de usuario en tema claro */
:root:not([data-theme="dark"]) .user-menu-btn,
html:not([data-theme="dark"]) .user-menu-btn {
    color: white !important;
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.1), rgba(235, 0, 182, 0.1)) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.user-menu-btn:hover {
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.2), rgba(235, 0, 182, 0.2));
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 191, 255, 0.3);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
    border: 2px solid var(--primary-color);
    overflow: hidden;
    position: relative;
}

.user-avatar.has-image {
    background-color: transparent;
    border-color: rgba(255, 255, 255, 0.2);
}

.user-avatar.has-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.user-menu-btn:hover .user-avatar {
    border-color: var(--primary-color);
    transition: all 0.3s ease;
}

.user-menu-btn:hover .user-avatar.has-image {
    border-color: rgba(255, 255, 255, 0.3);
}

.dropdown-arrow {
    font-size: 0.8rem;
    transition: transform var(--transition-fast);
    color: #EB00B6 !important;
}

.user-menu-btn.active {
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.25), rgba(235, 0, 182, 0.25));
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 191, 255, 0.4);
}

.user-menu-btn.active .dropdown-arrow {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(13, 3, 38, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
    min-width: 220px;
    z-index: 1000;
    margin-top: 8px;
    overflow: hidden;
    padding: 8px 0;
}

.dropdown-item {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    border-radius: 0;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.15), rgba(235, 0, 182, 0.15));
    color: rgba(255, 255, 255, 1);
    transform: translateX(4px);
}

.dropdown-item.logout-item {
    color: rgba(255, 255, 255, 0.9);
}

.dropdown-item.logout-item:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.2));
    color: #ef4444;
    transform: translateX(4px);
}

.dropdown-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.dropdown-item:hover .dropdown-icon {
    transform: scale(1.1);
}

.dropdown-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    margin: 8px 0;
    border: none;
}

/* Ajustar divider en tema claro */
:root:not([data-theme="dark"]) .dropdown-divider,
html:not([data-theme="dark"]) .dropdown-divider {
    background: linear-gradient(90deg, transparent, #0D0326, transparent) !important;
}

/* Estilos para la información del email en el dropdown */
.user-email-info {
    padding: 12px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    text-align: left;
    margin: 0;
    font-family: 'DM Sans', sans-serif;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 4px;
}

/* Estilos para tema oscuro */
[data-theme="dark"] .user-email-info {
    color: rgba(255, 255, 255, 0.7);
}

.theme-text {
    flex: 1;
}

/* Animación de entrada del dropdown */
.dropdown-menu:not(.hidden) {
    animation: dropdownFadeIn 0.3s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== FORMULARIOS DE AUTENTICACIÓN ===== */
.auth-container {
    max-width: 400px;
    margin: 0 auto;
    background: #ffffff;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(13, 3, 38, 0.15);
    border: 1px solid rgba(13, 3, 38, 0.1);
}

.auth-form {
    margin-bottom: 20px;
}

.scrollable-form {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 10px;
}

.scrollable-form::-webkit-scrollbar {
    width: 6px;
}

.scrollable-form::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.scrollable-form::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.scrollable-form::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ===== FOOTER LEGAL ===== */
/* ===== FOOTER - Estilo Landing Page ===== */
.legal-footer {
    padding: 10px 40px 20px 40px;
    background: #0D0326;
    border-top: none !important;
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
    display: block;
    visibility: visible;
    opacity: 1;
    min-height: auto;
    width: 100%;
    box-sizing: border-box;
}

/* Footer móvil - solo visible en mobile */
.legal-footer.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .legal-footer.mobile-only {
        display: block;
        padding: 15px 20px;
        margin-top: 10px;
    }
}

/* Footer cuando authContainer está visible - usar selector más específico */
#authContainer:not(.hidden) ~ .legal-footer,
body:has(#authContainer:not(.hidden)) .legal-footer,
body.auth-page .legal-footer {
    margin-top: auto;
    padding-top: 20px;
    padding-bottom: 20px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
    display: block;
    visibility: visible;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    text-align: center;
}

.footer-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--text-muted, #8b8b9a);
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 0.75rem;
    font-weight: 400;
}

.footer-links a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.footer-copyright {
    text-align: center;
    flex: none;
}

.footer-copyright p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-subtle, #5a5a6a);
    opacity: 1;
}

.footer-copyright span {
    display: inline;
    color: #ffffff;
    font-size: 12px;
    opacity: 1;
    visibility: visible;
}

.footer-copyright span[data-i18n="footer.rights"],
.footer-copyright span span {
    color: #ffffff !important;
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .footer-links {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        gap: 8px;
    }
    
    .footer-links a {
        font-size: 0.875rem;
        text-align: center;
    }
}

.password-validation {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.validation-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    font-size: 14px;
}

.validation-item:last-child {
    margin-bottom: 0;
}

.validation-icon {
    margin-right: 8px;
    font-size: 16px;
}

.validation-text {
    color: #6c757d;
}

.validation-item.valid .validation-icon {
    color: #28a745;
}

.validation-item.valid .validation-text {
    color: #28a745;
}

.validation-item.invalid .validation-icon {
    color: #dc3545;
}

.validation-item.invalid .validation-text {
    color: #dc3545;
}

.password-match-validation {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #34495e;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
    background-color: #f8f9fa;
    color: #333;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
}

.form-group input.error {
    border-color: #e74c3c;
}

.field-error {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 5px;
}

.auth-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.auth-buttons button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #00bfff 0%, #EB00B6 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 24px;
    box-shadow: 0 4px 20px rgba(0, 191, 255, 0.3);
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 120px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #00bfff 0%, #EB00B6 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 191, 255, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 191, 255, 0.3);
}

.btn-primary:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 120px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(235, 0, 182, 0.3);
}

.btn-secondary:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 120px;
}

.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-danger:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
}

.btn-danger:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== INTERFAZ PRINCIPAL ===== */
.app-layout {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    grid-template-rows: 1fr; /* Fuerza que ocupe toda la altura disponible */
    gap: 20px;
    flex: 1;
    padding: 10px 10px 10px 0;
    box-sizing: border-box;
    overflow: hidden;
    height: 100%; /* Asegura que ocupe toda la altura */
}

/* ===== BARRA LATERAL IZQUIERDA (SALAS) ===== */
.sidebar-left {
    background: #ebebeb;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0; /* Permite que se ajuste correctamente */
}

.sidebar-header {
    padding: 20px 20px 15px 20px;
    border-bottom: 2px solid #ecf0f1;
    flex-shrink: 0;
    background: #ebebeb;
    border-radius: 10px 10px 0 0;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 20px 20px 20px; /* Padding bottom para separación del borde */
    min-height: 0;
    display: flex;
    flex-direction: column;
}


.user-info {
    margin-bottom: 10px;
    text-align: center;
}

.user-email {
    font-size: 12px;
    color: #6c757d;
    background-color: #f8f9fa;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    word-break: break-all;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.create-room-btn {
    width: 100%;
    padding: 10px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
    margin-bottom: 10px;
}

.create-room-btn:hover {
    background-color: #d4009e;
}

.join-room-btn-full {
    width: 100%;
    padding: 10px 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background-color 0.3s, transform 0.2s;
    margin-bottom: 10px;
    box-sizing: border-box;
    white-space: nowrap;
}

.join-room-btn-full:hover {
    background-color: #0099cc;
}

.join-room-btn-full:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.create-room-form {
    margin: 0;
    padding: 0;
    background-color: transparent;
    border-radius: 0;
    border: none;
}

.create-room-form input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 14px;
}

.create-room-form input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.create-room-form .form-buttons {
    display: flex;
    gap: 10px;
}

.create-room-form button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background-color 0.3s;
}

.rooms-list {
    margin: 20px 0 0 0; /* Sin margin bottom para que vaya hasta abajo */
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 5px;
    position: relative;
}

.rooms-list #roomsList {
    padding-bottom: 10px;
}

/* Scrollbar personalizado para la lista de salas */
.rooms-list::-webkit-scrollbar {
    width: 6px;
}

.rooms-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.rooms-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.rooms-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.room-item {
    position: relative;
    padding: 12px;
    margin-bottom: 8px;
    background-color: #f8f9fa;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    border-left: 3px solid #EB00B6;
}

.room-item:hover {
    background-color: #e9ecef;
}

.room-item.active {
    background-color: #d4edda;
    border-left-color: #28a745;
}

.room-name {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.room-role {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
}

.room-date {
    font-size: 11px;
    color: #adb5bd;
    margin-top: 5px;
}

/* ===== ÁREA PRINCIPAL (CHAT) ===== */
.main-content {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(13, 3, 38, 0.1);
    border: 1px solid rgba(13, 3, 38, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0; /* Permite que se ajuste correctamente */
    overflow: hidden;
}

.chat-header {
    padding: 6px 20px 6px 20px;
    border-bottom: 2px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background: #ffffff;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 2px 4px rgba(13, 3, 38, 0.05);
}

.room-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    display: flex;
    align-items: center;
    height: 100%;
}

.chat-header,
.chat-header * {
    color: white !important;
}

.chat-header .room-title {
    color: white !important;
}

.chat-header .connection-status {
    color: white !important;
}

/* Estilos para desktop - textos en negro */
@media (min-width: 769px) {
    .chat-header,
    .chat-header * {
        color: #1a1a1a !important;
    }

    .chat-header .room-title {
        color: #1a1a1a !important;
    }

    .chat-header .connection-status {
        color: #1a1a1a !important;
    }
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 15px;
    font-weight: 500;
}

.connection-status.connected {
    background-color: #d4edda;
    color: #155724;
}

.connection-status.disconnected {
    background-color: #f8d7da;
    color: #721c24;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f8f9fa;
    min-height: 0;
    transition: opacity 0.2s ease-in-out;
}

/* Estilos para la scrollbar del messageInput en tema claro */
.message-input::-webkit-scrollbar {
    width: 8px;
}

.message-input::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.message-input::-webkit-scrollbar-thumb {
    background: #c1c1c1;
}

.message-input::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Para Firefox en tema claro */
.message-input {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

/* Scrollbar personalizado para el área de mensajes */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #3498db;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}

.message.assistant .message-avatar {
    background-color: #27ae60;
}

.message-content {
    background-color: #ffffff;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 2px 6px rgba(13, 3, 38, 0.1);
    border: 1px solid rgba(13, 3, 38, 0.08);
    max-width: 70%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message.user .message-content {
    background-color: #3498db;
    color: white;
}

.message-timestamp {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
    text-align: right;
}

.message.user .message-timestamp {
    text-align: left;
}

.timestamp-date {
    font-size: 11px;
    color: #6c757d;
    font-weight: 500;
}

.timestamp-time {
    font-size: 10px;
    color: #6c757d;
    margin-top: 2px;
}

.chat-input {
    padding: 0;
    border-top: 2px solid rgba(13, 3, 38, 0.1);
    background-color: #ffffff;
    flex-shrink: 0;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 -2px 8px rgba(13, 3, 38, 0.05);
}

.input-container {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

/* Padding para desktop en input-container */
@media (min-width: 769px) {
    .input-container {
        padding: 10px 20px 10px 10px !important;
    }
}

.message-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid rgba(13, 3, 38, 0.15);
    border-radius: 25px;
    font-size: 16px;
    resize: none;
    min-height: 50px;
    max-height: 120px;
    font-family: inherit;
    background-color: #ffffff;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(13, 3, 38, 0.05);
}

.message-input:focus {
    outline: none;
    border-color: #EB00B6;
    box-shadow: 0 2px 8px rgba(235, 0, 182, 0.2);
}

.send-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #00bfff 0%, #EB00B6 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 191, 255, 0.3);
    transition: all 0.3s ease;
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 191, 255, 0.4);
}

.send-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 191, 255, 0.3);
    transition: background-color 0.3s;
    flex-shrink: 0;
}

.send-btn:hover {
    background-color: #2980b9;
}

.send-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

/* ===== BARRA LATERAL DERECHA (PARTICIPANTES) ===== */
.sidebar-right {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(13, 3, 38, 0.1);
    border: 1px solid rgba(13, 3, 38, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0; /* Permite que se ajuste correctamente */
    overflow: hidden;
}

.participants-header {
    padding: 6px 20px 10px 20px;
    border-bottom: 2px solid #ecf0f1;
    flex-shrink: 0;
    background: #ebebeb;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.participants-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.participant-count {
    font-size: 1.1rem;
    color: #6c757d;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.participant-limit-display {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 400;
}

#participantsList {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 0;
}

/* Scrollbar personalizado para la lista de participantes */
#participantsList::-webkit-scrollbar {
    width: 6px;
}

#participantsList::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#participantsList::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#participantsList::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.participant {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    margin-bottom: 8px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.participant-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: #3498db;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.participant-info {
    flex: 1;
}

.participant-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 2px;
}

.participant-role {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
}

/* Estados de conexión de participantes */
.participant.connected {
    border-left: 3px solid #22c55e;
}

.participant.disconnected {
    border-left: 3px solid #ef4444;
    opacity: 0.7;
}

/* Estados de conexión en tema oscuro */
[data-theme="dark"] .participant.connected {
    border-left: 3px solid #22c55e !important;
    border-left-width: 3px !important;
}

[data-theme="dark"] .participant.disconnected {
    border-left: 3px solid #ef4444 !important;
    border-left-width: 3px !important;
    opacity: 0.7;
}

.connection-status {
    font-size: 0.7rem;
    margin-left: 8px;
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: 500;
}

.connection-status.connected {
    background-color: #dcfce7;
    color: #166534;
}

.connection-status.disconnected {
    background-color: #fef2f2;
    color: #991b1b;
}

/* Indicador de procesamiento de IA - usando el mismo formato que los mensajes */
.message.ai-processing {
    opacity: 0.8;
}

.message.ai-processing .message-content {
    background-color: var(--ai-message-color, var(--secondary-color));
    color: white;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    min-height: 40px;
    display: flex;
    align-items: flex-start;
    font-style: normal;
}

.message.ai-processing .message-avatar {
    background-color: var(--ai-message-color, var(--secondary-color));
    color: white;
}

/* Indicador de escritura de la IA */
.ai-typing-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--ai-message-color, var(--secondary-color));
    animation: fadeIn 0.3s ease-in-out;
}

.ai-typing-indicator .typing-dots {
    display: flex;
    align-items: center;
    gap: 3px;
}

.ai-typing-indicator .typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--ai-message-color, var(--secondary-color));
    animation: typingPulse 1.4s infinite ease-in-out;
}

.ai-typing-indicator .typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.ai-typing-indicator .typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.ai-typing-indicator .typing-dots span:nth-child(3) {
    animation-delay: 0s;
}

.ai-typing-indicator .typing-text {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.9rem;
}

/* Animación de pulsación para los puntos */
@keyframes typingPulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Estilos para el tema oscuro */
[data-theme="dark"] .ai-typing-indicator {
    background-color: var(--bg-secondary);
    border-left-color: var(--ai-message-color, var(--secondary-color));
}

[data-theme="dark"] .ai-typing-indicator .typing-dots span {
    background-color: var(--ai-message-color, var(--secondary-color));
}

[data-theme="dark"] .ai-typing-indicator .typing-text {
    color: var(--text-secondary);
}

/* Animación de entrada */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Messages loading indicator */
.messages-loading-indicator {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    gap: 12px;
    color: var(--text-secondary, #666);
    text-align: center;
    background: transparent;
    backdrop-filter: blur(2px);
    z-index: 2;
}

.messages-loading-indicator .loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(108, 99, 255, 0.2);
    border-top-color: rgba(108, 99, 255, 1);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.messages-loading-indicator p {
    font-size: 0.95rem;
    margin: 0;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Estilos legacy para compatibilidad - mejorados */
.typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.typing-dots span {
    animation: typing 1.4s infinite ease-in-out;
    margin: 0;
    font-size: 1.5em;
    color: inherit;
    font-weight: bold;
    min-width: 8px;
    text-align: center;
    display: inline !important;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0s;
}

/* Estilos específicos para el indicador de procesamiento */
.ai-processing .typing-dots {
    display: flex !important;
    align-items: flex-start;
    gap: 6px;
    padding: 4px 0 8px 0;
    color: white !important;
}

.ai-processing .typing-dots span {
    font-size: 1.8em !important;
    color: white !important;
    animation: typingPulse 1.4s infinite ease-in-out !important;
    display: inline-block !important;
    line-height: 1;
    vertical-align: middle;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Expresiones matemáticas */
.math-expression {
    font-family: 'Courier New', monospace;
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    display: inline-block;
    margin: 0 2px;
    font-size: 0.95em;
    color: #495057;
}

/* Avatares de usuario - preparado para imágenes */
.message-avatar .avatar-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
}

/* ===== ESTADOS VACÍOS ===== */
.empty-chat, .no-rooms, .no-participants {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empty-chat-icon, .no-rooms-icon, .no-participants-icon {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-chat-icon i,
.no-rooms-icon i,
.no-participants-icon i {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.empty-chat h3, .no-rooms h3, .no-participants h3 {
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 2.5rem;
    font-weight: 600;
}

/* Marco translúcido para el mensaje de bienvenida */
.empty-chat {
    background-color: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    max-width: 500px;
    margin: 50px auto;
    color: var(--text-primary);
}

.empty-chat h3 {
    color: var(--text-primary);
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.empty-chat p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

/* Estilos para modo oscuro */
[data-theme="dark"] .empty-chat {
    background: linear-gradient(180deg, rgba(13, 3, 38, 0.7) 0%, rgba(8, 6, 24, 0.7) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .empty-chat-icon i,
[data-theme="dark"] .no-rooms-icon i,
[data-theme="dark"] .no-participants-icon i {
    color: var(--primary-color);
}

/* ===== NOTIFICACIONES ===== */
.notifications-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10010 !important; /* Mayor que el selector de idiomas (z-index: 10007) y modales */
    max-width: 400px;
}

.notification {
    background: #ffffff;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 16px rgba(13, 3, 38, 0.15);
    border: 1px solid rgba(13, 3, 38, 0.1);
    margin-bottom: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #3498db;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.hiding {
    transform: translateX(100%);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-icon {
    font-size: 1.2rem;
}

.notification-message {
    flex: 1;
    font-size: 14px;
}

.notification-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-close:hover {
    color: #2c3e50;
}

.notification.notification-success {
    border-left-color: #27ae60;
}

.notification.notification-error {
    border-left-color: #e74c3c;
}

.notification.notification-warning {
    border-left-color: #f39c12;
}

.notification.notification-info {
    border-left-color: #3498db;
}

/* Asegurar que las alertas/notificaciones nunca tengan blur */
.notification,
.alert,
.toast {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
    -webkit-filter: none !important;
}

/* Específicamente dentro del modal */
.modal-overlay .notification,
.modal-overlay .alert,
.modal-overlay .toast,
.modal-container .notification,
.modal-container .alert,
.modal-container .toast {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Asegurar que las alertas aparezcan por encima del modal y selector de idiomas */
.notification,
.alert,
.toast {
    z-index: 10010 !important; /* Mayor que el selector de idiomas (z-index: 10007) y modales */
}

/* Asegurar que las alertas dentro del modal tengan z-index aún más alto */
.modal-overlay .notification,
.modal-overlay .alert,
.modal-overlay .toast {
    z-index: 10011 !important; /* Mayor que notificaciones normales cuando están en modal */
}

/* Estilos más agresivos para eliminar cualquier blur heredado */
.notifications-container,
.notification,
.alert,
.toast {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
    -webkit-filter: none !important;
}

/* Específicamente para el contenedor de notificaciones */
.notifications-container {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
    -webkit-filter: none !important;
    z-index: 10010 !important; /* Asegurar que esté por encima del selector de idiomas y modales */
}

/* Forzar que las notificaciones no hereden blur del modal */
body .notifications-container,
body .notification,
body .alert,
body .toast {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
    -webkit-filter: none !important;
}

/* ===== ESTADOS DE CARGA ===== */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-rooms, .loading-participants {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

/* ===== RESPONSIVIDAD ===== */
@media (max-width: 1200px) {
    .app-layout {
        grid-template-columns: 250px 1fr 250px;
        grid-template-rows: 1fr;
        gap: 15px;
        padding: 15px;
        height: 100%;
    }
    
    
    
    .join-room-input {
        font-size: 14px;
        padding: 8px;
        max-width: calc(100% - 55px);
    }
    
    .join-room-btn-inline {
        font-size: 14px;
        padding: 8px;
        width: 45px;
    }
}

@media (max-width: 1024px) {
    .app-layout {
        grid-template-columns: 220px 1fr 220px;
        grid-template-rows: 1fr;
        gap: 15px;
        padding: 15px;
        height: 100%;
    }
    
    
    
    .join-room-input {
        font-size: 13px;
        padding: 7px;
        max-width: calc(100% - 50px);
    }
    
    .join-room-btn-inline {
        font-size: 13px;
        padding: 7px;
        width: 40px;
    }
}

@media (max-width: 768px) {
    /* Header fijo en móvil */
    .app-header-main {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 10000 !important;
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .header-left .app-logo {
        height: 30px;
    }
    
    .header-left .app-title {
        font-size: 1.05rem;
    }
    
    .header-right .user-email {
        font-size: 0.8rem;
    }
    
    .header-right .btn-danger {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    .app-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        gap: 10px;
        padding: 10px;
        height: 100%;
    }
    
    .sidebar-left, .sidebar-right {
        order: 3;
        max-height: 220px;
        overflow-y: auto;
    }
    
    .main-content {
        order: 2;
    }
    
    .auth-container {
        margin: 20px;
        max-width: none;
    }
    
    
    .user-email {
        font-size: 11px;
        padding: 6px 10px;
    }
    
    .join-room-input {
        font-size: 12px;
        padding: 6px;
        max-width: calc(100% - 45px);
    }
    
    .join-room-btn-inline {
        font-size: 12px;
        padding: 6px;
        width: 35px;
    }
}

@media (max-width: 480px) {
    /* Header muy pequeño */
    .app-header-main {
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    .header-left {
        gap: var(--spacing-sm);
    }
    
    .header-left .app-logo {
        height: 26px;
    }
    
    .header-left .app-title {
        font-size: 0.9rem;
    }
    
    .header-right {
        gap: var(--spacing-sm);
    }
    
    .header-right .user-email {
        font-size: 0.75rem;
    }
    
    .header-right .btn-danger {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    .app-layout {
        gap: 8px;
        padding: 8px;
        height: 100%;
    }
    
    .sidebar-left, .sidebar-right {
        max-height: 180px;
        overflow-y: auto;
    }
    
    
    .user-email {
        font-size: 10px;
        padding: 5px 8px;
    }
    
    
    .join-room-input {
        font-size: 11px;
        padding: 5px;
        max-width: calc(100% - 40px);
    }
    
    .join-room-btn-inline {
        font-size: 11px;
        padding: 5px;
        width: 30px;
    }
}

@media (max-width: 480px) {
    .app-title {
        font-size: 2rem;
    }
    
    .auth-container {
        padding: 20px;
        margin: 10px;
    }
    
    .auth-buttons {
        flex-direction: column;
    }
    
    .chat-header {
        padding: 6px 15px 6px 15px;
    }
    
    .participants-header {
        padding: 6px 15px 6px 15px;
    }
    
    .chat-messages {
        padding: 15px;
    }
    
    .chat-input {
        padding: 0;
    }
}

/* ===== UTILIDADES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }

.p-10 { padding: 10px; }
.p-20 { padding: 20px; }

.rounded { border-radius: 5px; }
.shadow { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); }

/* ===== IMPORTAR ESTILOS DE LA APLICACIÓN ===== */
@import url('app.css');
@import url('components.css');

/* ===== ESTILOS DE INDICADORES DE MENSAJES NO LEÍDOS ===== */
.room-item {
    position: relative;
}

.unread-bubble {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: #ef4444;
    color: white;
    border-radius: 12px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    padding: 0 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 10;
}

.unread-bubble.has-unread {
    animation: unreadPulse 0.6s ease-in-out;
}

@keyframes unreadPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Estilos para tema oscuro */
[data-theme="dark"] .unread-bubble {
    background-color: #ef4444;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.unread-indicator {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    background-color: #22c55e !important;
    color: white !important;
    border-radius: 50% !important;
    min-width: 20px !important;
    height: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    padding: 0 6px !important;
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.3) !important;
    animation: pulse 2s infinite !important;
    z-index: 100 !important;
    border: 2px solid white !important;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* ===== VENTANA FLOTANTE PARA CREAR SALA ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay:not(.hidden) {
    opacity: 1;
}

/* Estilos específicos para tema oscuro en el modal */
[data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
}

[data-theme="dark"] .modal-body {
    background: linear-gradient(180deg, rgba(13, 3, 38, 0.7) 0%, rgba(8, 6, 24, 0.7) 100%) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .modal-body * {
    color: #ffffff !important;
}

[data-theme="dark"] .modal-body .config-section {
    background-color: transparent !important;
    border: none !important;
}

[data-theme="dark"] .modal-body .background-option,
[data-theme="dark"] .modal-body .message-color-option {
    background-color: transparent !important;
    border: none !important;
}

[data-theme="dark"] .modal-body .form-group,
[data-theme="dark"] .modal-body .background-options,
[data-theme="dark"] .modal-body .message-color-options,
[data-theme="dark"] .modal-body .privacy-options,
[data-theme="dark"] .modal-body .radio-option {
    background-color: transparent !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .modal-body .background-type-selector,
[data-theme="dark"] .modal-body .message-color-type-selector {
    background-color: transparent !important;
    border: none !important;
    border-radius: var(--radius-md) !important;
}

/* Estilos para la scrollbar del modal en tema oscuro */
[data-theme="dark"] .modal-body::-webkit-scrollbar {
    width: 8px;
}

[data-theme="dark"] .modal-body::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

[data-theme="dark"] .modal-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

[data-theme="dark"] .modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Para Firefox */
[data-theme="dark"] .modal-body {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-tertiary);
}

/* Estilos generales para scrollbars del modal en tema oscuro */
[data-theme="dark"] .modal-container::-webkit-scrollbar,
[data-theme="dark"] .modal-overlay::-webkit-scrollbar {
    width: 8px;
}

[data-theme="dark"] .modal-container::-webkit-scrollbar-track,
[data-theme="dark"] .modal-overlay::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

[data-theme="dark"] .modal-container::-webkit-scrollbar-thumb,
[data-theme="dark"] .modal-overlay::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

[data-theme="dark"] .modal-container::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .modal-overlay::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Firefox para modal container y overlay */
[data-theme="dark"] .modal-container,
[data-theme="dark"] .modal-overlay {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-tertiary);
}

[data-theme="dark"] .modal-container {
    background: rgba(13, 3, 38, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
}

/* ============================================================================
   DIALOG MANAGER - Estilos para diálogos de confirmación y alertas
   ============================================================================ */

/* Overlay del diálogo */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10010 !important; /* Mayor que modales normales y context menus */
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: all;
}

.dialog-overlay.show {
    opacity: 1;
}

/* Contenedor del diálogo */
.dialog-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(13, 3, 38, 0.2);
    border: 1px solid rgba(13, 3, 38, 0.15);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(-20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.dialog-container.show {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Header del diálogo */
.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.dialog-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    pointer-events: none;
}

.dialog-title {
    font-family: 'Oxanium', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: white !important;
    margin: 0;
    text-align: left;
    flex: 1;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Body del diálogo */
.dialog-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}

.dialog-message {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary, #333);
    text-align: center;
}

.dialog-input {
    width: 100%;
    padding: 12px 16px;
    margin-top: 16px;
    border: 2px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.dialog-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Footer del diálogo */
.dialog-footer {
    padding: 16px 24px 24px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: var(--bg-secondary, #f8f9fa);
}

.dialog-footer .btn {
    min-width: 100px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.dialog-footer .btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.dialog-footer .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Estilos específicos para diálogo de abandonar sala */
.dialog-container.leave-room-dialog .dialog-header {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
}

.dialog-container.leave-room-dialog .dialog-confirm {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
    color: white !important;
}

.dialog-container.leave-room-dialog .dialog-confirm:hover {
    background: linear-gradient(135deg, #c82333, #bd2130) !important;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4) !important;
    transform: translateY(-2px);
}

.dialog-container.leave-room-dialog .dialog-message {
    color: var(--text-primary, #1a1a1a);
    font-size: 1.05rem;
    line-height: 1.7;
}

.dialog-container.leave-room-dialog .dialog-message::before {
    content: '⚠️ ';
    font-size: 1.2rem;
    margin-right: 8px;
}

[data-theme="dark"] .dialog-container.leave-room-dialog .dialog-message {
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .dialog-container.leave-room-dialog .dialog-header {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
}

.dialog-footer .btn-secondary {
    background: var(--bg-tertiary, #e9ecef);
    color: var(--text-primary, #333);
}

.dialog-footer .btn-secondary:hover {
    background: var(--border-color, #dee2e6);
}

/* Tema oscuro */
[data-theme="dark"] .dialog-overlay {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
}

[data-theme="dark"] .dialog-container {
    background: rgba(13, 3, 38, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .dialog-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 20px 24px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color)) !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    position: relative !important;
    overflow: hidden !important;
}

[data-theme="dark"] .dialog-header::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%) !important;
    pointer-events: none !important;
}

[data-theme="dark"] .dialog-header * {
    color: white !important;
}

[data-theme="dark"] .dialog-title {
    font-family: 'Oxanium', sans-serif !important;
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    color: white !important;
    margin: 0 !important;
    text-align: left !important;
    flex: 1 !important;
    letter-spacing: 0.5px !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .dialog-body {
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .dialog-message {
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .dialog-input {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

[data-theme="dark"] .dialog-input:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .dialog-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .dialog-footer {
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .dialog-footer .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .dialog-footer .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .dialog-container {
        width: 95%;
        max-width: none;
        margin: 20px;
    }

    .dialog-header {
        padding: 16px 20px !important;
    }

    .dialog-title {
        font-size: 1.15rem !important;
    }

    .dialog-body {
        padding: 20px;
    }

    .dialog-footer {
        padding: 12px 20px 20px 20px;
        flex-direction: column-reverse;
    }

    .dialog-footer .btn {
        width: 100%;
    }
}

[data-theme="dark"] .modal-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: var(--spacing-lg) !important;
    border-bottom: 1px solid var(--border-color) !important;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color)) !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    color: white !important;
}

[data-theme="dark"] .modal-header * {
    color: white !important;
}

/* Título del modal siempre en blanco */
.modal-title {
    font-family: 'Oxanium', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    color: white !important;
}

[data-theme="dark"] .modal-title {
    color: white !important;
}

/* Botón de cerrar siempre en blanco */
.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.modal-close-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    transform: rotate(90deg);
}

[data-theme="dark"] .modal-close-btn {
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    transform: rotate(90deg);
}

[data-theme="dark"] .modal-body {
    background: linear-gradient(180deg, rgba(13, 3, 38, 0.7) 0%, rgba(8, 6, 24, 0.7) 100%);
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .modal-footer {
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

/* Estilos específicos para elementos del formulario en tema oscuro */
[data-theme="dark"] .create-room-form input,
[data-theme="dark"] .create-room-form textarea,
[data-theme="dark"] .create-room-form select {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .create-room-form input:focus,
[data-theme="dark"] .create-room-form textarea:focus,
[data-theme="dark"] .create-room-form select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.2);
}

[data-theme="dark"] .create-room-form label {
    color: var(--text-primary);
}

[data-theme="dark"] .config-title {
    color: var(--text-primary);
}

/* Estilos para sliders */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-track {
    width: 100%;
    height: 6px;
    background-color: #7f7f7f;
    border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background-color: #7f7f7f;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #7f7f7f;
}

input[type="range"]::-moz-range-track {
    width: 100%;
    height: 6px;
    background-color: #7f7f7f;
    border-radius: 3px;
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background-color: #7f7f7f;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #7f7f7f;
}

/* Estilos para sliders/toggles en tema oscuro */
[data-theme="dark"] input[type="range"] {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] input[type="range"]::-webkit-slider-track {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] input[type="range"]::-webkit-slider-thumb {
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

[data-theme="dark"] input[type="range"]::-moz-range-track {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] input[type="range"]::-moz-range-thumb {
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

/* Estilos para toggles/switches en tema oscuro */
[data-theme="dark"] .toggle-switch,
[data-theme="dark"] .switch {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .toggle-switch::before,
[data-theme="dark"] .switch::before {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .toggle-switch.active,
[data-theme="dark"] .switch.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

[data-theme="dark"] .radio-option span {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .radio-option input[type="radio"] {
    border-color: var(--text-primary) !important;
    background-color: transparent !important;
}

[data-theme="dark"] .radio-option input[type="radio"]:checked {
    border-color: var(--primary-color) !important;
    background-color: var(--primary-color) !important;
}

/* Estilos específicos y de alta prioridad para createRoomForm */
[data-theme="dark"] form#createRoomForm.create-room-form {
    background: linear-gradient(180deg, rgba(13, 3, 38, 0.7) 0%, rgba(8, 6, 24, 0.7) 100%) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] form#createRoomForm .form-group input {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 2px solid var(--border-color) !important;
}

[data-theme="dark"] form#createRoomForm .form-group input:focus {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.2) !important;
}

[data-theme="dark"] form#createRoomForm .form-group input::placeholder {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] form#createRoomForm .room-prompt-textarea {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 2px solid var(--border-color) !important;
}

[data-theme="dark"] form#createRoomForm .room-prompt-textarea:focus {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.2) !important;
}

[data-theme="dark"] form#createRoomForm .room-prompt-textarea::placeholder {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] form#createRoomForm .icon-selector {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 2px solid var(--border-color) !important;
}

[data-theme="dark"] form#createRoomForm .icon-selector:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.2) !important;
}

/* Estilos para elementos específicos del formulario */
[data-theme="dark"] form#createRoomForm input[type="color"] {
    background-color: var(--bg-secondary) !important;
    border: 2px solid var(--border-color) !important;
}

[data-theme="dark"] form#createRoomForm input[type="url"] {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 2px solid var(--border-color) !important;
}

[data-theme="dark"] form#createRoomForm input[type="url"]:focus {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.2) !important;
}

[data-theme="dark"] form#createRoomForm input[type="url"]::placeholder {
    color: var(--text-secondary) !important;
}

/* Estilos para el contador de caracteres */
[data-theme="dark"] form#createRoomForm .prompt-char-count {
    color: var(--text-secondary) !important;
}

/* Estilos para las secciones de configuración */
[data-theme="dark"] form#createRoomForm .config-section {
    background-color: transparent !important;
    border: none !important;
    border-radius: 0 !important;
}

.modal-container {
    background: rgba(13, 3, 38, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    max-width: 600px;
    width: 90%;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'DM Sans', sans-serif;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform var(--transition-medium);
}

.modal-overlay:not(.hidden) .modal-container {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    color: white;
}

.modal-title {
    font-family: 'Oxanium', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: white !important;
    margin: 0;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.modal-close-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'DM Sans', sans-serif;
}

.modal-footer {
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 0 16px 16px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    backdrop-filter: blur(10px);
}

.modal-footer .btn-primary,
.modal-footer .btn-secondary,
.modal-footer .modal-confirm,
.modal-footer .modal-cancel {
    min-width: 180px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
}

.modal-footer .btn-primary,
.modal-footer .modal-confirm {
    background: linear-gradient(135deg, #00bfff 0%, #EB00B6 100%) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 4px 20px rgba(0, 191, 255, 0.3);
}

.modal-footer .btn-primary:hover,
.modal-footer .modal-confirm:hover {
    background: linear-gradient(135deg, #00bfff 0%, #EB00B6 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 191, 255, 0.4);
}

.modal-footer .btn-secondary,
.modal-footer .modal-cancel {
    background: rgba(13, 3, 38, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: white !important;
}

.modal-footer .btn-secondary:hover,
.modal-footer .modal-cancel:hover {
    background: rgba(13, 3, 38, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

/* ===== FORMULARIO DE CREAR SALA ===== */
.create-room-form .form-group {
    margin-bottom: var(--spacing-lg);
}

.create-room-form label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.create-room-form input[type="text"],
.create-room-form input[type="url"],
.create-room-form textarea,
.create-room-form select {
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color var(--transition-fast);
    background-color: var(--bg-primary);
}

.create-room-form input[type="text"]:focus,
.create-room-form input[type="url"]:focus,
.create-room-form textarea:focus,
.create-room-form select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.room-prompt-textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.prompt-char-count {
    text-align: right;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: var(--spacing-xs);
}

/* ===== SECCIONES DE CONFIGURACIÓN ===== */
.config-section {
    border: none;
    border-radius: 0;
    padding: var(--spacing-lg) 0;
    background-color: transparent;
    margin-bottom: var(--spacing-lg);
}

.config-title {
    margin: 0 0 var(--spacing-md) 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--spacing-sm);
}

/* ===== OPCIONES DE FONDO ===== */
.background-options {
    border: none;
    border-radius: 0;
    padding: 0;
    background-color: transparent;
}

.background-type-selector {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    margin-top: 40px;
}

.radio-option {
    display: flex;
    align-items: center; /* Centrar verticalmente */
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
    min-height: 40px; /* Asegurar altura mínima consistente */
    gap: var(--spacing-sm); /* Usar gap en lugar de margin-right */
    line-height: 1.2; /* Asegurar line-height consistente */
}

/* Hacer que los labels en el formulario no interfieran con la alineación */
.create-room-form label {
    display: contents;
}

.radio-option:hover {
    background-color: var(--bg-tertiary);
}

.radio-option input[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0; /* Evitar que se encoja */
    /* Eliminar align-self y margin-top para usar align-items: center del contenedor */
}

/* Estilos para el contenido de texto en radio buttons */
.radio-option span {
    line-height: 1.2; /* Mismo line-height que el contenedor */
    font-size: 0.95rem;
    font-weight: 500;
    vertical-align: middle; /* Alinear verticalmente con el radio button */
}

.background-option {
    display: none;
}

.background-option.active {
    display: block;
}

#colorBackgroundOptions {
    display: none;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-md);
}

#colorBackgroundOptions.active {
    display: flex;
}

#roomBackgroundColor {
    width: 60px;
    height: 40px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 0;
}

.image-preview {
    width: 100%;
    height: 150px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-secondary);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: none !important;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: var(--spacing-md);
    transition: all var(--transition-fast);
    visibility: hidden;
    opacity: 0;
}

.image-preview.show {
    display: flex !important;
    visibility: visible;
    opacity: 1;
}

.image-preview.has-image {
    border-style: solid;
    border-color: var(--primary-color);
}

/* .color-preview eliminado - ya no se usa */

#imageBackgroundOptions input[type="url"] {
    margin-bottom: var(--spacing-md);
}

.image-preview {
    width: 100%;
    height: 120px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    background-color: var(--bg-tertiary);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-style: italic;
}

.image-preview:not(:empty) {
    background-image: none;
}

/* ===== SELECTOR DE ICONOS ===== */
.icon-selector {
    font-size: 1.2rem;
    padding: var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-primary);
    cursor: pointer;
}

.icon-selector option {
    padding: var(--spacing-sm);
}

/* ===== SELECTOR PERSONALIZADO DE ICONOS ===== */
.custom-icon-selector {
    position: relative;
    width: 100%;
}

.icon-selector-display {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.icon-selector-display:hover {
    border-color: var(--primary-color);
}

.icon-selector-display.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.2);
}

.icon-display-img {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.icon-display-text {
    flex: 1;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.icon-dropdown-arrow {
    color: var(--text-secondary);
    font-size: 0.8rem;
    transition: transform var(--transition-fast);
}

.icon-selector-display.active .icon-dropdown-arrow {
    transform: rotate(180deg);
}

.icon-options-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-medium);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.icon-options-list.show {
    display: block;
}

.icon-option-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.icon-option-item:hover {
    background-color: var(--bg-secondary);
}

.icon-option-item.selected {
    background-color: var(--primary-color);
    color: white;
}

.option-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.option-emoji {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
}

.icon-option-item span:last-child {
    flex: 1;
    color: var(--text-primary);
}

.icon-option-item.selected span:last-child {
    color: white;
}

/* Tema oscuro para el selector personalizado */
[data-theme="dark"] .icon-selector-display {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .icon-selector-display:hover {
    border-color: var(--primary-color);
}

[data-theme="dark"] .icon-options-list {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .icon-option-item:hover {
    background-color: var(--bg-tertiary);
}

/* ===== OPCIONES DE PRIVACIDAD ===== */
.privacy-options {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
}

.privacy-option {
    flex: 1;
}

.privacy-public,
.privacy-private {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-lg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
    background-color: var(--bg-secondary);
}

.privacy-public:hover,
.privacy-private:hover {
    border-color: var(--primary-color);
    background-color: var(--bg-primary);
}

.radio-option:has(input:checked) .privacy-public,
.radio-option:has(input:checked) .privacy-private {
    border-color: var(--primary-color);
    background-color: rgba(0, 123, 255, 0.1);
}

.privacy-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
}

.privacy-public small,
.privacy-private small {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: var(--spacing-xs);
}

/* Ocultar radio buttons en la sección de privacidad */
.privacy-options .radio-option input[type="radio"] {
    display: none;
}

/* ===== COLORES DE MENSAJES ===== */
.message-colors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
}

.color-option {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* Estilos para inputs de color en colores de mensajes */
.color-option input[type="color"] {
    width: 60px;
    height: 40px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 0;
}

/* ===== MEJORAS ADICIONALES ===== */
.modal-overlay.hidden {
    pointer-events: none;
}

.modal-overlay:not(.hidden) {
    pointer-events: auto;
}

/* Animación suave para el modal */
.modal-container {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Mejorar la accesibilidad */
.modal-close-btn:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

.create-room-form input:focus,
.create-room-form textarea:focus,
.create-room-form select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Estilos para el contador de caracteres cuando excede el límite */
.prompt-char-count span {
    font-weight: 600;
}

/* Estilos de radio buttons ya consolidados arriba */

.radio-option input[type="radio"]:checked {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
}

/* Puntito blanco eliminado - solo se ve el color azul cuando está seleccionado */

/* ===== PERSONALIZACIÓN DE SALAS ===== */

/* Variables CSS para colores personalizados */
:root {
    --user-message-color: var(--primary-color);
    --ai-message-color: var(--secondary-color);
    --room-bg-color: transparent;
    --room-bg-image: none;
}

/* Fondos personalizados de salas */
.room-bg-color {
    background-color: var(--room-bg-color) !important;
}

.room-bg-image {
    background-image: var(--room-bg-image) !important;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Colores personalizados de mensajes */
.message.user {
    --message-color: var(--user-message-color, var(--primary-color));
}

.message.assistant,
.message.ai {
    --message-color: var(--ai-message-color, var(--secondary-color));
}

/* Aplicar colores a los elementos de mensaje */
.message.user .message-avatar {
    background-color: var(--user-message-color, var(--primary-color));
    color: white;
}

.message.assistant .message-avatar,
.message.ai .message-avatar {
    background-color: var(--ai-message-color, var(--secondary-color));
    color: white;
}

/* Alternativa: aplicar colores a bordes o elementos específicos */
.message.user {
    border-left-color: var(--user-message-color, var(--primary-color));
}

.message.assistant,
.message.ai {
    border-left-color: var(--ai-message-color, var(--secondary-color));
}

/* Mejorar contraste cuando hay fondo personalizado */
.room-bg-color .message,
.room-bg-image .message {
    background-color: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(2px);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
    padding: var(--spacing-md);
}

.room-bg-image .message {
    background-color: rgba(255, 255, 255, 0.9);
}

/* Asegurar legibilidad en fondos oscuros */
/* Nota: Estilos específicos para fondos oscuros de salas se aplican dinámicamente */

/* Responsive para fondos personalizados */
@media (max-width: 768px) {
    .room-bg-image {
        background-attachment: scroll; /* Mejor rendimiento en móviles */
    }
    
    .room-bg-color .message,
    .room-bg-image .message {
        padding: var(--spacing-sm);
        margin-bottom: var(--spacing-xs);
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        margin: var(--spacing-md);
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: var(--spacing-md);
    }
    
    .background-type-selector {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .privacy-options {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .message-colors {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn-primary,
    .modal-footer .btn-secondary {
        width: 100%;
    }
}

/* ===== FONDOS PERSONALIZADOS DE SALAS ===== */
/* Variables CSS para personalización de salas */
:root {
    --user-message-color: var(--primary-color);
    --ai-message-color: var(--secondary-color);
    --room-bg-color: transparent;
    --room-bg-image: none;
}

/* Fondos personalizados de salas - Mayor especificidad para sobrescribir .chat-messages */
.chat-messages.room-bg-color {
    background-color: var(--room-bg-color) !important;
}

.chat-messages.room-bg-image {
    background: var(--room-bg-image) center center / cover !important;
    background-color: transparent !important;
}

/* Opciones de colores de mensajes */
.message-color-options {
    margin-top: var(--spacing-sm);
}

.message-color-type-selector {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.message-color-option {
    display: none;
    margin-top: var(--spacing-sm);
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--background-secondary);
}

.message-color-option.active {
    display: block;
}

.message-color-option p {
    margin: 0;
    color: var(--text-secondary);
    font-style: italic;
}

/* Colores de mensajes personalizados */
.message.user {
    --message-color: var(--user-message-color, var(--primary-color));
}

.message.assistant, 
.message.ai {
    --message-color: var(--ai-message-color, var(--secondary-color));
}

/* Aplicar colores a avatares y bordes */
.message.user .message-avatar {
    background-color: var(--user-message-color, var(--primary-color)) !important;
    color: white;
}

.message.assistant .message-avatar, 
.message.ai .message-avatar {
    background-color: var(--ai-message-color, var(--secondary-color)) !important;
    color: white;
}

.message.user .message-content {
    border-left: 3px solid var(--user-message-color, var(--primary-color)) !important;
    background-color: var(--user-message-color, var(--primary-color)) !important;
    color: var(--user-message-font-color, white) !important;
}

.message.assistant .message-content, 
.message.ai .message-content {
    border-left: 3px solid var(--ai-message-color, var(--secondary-color)) !important;
    background-color: var(--ai-message-color, var(--secondary-color)) !important;
    color: var(--ai-message-font-color, white) !important;
}

/* Eliminar fondo del avatar cuando contiene una imagen */
.message-avatar.has-image {
    background-color: transparent !important;
}

/* Asegurar que las imágenes en avatares ocupen todo el espacio */
.message-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* Específicamente para imágenes base64 en avatares de IA */
.message.assistant .message-avatar img,
.message.ai .message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Mejorar contraste cuando hay fondo personalizado */
.room-bg-color .message,
.room-bg-image .message {
    background-color: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(2px);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.room-bg-color .message-content,
.room-bg-image .message-content {
    background-color: transparent;
    box-shadow: none;
}

/* Asegurar legibilidad en fondos oscuros */
.chat-messages.room-bg-color[style*="background-color: #"] .message,
.chat-messages.room-bg-image .message {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Responsive para fondos personalizados */
@media (max-width: 768px) {
    .chat-messages.room-bg-color {
        padding: 15px;
    }
    
    .room-bg-color .message,
    .room-bg-image .message {
        padding: var(--spacing-sm);
        margin-bottom: var(--spacing-xs);
    }
}

/* ===== BOTÓN DE EMOJIS ===== */
.emoji-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    box-sizing: border-box;
}

.emoji-btn:hover {
    background-color: #d4009e;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(235, 0, 182, 0.3);
}

.emoji-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(235, 0, 182, 0.3);
}

/* ===== BOTÓN DE ENVIAR MENSAJE ===== */
.send-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    box-sizing: border-box;
}

.send-btn:hover {
    background-color: #0099cc;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 191, 255, 0.3);
}

.send-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 191, 255, 0.3);
}

.send-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== CONTENEDOR DE INPUT DE CHAT ===== */
.input-container {
    display: flex;
    align-items: stretch;
    gap: var(--spacing-md);
    padding: 10px 20px 10px 10px;
    background-color: transparent;
}

.textbox-area {
    flex: 1;
    display: flex;
    align-items: stretch;
    margin-right: var(--spacing-sm);
}

.buttons-column {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    align-items: stretch;
    flex-shrink: 0;
    width: 50px;
}

.message-input {
    flex: 1;
    min-height: 108px; /* 50px + 50px + 8px gap = 108px */
    max-height: 200px;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.4;
    resize: vertical;
    background-color: #ebebeb;
    transition: border-color var(--transition-fast);
}

.message-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.1);
}

.message-input::placeholder {
    color: var(--text-muted);
}

/* ===== ESTILOS FINALES PARA FORZAR TEMA OSCURO EN LOGIN ===== */
/* Estos estilos van al final para máxima prioridad */
html[data-theme="dark"] input#loginEmail,
html[data-theme="dark"] input#loginPassword,
html[data-theme="dark"] input#registerEmail,
html[data-theme="dark"] input#registerPassword {
    background-color: #4a5568 !important;
    background: #4a5568 !important;
    color: #f7fafc !important;
    border: 2px solid #718096 !important;
}

html[data-theme="dark"] input#loginEmail:focus,
html[data-theme="dark"] input#loginPassword:focus,
html[data-theme="dark"] input#registerEmail:focus,
html[data-theme="dark"] input#registerPassword:focus {
    background-color: #4a5568 !important;
    background: #4a5568 !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.2) !important;
}

/* ===== SOBRESCRIBIR AUTOCCOMPLETAR DE CHROME ===== */
/* Chrome autocomplete styles override */
html[data-theme="dark"] input#loginEmail:-webkit-autofill,
html[data-theme="dark"] input#loginPassword:-webkit-autofill,
html[data-theme="dark"] input#registerEmail:-webkit-autofill,
html[data-theme="dark"] input#registerPassword:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #4a5568 inset !important;
    -webkit-text-fill-color: #f7fafc !important;
    background-color: #4a5568 !important;
    background: #4a5568 !important;
    color: #f7fafc !important;
    border: 2px solid #718096 !important;
}

html[data-theme="dark"] input#loginEmail:-webkit-autofill:hover,
html[data-theme="dark"] input#loginPassword:-webkit-autofill:hover,
html[data-theme="dark"] input#registerEmail:-webkit-autofill:hover,
html[data-theme="dark"] input#registerPassword:-webkit-autofill:hover {
    -webkit-box-shadow: 0 0 0 1000px #4a5568 inset !important;
    -webkit-text-fill-color: #f7fafc !important;
    background-color: #4a5568 !important;
    background: #4a5568 !important;
    color: #f7fafc !important;
}

html[data-theme="dark"] input#loginEmail:-webkit-autofill:focus,
html[data-theme="dark"] input#loginPassword:-webkit-autofill:focus,
html[data-theme="dark"] input#registerEmail:-webkit-autofill:focus,
html[data-theme="dark"] input#registerPassword:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #4a5568 inset !important;
    -webkit-text-fill-color: #f7fafc !important;
    background-color: #4a5568 !important;
    background: #4a5568 !important;
    color: #f7fafc !important;
    border: 2px solid var(--primary-color) !important;
}

/* ===== ESTILOS PARA DROPDOWN DE AUTOCCOMPLETAR ===== */
/* Estilos para el dropdown de autocompletar de Chrome */
html[data-theme="dark"] input#loginEmail::-webkit-list-button,
html[data-theme="dark"] input#loginPassword::-webkit-list-button,
html[data-theme="dark"] input#registerEmail::-webkit-list-button,
html[data-theme="dark"] input#registerPassword::-webkit-list-button {
    background-color: #4a5568 !important;
    color: #f7fafc !important;
}

/* Estilos para las opciones del dropdown */
html[data-theme="dark"] input#loginEmail::-webkit-datetime-edit,
html[data-theme="dark"] input#loginPassword::-webkit-datetime-edit,
html[data-theme="dark"] input#registerEmail::-webkit-datetime-edit,
html[data-theme="dark"] input#registerPassword::-webkit-datetime-edit {
    background-color: #4a5568 !important;
    color: #f7fafc !important;
}

/* Estilos adicionales para inputs durante autocompletar activo */
html[data-theme="dark"] input#loginEmail[list],
html[data-theme="dark"] input#loginPassword[list],
html[data-theme="dark"] input#registerEmail[list],
html[data-theme="dark"] input#registerPassword[list] {
    background-color: #4a5568 !important;
    background: #4a5568 !important;
    color: #f7fafc !important;
    border: 2px solid #718096 !important;
}

/* Forzar estilos durante la selección activa */
html[data-theme="dark"] input#loginEmail:focus:-webkit-autofill,
html[data-theme="dark"] input#loginPassword:focus:-webkit-autofill,
html[data-theme="dark"] input#registerEmail:focus:-webkit-autofill,
html[data-theme="dark"] input#registerPassword:focus:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #4a5568 inset !important;
    -webkit-text-fill-color: #f7fafc !important;
    background-color: #4a5568 !important;
    background: #4a5568 !important;
    color: #f7fafc !important;
    border: 2px solid var(--primary-color) !important;
}

/* ===== NUEVAS FUNCIONALIDADES DEL MODAL DE CREAR SALA ===== */

/* ===== DESCRIPCIÓN DE SALA ===== */
.room-description-textarea {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.4;
}

.description-char-count {
    text-align: right;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: var(--spacing-xs);
}

/* ===== TAGS DE SALA ===== */
.tags-container {
    background-color: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-top: 8px;
}

.tags-input-container {
    position: relative;
    margin-bottom: 16px;
}

.tag-char-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: right;
    margin-top: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
}

.tags-preview {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
    min-height: 30px;
}

.tag-item {
    background-color: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
    animation: tagSlideIn 0.2s ease-out;
}

.tag-remove {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color var(--transition-fast);
}

.tag-remove:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

@keyframes tagSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tags-suggestions {
    padding-top: 16px;
    margin-top: 0;
}

.tags-suggestions-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    display: block;
}

.suggested-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.suggested-tag {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid var(--border-color);
}

.suggested-tag:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ===== LÍMITE DE PARTICIPANTES ===== */
.participant-limit-options {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.participant-limit-input {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.participant-limit-input input[type="number"] {
    width: 100%;
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    text-align: center;
}

.limit-info {
    text-align: center;
    margin-top: var(--spacing-xs);
}

.limit-info small {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* ===== SUBIDA DE IMÁGENES PARA AVATAR DE IA ===== */
.ai-icon-options {
    margin-top: var(--spacing-sm);
}

.icon-type-selector {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.icon-option {
    display: none;
}

.icon-option.active {
    display: block;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    background-color: var(--bg-secondary);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: var(--bg-tertiary);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-secondary);
}

.upload-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-xs);
}

.upload-area small {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.upload-preview {
    margin-top: var(--spacing-md);
    display: none;
}

.upload-preview.show {
    display: block;
}

.upload-preview img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

/* ===== CONFIGURACIÓN DE FUENTES ===== */
.font-options {
    margin-top: var(--spacing-sm);
}

.font-type-selector {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.font-option {
    display: none;
}

.font-option.active {
    display: block;
}

/* Ocultar el selector de fuentes por defecto */
#customFontSettings {
    display: none;
}

/* El selector de fuentes se oculta por defecto y se muestra solo cuando está en custom */

.font-settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.font-option {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.font-option label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.font-option select {
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.font-option input[type="range"] {
    width: 100%;
    margin: var(--spacing-xs) 0;
}

.font-option span {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
}

/* ===== VISTA PREVIA EN TIEMPO REAL ===== */
.modal-preview {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--spacing-lg);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
}

.preview-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--spacing-md) 0;
    text-align: center;
}

.preview-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-primary);
}

.preview-room {
    padding: var(--spacing-md);
    background-color: transparent;
}

[data-theme="dark"] .preview-room {
    background: linear-gradient(180deg, rgba(13, 3, 38, 0.7) 0%, rgba(8, 6, 24, 0.7) 100%);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

.preview-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.preview-participants {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background-color: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 8px;
}

.preview-messages {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.preview-message {
    display: flex;
    gap: var(--spacing-sm);
    align-items: flex-start;
}

.preview-message.user {
    flex-direction: row-reverse;
}

.preview-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.preview-message.ai .preview-avatar {
    background-color: var(--secondary-color);
}

.preview-content {
    max-width: 70%;
}

.preview-text {
    background-color: var(--bg-tertiary);
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.3;
    color: var(--text-primary);
}

.preview-message.user .preview-text {
    background-color: var(--primary-color);
    color: white;
}

.preview-message.ai .preview-text {
    background-color: var(--secondary-color);
    color: white;
}

/* ===== ESTILOS PARA TEMA OSCURO ===== */
[data-theme="dark"] .room-description-textarea {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

[data-theme="dark"] .room-description-textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.2);
}

[data-theme="dark"] .room-description-textarea::placeholder {
    color: var(--text-secondary);
}

[data-theme="dark"] .description-char-count {
    color: var(--text-secondary);
}

[data-theme="dark"] .tags-input-container input {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

[data-theme="dark"] .tags-input-container input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.2);
}

[data-theme="dark"] .tags-input-container input::placeholder {
    color: var(--text-secondary);
}

[data-theme="dark"] .suggested-tag {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .suggested-tag:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

[data-theme="dark"] .tags-container {
    background-color: transparent;
    border: none;
}

[data-theme="dark"] .participant-limit-input {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .participant-limit-input input {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .participant-limit-input input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.2);
}

[data-theme="dark"] .upload-area {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .upload-area:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--primary-color);
}

[data-theme="dark"] .upload-placeholder {
    color: var(--text-secondary);
}

[data-theme="dark"] .font-settings {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .font-option select {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .font-option select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.2);
}

[data-theme="dark"] .modal-preview {
    background: linear-gradient(180deg, rgba(13, 3, 38, 0.7) 0%, rgba(8, 6, 24, 0.7) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .preview-container {
    background: linear-gradient(180deg, rgba(13, 3, 38, 0.7) 0%, rgba(8, 6, 24, 0.7) 100%);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .preview-header {
    background-color: #0f0123;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .preview-messages {
    background: linear-gradient(180deg, rgba(13, 3, 38, 0.7) 0%, rgba(8, 6, 24, 0.7) 100%);
}

[data-theme="dark"] .config-title {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .stat-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .font-section-title {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .preview-container .preview-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

@media (max-width: 768px) {
    [data-theme="dark"] .modal-body {
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    }
}

[data-theme="dark"] .preview-header h4 {
    color: var(--text-primary);
}

[data-theme="dark"] .preview-participants {
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
}

[data-theme="dark"] .preview-text {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

[data-theme="dark"] .preview-message.user .preview-text {
    background-color: var(--primary-color);
    color: white;
}

[data-theme="dark"] .preview-message.ai .preview-text {
    background-color: var(--secondary-color);
    color: white;
}

/* ===== TEMA OSCURO PARA LAYOUT DE DOS COLUMNAS ===== */
[data-theme="dark"] .modal-content-wrapper {
    border-color: var(--border-color);
}

[data-theme="dark"] .modal-body {
    background: linear-gradient(180deg, rgba(13, 3, 38, 0.7) 0%, rgba(8, 6, 24, 0.7) 100%);
    border-color: var(--border-color);
}

[data-theme="dark"] .modal-preview {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

[data-theme="dark"] .preview-title {
    color: var(--text-primary);
    border-color: var(--primary-color);
}

[data-theme="dark"] .preview-container {
    background: linear-gradient(180deg, rgba(13, 3, 38, 0.7) 0%, rgba(8, 6, 24, 0.7) 100%);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .preview-header {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .preview-header h4 {
    color: var(--text-primary);
}

[data-theme="dark"] .preview-participants {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
}

[data-theme="dark"] .preview-messages {
    background-color: var(--bg-primary);
}

[data-theme="dark"] .preview-avatar {
    background-color: var(--bg-tertiary);
}

[data-theme="dark"] .preview-message.user .preview-avatar {
    background-color: var(--primary-color);
    color: white;
}

[data-theme="dark"] .preview-message.ai .preview-avatar {
    background-color: var(--secondary-color);
    color: white;
}

[data-theme="dark"] .preview-text {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

[data-theme="dark"] .preview-message.user .preview-text {
    background-color: var(--primary-color);
    color: white;
}

[data-theme="dark"] .preview-message.ai .preview-text {
    background-color: var(--secondary-color);
    color: white;
}

/* ===== RESPONSIVE PARA NUEVAS FUNCIONALIDADES ===== */
@media (max-width: 768px) {
    .font-settings {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .participant-limit-options,
    .icon-type-selector,
    .font-type-selector {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .suggested-tags {
        justify-content: center;
    }
    
    .tags-suggestions {
        text-align: center;
    }
    
    .preview-header {
        flex-direction: column;
        gap: var(--spacing-xs);
        text-align: center;
    }
    
    .preview-message {
        gap: var(--spacing-xs);
    }
    
    .preview-content {
        max-width: 85%;
    }
}

/* ===== LAYOUT DE DOS COLUMNAS PARA MODAL DE CREAR SALA ===== */
.create-room-container {
    width: 90%;
    max-width: 1400px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    background: rgba(13, 3, 38, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'DM Sans', sans-serif;
}

.modal-content-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Estilos específicos para sliders dentro de modal-content-wrapper */
.modal-content-wrapper input[type="range"]::-webkit-slider-track {
    background-color: #7f7f7f !important;
}

.modal-content-wrapper input[type="range"]::-webkit-slider-thumb {
    background-color: #7f7f7f !important;
    border: 2px solid #7f7f7f !important;
}

.modal-content-wrapper input[type="range"]::-moz-range-track {
    background-color: #7f7f7f !important;
}

.modal-content-wrapper input[type="range"]::-moz-range-thumb {
    background-color: #7f7f7f !important;
    border: 2px solid #7f7f7f !important;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    padding: 24px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    color: rgba(255, 255, 255, 0.9);
}

.create-room-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    justify-content: flex-start;
}

.modal-preview {
    width: 450px;
    min-width: 450px;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.03);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    backdrop-filter: blur(10px);
}


.preview-buttons {
    padding: 0;
    margin-top: auto;
    margin-bottom: 0;
    border-top: none;
    background-color: transparent;
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
    align-self: flex-end;
}

/* Estilos comunes para botones dentro de modal-preview */
.modal-preview > .btn-primary,
.modal-preview > .btn-secondary,
.modal-preview > .btn-danger,
.modal-preview > .modal-confirm,
.modal-preview > .modal-cancel {
    min-width: 180px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    width: 100%;
    margin-top: var(--spacing-md);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'DM Sans', sans-serif;
    border: none;
    outline: none;
}

.preview-buttons .btn-primary,
.preview-buttons .btn-secondary,
.preview-buttons .modal-confirm,
.preview-buttons .modal-cancel {
    min-width: 180px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
}

/* Botón primario (Crear Sala / Guardar cambios) */
.modal-preview > .btn-primary,
.modal-preview > .modal-confirm,
.preview-buttons .btn-primary,
.preview-buttons .modal-confirm {
    background: linear-gradient(135deg, #00bfff 0%, #EB00B6 100%) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 4px 20px rgba(0, 191, 255, 0.3);
}

.modal-preview > .btn-primary:hover,
.modal-preview > .modal-confirm:hover,
.preview-buttons .btn-primary:hover,
.preview-buttons .modal-confirm:hover {
    background: linear-gradient(135deg, #00bfff 0%, #EB00B6 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 191, 255, 0.4);
}

.modal-preview > .btn-primary:active,
.modal-preview > .modal-confirm:active,
.preview-buttons .btn-primary:active,
.preview-buttons .modal-confirm:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 191, 255, 0.3);
}

/* Botón secundario (Cancelar) */
.modal-preview > .btn-secondary,
.modal-preview > .modal-cancel,
.preview-buttons .btn-secondary,
.preview-buttons .modal-cancel {
    background: rgba(0, 191, 255, 0.2) !important;
    border: 1px solid rgba(0, 191, 255, 0.4) !important;
    color: rgba(255, 255, 255, 0.95) !important;
}

.modal-preview > .btn-secondary:hover,
.modal-preview > .modal-cancel:hover,
.preview-buttons .btn-secondary:hover,
.preview-buttons .modal-cancel:hover {
    background: rgba(0, 191, 255, 0.3) !important;
    border-color: rgba(0, 191, 255, 0.5) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 191, 255, 0.2);
}

.modal-preview > .btn-secondary:active,
.modal-preview > .modal-cancel:active,
.preview-buttons .btn-secondary:active,
.preview-buttons .modal-cancel:active {
    transform: translateY(0);
}

/* Botón peligro (Eliminar) */
.modal-preview > .btn-danger {
    background: rgba(239, 68, 68, 0.9) !important;
    border: 1px solid rgba(239, 68, 68, 1) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.modal-preview > .btn-danger:hover {
    background: rgba(239, 68, 68, 1) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

.modal-preview > .btn-danger:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.preview-title {
    margin: 0 0 20px 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.preview-container {
    background-color: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    flex: 1;
    margin: 20px 0;
}

.preview-room {
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: transparent;
}

[data-theme="dark"] .preview-room {
    background: linear-gradient(180deg, rgba(13, 3, 38, 0.7) 0%, rgba(8, 6, 24, 0.7) 100%);
}

.preview-header {
    background-color: var(--bg-secondary);
    padding: 8px 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.preview-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.preview-participants {
    font-size: 0.9rem;
    color: var(--text-secondary);
    background-color: var(--bg-tertiary);
    padding: 4px 8px;
    border-radius: 6px;
}

.preview-messages {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 15px;
}

.preview-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.preview-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background-color: var(--bg-tertiary);
    flex-shrink: 0;
}

.preview-message.user .preview-avatar {
    background-color: var(--primary-color);
    color: white;
}

.preview-message.ai .preview-avatar {
    background-color: var(--secondary-color);
    color: white;
}

.preview-content {
    flex: 1;
}

.preview-text {
    background-color: var(--bg-tertiary);
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-primary);
    word-wrap: break-word;
}

.preview-message.user .preview-text {
    background-color: var(--primary-color);
    color: white;
    margin-left: auto;
    max-width: 80%;
}

.preview-message.ai .preview-text {
    background-color: var(--secondary-color);
    color: white;
}

/* ===== RESPONSIVE PARA LAYOUT DE DOS COLUMNAS ===== */
@media (max-width: 1200px) {
    .create-room-container {
        width: 95%;
        max-width: 95%;
    }
    
    .modal-preview {
        width: 350px;
        min-width: 350px;
    }
}

@media (max-width: 768px) {
    .create-room-container {
        width: 100% !important;
        height: 100vh !important;
        max-width: 100vw !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }
    
    /* Alinear radio buttons horizontalmente con textos en mobile */
    .radio-option {
        display: flex !important;
        align-items: center !important;
        flex-direction: row !important;
        gap: 12px !important;
    }
    
    .radio-option input[type="radio"] {
        flex-shrink: 0 !important;
        margin: 0 !important;
        align-self: center !important;
    }
    
    .radio-option span {
        display: inline-block !important;
        vertical-align: middle !important;
        line-height: 1.4 !important;
    }
    
    .modal-content-wrapper {
        flex-direction: column;
        height: calc(100vh - 60px) !important; /* Menos el header del modal */
        overflow-y: auto !important;
    }
    
    .modal-body {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        max-height: none !important;
        flex: none !important;
        overflow: visible !important;
    }
    
    .modal-preview {
        width: 100%;
        min-width: auto;
        max-height: none !important;
        border-left: none;
        border-top: 1px solid var(--border-color);
        flex: none !important;
        padding: var(--spacing-md) !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .preview-buttons {
        display: flex !important;
        flex-direction: column !important;
        gap: var(--spacing-sm) !important;
        justify-content: center !important;
        align-items: stretch !important;
        width: 100% !important;
        padding: 0 !important;
        margin-top: var(--spacing-md) !important;
    }

    .preview-buttons .btn-primary,
    .preview-buttons .btn-secondary,
    .preview-buttons .modal-confirm,
    .preview-buttons .modal-cancel {
        min-width: auto !important;
        width: 100% !important;
        padding: 14px 20px !important;
        font-size: 1rem !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }

    .modal-footer {
        position: sticky !important;
        bottom: 0 !important;
        background: var(--bg-primary) !important;
        z-index: 10 !important;
        padding: 16px !important;
        border-top: 1px solid var(--border-color) !important;
    }
    
    /* Alinear radio buttons horizontalmente con textos en mobile */
    .radio-option {
        display: flex !important;
        align-items: center !important;
        flex-direction: row !important;
        gap: 12px !important;
    }
    
    .radio-option input[type="radio"] {
        flex-shrink: 0 !important;
        margin: 0 !important;
        align-self: center !important;
    }
    
    .radio-option span {
        display: inline-block !important;
        vertical-align: middle !important;
        line-height: 1.4 !important;
    }
}

/* ===== ICONO DE INFORMACIÓN DE SALA ===== */
.room-title-container {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 100%;
}

.room-info-tooltip {
    position: relative;
    display: inline-block;
}

.room-info-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    font-size: 16px;
    width: 24px;
    height: 24px;
    opacity: 0.6;
    visibility: visible;
}

.room-info-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--primary-color);
    transform: scale(1.1);
    opacity: 1;
}

.room-info-btn[style*="display: none"] {
    display: none !important;
}

.info-icon {
    font-style: normal;
    font-weight: 600;
    line-height: 1;
}

/* ===== TOOLTIP ===== */
.tooltip-content {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 200px;
    max-width: 300px;
    margin-top: 8px;
}

.tooltip-arrow {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--border-color);
}

.tooltip-arrow::after {
    content: '';
    position: absolute;
    top: 1px;
    left: -7px;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid var(--bg-primary);
}

.tooltip-text {
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
    text-align: center;
}

/* Sección de prompt en tooltip */
.tooltip-prompt-section {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
    text-align: left;
}

.tooltip-prompt-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tooltip-prompt-text {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.5;
    background: var(--bg-tertiary);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    max-height: 150px;
    overflow-y: auto;
    white-space: pre-wrap;
}

/* ===== TEMA OSCURO PARA TOOLTIP ===== */
[data-theme="dark"] .tooltip-content {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .tooltip-arrow {
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .tooltip-arrow::after {
    border-bottom-color: var(--bg-secondary);
}

[data-theme="dark"] .tooltip-text {
    color: var(--text-primary);
}

[data-theme="dark"] .room-info-btn {
    color: var(--text-secondary);
}

[data-theme="dark"] .room-info-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--primary-color);
}

/* ===== TAGS DE SALA EN EL HEADER ===== */
.room-tags-container {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-left: 8px;
    align-items: center;
}

.room-tag {
    background-color: #EB00B6;
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    border: none;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.room-tag i {
    font-size: 0.7rem;
}

.room-tag:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

/* ===== TEMA OSCURO PARA TAGS ===== */
[data-theme="dark"] .room-tag {
    background-color: #EB00B6;
    color: #ffffff;
    font-weight: 700;
}

[data-theme="dark"] .room-tag:hover {
    background-color: var(--primary-color);
    color: white;
}

/* ===== LAYOUT DE CONFIGURACIÓN DE FUENTES ===== */
.font-settings {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.font-user-section,
.font-ai-section {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
}

.font-section-title {
    margin: 0 0 var(--spacing-md) 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

.font-user-group,
.font-ai-group {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--spacing-md);
    align-items: start;
}

.font-user-group .font-option,
.font-ai-group .font-option {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    align-items: center;
}

.font-user-group label,
.font-ai-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    width: 100%;
}

.font-user-group select,
.font-ai-group select {
    width: 100%;
    padding: var(--spacing-xs);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 12px;
}

.size-control-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    width: 100%;
}

.size-control-group span {
    font-size: 11px;
    color: var(--text-muted);
    min-width: 35px;
    text-align: left;
    flex-shrink: 0;
}

.size-control-group input[type="range"] {
    flex: 1;
    margin: 0;
}

.font-user-group input[type="color"],
.font-ai-group input[type="color"] {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: none;
    cursor: pointer;
    padding: 0;
}

/* Tema oscuro para configuración de fuentes */
[data-theme="dark"] .font-user-section,
[data-theme="dark"] .font-ai-section {
    background-color: var(--bg-tertiary);
    border-color: var(--border-light);
}

[data-theme="dark"] .font-section-title {
    color: var(--text-primary);
    border-bottom-color: var(--border-light);
}

[data-theme="dark"] .font-user-group select,
[data-theme="dark"] .font-ai-group select {
    background-color: var(--bg-secondary);
    border-color: var(--border-light);
    color: var(--text-primary);
}

[data-theme="dark"] .font-user-group input[type="color"],
[data-theme="dark"] .font-ai-group input[type="color"] {
    border-color: var(--border-light);
}

/* ===== FUENTES PERSONALIZADAS PARA MENSAJES ===== */
.message.user .message-content {
    font-family: var(--user-message-font-family, inherit);
    font-size: var(--user-message-font-size, inherit);
    color: var(--user-message-font-color, inherit);
}

.message.assistant .message-content,
.message.ai .message-content {
    font-family: var(--ai-message-font-family, inherit);
    font-size: var(--ai-message-font-size, inherit);
    color: var(--ai-message-font-color, inherit);
}

/* ===== TEMA OSCURO PARA FUENTES PERSONALIZADAS ===== */
[data-theme="dark"] .message.user .message-content {
    font-family: var(--user-message-font-family, inherit);
    font-size: var(--user-message-font-size, inherit);
    color: var(--user-message-font-color, inherit);
}

[data-theme="dark"] .message.assistant .message-content,
[data-theme="dark"] .message.ai .message-content {
    font-family: var(--ai-message-font-family, inherit);
    font-size: var(--ai-message-font-size, inherit);
    color: var(--ai-message-font-color, inherit);
}

/* ===== DASHBOARD STYLES ===== */
.dashboard-container {
    flex: 1;
    padding: var(--spacing-lg);
    max-width: none;
    margin: 0;
    overflow-y: auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(13, 3, 38, 0.08);
    border: 1px solid rgba(13, 3, 38, 0.1);
}

/* Scrollbar del dashboard - mismo estilo que la lista de salas */
.dashboard-container::-webkit-scrollbar {
    width: 6px;
}

.dashboard-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.dashboard-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.dashboard-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Tema oscuro específico para el dashboard */
[data-theme="dark"] .dashboard-container {
    background-color: #0f0123;
}

/* Tema oscuro específico para el scrollbar del dashboard */
[data-theme="dark"] .dashboard-container::-webkit-scrollbar-track {
    background: #4a5568;
}

[data-theme="dark"] .dashboard-container::-webkit-scrollbar-thumb {
    background: #718096;
}

[data-theme="dark"] .dashboard-container::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Cuando la columna derecha está oculta, el dashboard ocupa todo el espacio */
.app-layout:has(.sidebar-right[style*="display: none"]) {
    grid-template-columns: 280px 1fr;
}

/* Fallback para navegadores que no soportan :has() */
.app-layout.dashboard-mode {
    grid-template-columns: 280px 1fr !important;
    padding: 10px 10px 10px 0 !important;
}

/* Responsive adjustments for dashboard mode */
@media (max-width: 1200px) {
    .app-layout:has(.sidebar-right[style*="display: none"]),
    .app-layout.dashboard-mode {
        grid-template-columns: 250px 1fr;
    }
}

@media (max-width: 768px) {
    .app-layout:has(.sidebar-right[style*="display: none"]),
    .app-layout.dashboard-mode {
        grid-template-columns: 220px 1fr;
        padding-top: 0 !important;
    }
}

.dashboard-right-container {
    padding: var(--spacing-md);
    height: 100%;
    overflow-y: auto;
}

.dashboard-right-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.dashboard-stats {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
}

.dashboard-stats h3 {
    margin: 0 0 var(--spacing-sm) 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xs);
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid var(--border-color);
}

.stat-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stat-value {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.dashboard-quick-actions {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
}

.dashboard-quick-actions h3 {
    margin: 0 0 var(--spacing-sm) 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

.quick-action-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.quick-action-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.quick-action-btn:last-child {
    margin-bottom: 0;
}

.action-icon {
    font-size: 1.1rem;
}

.dashboard-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-xl) 0;
    min-height: 160px; /* Asegurar altura mínima más generosa */
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-lg);
    color: white;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.dashboard-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><defs><pattern id="grain" width="200" height="200" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.15)"/><circle cx="150" cy="150" r="2" fill="rgba(255,255,255,0.15)"/><circle cx="100" cy="20" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="20" cy="120" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="180" cy="80" r="1.5" fill="rgba(255,255,255,0.12)"/><circle cx="80" cy="180" r="1.5" fill="rgba(255,255,255,0.12)"/></pattern></defs><rect width="200" height="200" fill="url(%23grain)"/></svg>');
    opacity: 0.4;
    pointer-events: none; /* Asegurar que no interfiera con clics */
}

.dashboard-title {
    font-size: 3rem;
    font-weight: var(--font-weight-bold);
    margin: 0 0 var(--spacing-sm) 0;
    position: relative;
    z-index: 1;
}

.agorai-logo {
    font-size: 3.5rem;
    margin-right: var(--spacing-sm);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.dashboard-subtitle {
    font-size: 1.2rem;
    margin: 0;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.dashboard-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.dashboard-section {
    background: linear-gradient(180deg, #0D0326 0%, #080618 100%);
    border-radius: 16px;
    padding: 32px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
}

.dashboard-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dashboard-section:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 191, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.12);
}

.dashboard-section:hover::before {
    opacity: 1;
}

.section-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 1.5rem;
    font-weight: var(--font-weight-semibold);
    margin: 0 0 var(--spacing-lg) 0;
    color: var(--text-primary);
}

.section-title.dashboard-h2 {
    font-family: 'Oxanium', var(--font-primary);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 600;
    text-align: center;
    justify-content: center;
    line-height: 1.2;
    background: linear-gradient(135deg, #00bfff 0%, #EB00B6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-icon {
    font-size: 1.8rem;
}

.about-content p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: var(--spacing-lg);
    text-align: center;
    font-weight: bold;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 32px;
}

.features-grid.features-grid-4 {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* Estilos específicos para tema claro en feature cards */
:root:not([data-theme="dark"]) .feature-card,
html:not([data-theme="dark"]) .feature-card {
    background: #ffffff !important;
    border: 1px solid rgba(13, 3, 38, 0.12) !important;
    box-shadow: 0 2px 8px rgba(13, 3, 38, 0.08) !important;
}

:root:not([data-theme="dark"]) .feature-card::before,
html:not([data-theme="dark"]) .feature-card::before {
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.05) 0%, rgba(235, 0, 182, 0.05) 100%) !important;
}

:root:not([data-theme="dark"]) .feature-card:hover,
html:not([data-theme="dark"]) .feature-card:hover {
    border-color: rgba(235, 0, 182, 0.3) !important;
    box-shadow: 0 8px 24px rgba(235, 0, 182, 0.15) !important;
    background: #ffffff !important;
}

:root:not([data-theme="dark"]) .feature-card.feature-card-dark,
html:not([data-theme="dark"]) .feature-card.feature-card-dark {
    background: #ffffff !important;
    border: 1px solid rgba(13, 3, 38, 0.12) !important;
}

:root:not([data-theme="dark"]) .feature-card.feature-card-dark:hover,
html:not([data-theme="dark"]) .feature-card.feature-card-dark:hover {
    border-color: rgba(235, 0, 182, 0.3) !important;
    box-shadow: 0 12px 32px rgba(235, 0, 182, 0.15) !important;
    background: #ffffff !important;
}

:root:not([data-theme="dark"]) .feature-card h3,
html:not([data-theme="dark"]) .feature-card h3 {
    color: #1a1a1a !important;
}

:root:not([data-theme="dark"]) .feature-card:hover h3,
html:not([data-theme="dark"]) .feature-card:hover h3 {
    color: #EB00B6 !important;
}

:root:not([data-theme="dark"]) .feature-card p,
html:not([data-theme="dark"]) .feature-card p {
    color: #4a4a4a !important;
}

:root:not([data-theme="dark"]) .feature-card:hover p,
html:not([data-theme="dark"]) .feature-card:hover p {
    color: #1a1a1a !important;
}

.feature-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 24px 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.05) 0%, rgba(235, 0, 182, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.feature-card:hover {
    transform: translateY(-6px);
    border-color: rgba(235, 0, 182, 0.3);
    box-shadow: 0 8px 24px rgba(235, 0, 182, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card.feature-card-dark {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 12px !important;
    padding: 28px 20px !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
    backdrop-filter: blur(10px) !important;
}

.feature-card.feature-card-dark::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.08) 0%, rgba(235, 0, 182, 0.08) 100%) !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
    pointer-events: none !important;
}

.feature-card.feature-card-dark:hover {
    transform: translateY(-8px) !important;
    border-color: rgba(235, 0, 182, 0.4) !important;
    box-shadow: 0 12px 32px rgba(235, 0, 182, 0.25) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

.feature-card.feature-card-dark:hover::before {
    opacity: 1 !important;
}

.feature-card.feature-card-dark h3 {
    color: #ffffff;
    font-family: 'Oxanium', var(--font-primary);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.feature-card.feature-card-dark p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    line-height: 1.5;
}

.feature-icon-svg {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px auto;
    filter: brightness(0) saturate(100%) invert(27%) sepia(51%) saturate(2878%) hue-rotate(296deg) brightness(104%) contrast(97%);
    transition: all 0.3s ease;
    display: block;
}

.feature-card:hover .feature-icon-svg {
    transform: scale(1.1) rotate(5deg);
    filter: brightness(0) saturate(100%) invert(27%) sepia(51%) saturate(2878%) hue-rotate(296deg) brightness(120%) contrast(110%);
}

/* Estilos para tema claro - SVG en color #0D0326 */
:root:not([data-theme="dark"]) .feature-icon-svg,
html:not([data-theme="dark"]) .feature-icon-svg {
    filter: brightness(0) saturate(100%) invert(8%) sepia(15%) saturate(2000%) hue-rotate(240deg) brightness(95%) contrast(95%) !important;
}

:root:not([data-theme="dark"]) .feature-card:hover .feature-icon-svg,
html:not([data-theme="dark"]) .feature-card:hover .feature-icon-svg {
    filter: brightness(0) saturate(100%) invert(8%) sepia(15%) saturate(2000%) hue-rotate(240deg) brightness(85%) contrast(100%) !important;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: var(--primary-color);
}

.feature-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: var(--spacing-sm);
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: rgba(255, 255, 255, 0.95);
    font-family: 'Oxanium', sans-serif;
    letter-spacing: 0.3px;
    transition: color 0.3s ease;
}

.feature-card:hover h3 {
    color: rgba(255, 255, 255, 1);
}

.feature-card p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
    line-height: 1.6;
    transition: color 0.3s ease;
}

.feature-card:hover p {
    color: rgba(255, 255, 255, 0.9);
}

/* Prompter Styles */
.prompter-content p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

.prompter-form {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    border: 1px solid var(--border-color);
}

.prompter-textarea {
    width: 100%;
    min-height: 120px;
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
    margin-bottom: var(--spacing-md);
    transition: border-color var(--transition-fast);
}

.prompter-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.2);
}

.prompter-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.char-count {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.generated-prompt {
    margin-top: var(--spacing-lg);
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    border: 1px solid var(--border-color);
}

.generated-prompt h4 {
    margin: 0 0 var(--spacing-md) 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.prompt-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.prompt-content pre {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    font-family: var(--font-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 200px;
    overflow-y: auto;
}

/* Popular Rooms Styles */
.popular-rooms {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.popular-room-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    transition: all var(--transition-medium);
}

/* Mantener el layout flex en desktop con botón a la derecha solo para popular-room-card */
@media (min-width: 769px) {
    .popular-room-card {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .popular-room-card .room-actions {
        display: flex;
        flex-direction: row;
        gap: var(--spacing-sm);
        margin-left: var(--spacing-md);
        margin-top: 0;
        width: auto;
    }
    
    .popular-room-card .room-actions .btn-primary,
    .popular-room-card .room-actions .btn-secondary {
        width: auto;
    }
    
    /* Estilos para sidebar-header room-actions: botones uno debajo del otro */
    .sidebar-header .room-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
        flex-shrink: 0;
    }
    
    .sidebar-header .room-actions .btn-primary,
    .sidebar-header .room-actions .btn-secondary {
        width: 100%;
    }
}

.popular-room-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.room-info {
    flex: 1;
}

.room-name {
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
    margin: 0 0 var(--spacing-xs) 0;
    color: var(--text-primary);
}

.room-description {
    color: var(--text-secondary);
    margin: 0 0 var(--spacing-sm) 0;
    line-height: 1.4;
}

.room-stats {
    display: flex;
    gap: var(--spacing-md);
}

.stat {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* Primer icono (mensajes) - Color primario */
.stat:first-child .stat-icon {
    color: var(--primary-color) !important;
}

.stat:first-child .stat-icon i {
    color: var(--primary-color) !important;
}

/* Segundo icono (participantes) - Color secundario */
.stat:nth-child(2) .stat-icon {
    color: var(--secondary-color) !important;
}

.stat:nth-child(2) .stat-icon i {
    color: var(--secondary-color) !important;
}

/* Hover effect */
.stat:hover .stat-icon {
    transform: scale(1.1);
}

.stat-icon {
    font-size: 1rem;
}

.room-actions {
    flex-shrink: 0;
    display: flex;
    gap: 10px;
    align-items: center;
}

.room-actions .btn-secondary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.room-actions .btn-secondary i {
    font-size: 0.85rem;
}

.loading-placeholder,
.no-rooms,
.error-message {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-muted);
    font-style: italic;
}

.error-message {
    color: var(--danger-color);
}

/* Dark Theme Adjustments */
[data-theme="dark"] .dashboard-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

[data-theme="dark"] .feature-card {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .prompter-form,
[data-theme="dark"] .generated-prompt {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .popular-room-card {
    background: linear-gradient(180deg, #0D0326 0%, #080618 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .popular-room-card:hover {
    border-color: rgba(0, 191, 255, 0.3) !important;
}

[data-theme="dark"] .prompt-content pre {
    background: var(--bg-quaternary);
}

/* Responsive Design for Dashboard */
@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    .features-grid.features-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        padding: var(--spacing-md);
    }
    
    .dashboard-title {
        font-size: 2.5rem;
    }
    
    .agorai-logo {
        font-size: 3rem;
    }
    
    .dashboard-subtitle {
        font-size: 1rem;
    }
    
    .features-grid,
    .features-grid.features-grid-4 {
        grid-template-columns: 1fr;
    }
    
    .popular-room-card {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }
    
    .room-actions {
        margin-left: 0;
        width: 100%;
    }
    
    .room-actions .btn-primary {
        width: 100%;
    }
    
    .prompter-footer {
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: stretch;
    }
}

/* ===== BOTÓN EDITAR SALA ===== */
.edit-room-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: var(--spacing-sm);
    opacity: 0.7;
}

.edit-room-btn:hover {
    background-color: var(--bg-tertiary);
    opacity: 1;
    transform: scale(1.05);
}

.edit-room-btn.hidden {
    display: none;
}

.edit-icon {
    font-size: 1rem;
    color: var(--accent-color);
}

.edit-room-btn:hover .edit-icon {
    color: var(--accent-color);
    opacity: 0.8;
}

/* Tema oscuro para botón editar */
[data-theme="dark"] .edit-room-btn:hover {
    background-color: var(--bg-secondary);
}

[data-theme="dark"] .edit-icon {
    color: var(--accent-color);
}

[data-theme="dark"] .edit-room-btn:hover .edit-icon {
    color: var(--accent-color);
    opacity: 0.8;
}

/* ============================================================================
   ESTILOS ESPECÍFICOS PARA MODAL DE REPORTES
   ============================================================================ */

/* Checkbox personalizado para modal de reportes */
#reportModal .form-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: #f9fafb !important;
}

#reportModal .form-checkbox input[type="checkbox"] {
    display: none;
}

#reportModal .checkmark {
    width: 20px !important;
    height: 20px !important;
    border: 2px solid #6b7280 !important;
    border-radius: 4px !important;
    background: #374151 !important;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

#reportModal .form-checkbox input[type="checkbox"]:checked + .checkmark {
    background: #3b82f6 !important;
    border-color: #3b82f6 !important;
}

#reportModal .form-checkbox input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white !important;
    font-size: 14px !important;
    font-weight: bold;
}

#reportModal .form-checkbox:hover .checkmark {
    border-color: #3b82f6 !important;
}

/* Sobrescribir estilos específicos del tema oscuro para el modal de reportes */
#reportModal[data-theme="dark"] .checkmark,
#reportModal .checkmark {
    background: #374151 !important;
    border-color: #6b7280 !important;
}

#reportModal[data-theme="dark"] .form-checkbox input[type="checkbox"]:checked + .checkmark,
#reportModal .form-checkbox input[type="checkbox"]:checked + .checkmark {
    background: #3b82f6 !important;
    border-color: #3b82f6 !important;
}

/* Botón de cerrar del modal de reportes */
#reportModal .modal-close {
    background: none !important;
    border: none !important;
    font-size: 1.5rem !important;
    font-weight: bold !important;
    color: #f9fafb !important;
    cursor: pointer !important;
    padding: 8px !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 4px !important;
    transition: all 0.2s ease !important;
    line-height: 1 !important;
}

#reportModal .modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

#reportModal .modal-close:focus {
    outline: 2px solid #3b82f6 !important;
    outline-offset: 2px !important;
}

/* Lista de archivos del modal de reportes */
#reportModal .file-list-container {
    margin-top: 1rem;
    padding: 1rem;
    background: #374151 !important;
    border: 1px solid #4b5563 !important;
    border-radius: 8px !important;
}

#reportModal .file-list-header {
    color: #f9fafb !important;
    font-weight: 600 !important;
    margin-bottom: 0.75rem !important;
    font-size: 0.875rem !important;
}

#reportModal .file-list-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#reportModal .file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: #1f2937 !important;
    border: 1px solid #4b5563 !important;
    border-radius: 6px !important;
    transition: all 0.2s ease;
}

#reportModal .file-item:hover {
    background: #374151 !important;
    border-color: #6b7280 !important;
}

#reportModal .file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

#reportModal .file-icon {
    color: #3b82f6 !important;
    font-size: 1.25rem !important;
    width: 20px;
    text-align: center;
}

#reportModal .file-name {
    color: #f9fafb !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    flex: 1;
    word-break: break-word;
}

#reportModal .file-size {
    color: #9ca3af !important;
    font-size: 0.75rem !important;
    margin-left: 0.5rem;
}

#reportModal .remove-file-btn {
    background: #dc2626 !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    font-size: 0.875rem !important;
    font-weight: bold !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0;
}

#reportModal .remove-file-btn:hover {
    background: #b91c1c !important;
    transform: scale(1.1);
}

#reportModal .remove-file-btn:focus {
    outline: 2px solid #fbbf24 !important;
    outline-offset: 2px !important;
}

/* ============================================================================
   MENÚ CONTEXTUAL DE SALAS
   ============================================================================ */

/* ===== MENÚ CONTEXTUAL DE SALAS ===== */
.room-context-menu {
    position: fixed;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    min-width: 220px;
    max-width: 280px;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.room-context-menu:not(.hidden) {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: all;
}

.room-context-menu.hidden {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
    pointer-events: none;
}

.room-context-menu .context-menu-content {
    padding: 0;
    display: flex;
    flex-direction: column;
}

.room-context-menu .context-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    backdrop-filter: blur(10px);
}

.room-context-menu .context-menu-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.room-context-menu .context-menu-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.room-context-menu .context-menu-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.room-context-menu .context-menu-options {
    padding: 6px 0;
}

.room-context-menu .context-menu-option {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    text-align: left;
    gap: 12px;
    font-weight: 500;
}

.room-context-menu .context-menu-option:hover {
    background: rgba(102, 126, 234, 0.08);
    color: var(--text-primary);
    transform: translateX(4px);
}

.room-context-menu .context-menu-option i {
    width: 18px;
    text-align: center;
    color: var(--text-secondary);
    flex-shrink: 0;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.room-context-menu .context-menu-option:hover i {
    color: var(--primary-color);
    transform: scale(1.1);
}

.room-context-menu .context-menu-option#leaveRoomOption {
    color: #dc3545;
}

.room-context-menu .context-menu-option#leaveRoomOption i {
    color: #dc3545;
}

.room-context-menu .context-menu-option#leaveRoomOption:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.room-context-menu .context-menu-option#leaveRoomOption:hover i {
    color: #dc3545;
    transform: scale(1.1);
}

/* Tema oscuro para menú contextual de salas */
[data-theme="dark"] .room-context-menu {
    background: rgba(13, 3, 38, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

[data-theme="dark"] .room-context-menu .context-menu-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .room-context-menu .context-menu-option:hover {
    background: rgba(102, 126, 234, 0.15);
}

[data-theme="dark"] .room-context-menu .context-menu-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ============================================================================
   ESTILOS PARA BOTÓN Y MODAL DE INVITACIÓN
   ============================================================================ */

/* Botón de enlace de invitación */
.room-invite-link-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    font-size: 16px;
    width: 24px;
    height: 24px;
    opacity: 0.6;
    visibility: visible;
}

.room-invite-link-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--primary-color);
    transform: scale(1.1);
    opacity: 1;
}

.room-invite-link-btn.hidden {
    display: none !important;
}

.invite-icon {
    font-style: normal;
    font-weight: 600;
}

/* Modal de enlace de invitación */
.invite-link-container {
    max-width: 500px;
    width: 90%;
}

.invite-description {
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.invite-link-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.invite-link-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

.invite-link-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.1);
}

.copy-invite-link-btn {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.copy-invite-link-btn:hover {
    background: var(--primary-color-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.copy-invite-link-btn:active {
    transform: translateY(0);
}

.copy-invite-link-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.invite-link-status {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 10px;
}

.invite-link-status.success {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.invite-link-status.error {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.invite-link-status.info {
    background: rgba(33, 150, 243, 0.1);
    color: #2196f3;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

/* Botones de compartir en redes sociales */
.social-share-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    justify-content: center;
}

.social-share-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
    color: white;
    flex: 1;
    min-width: 120px;
    justify-content: center;
}

.social-share-btn i {
    font-size: 16px;
}

.social-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.social-share-btn:active {
    transform: translateY(0);
}

.social-share-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.whatsapp-btn {
    background: #25D366;
}

.whatsapp-btn:hover {
    background: #20BA5A;
}

.telegram-btn {
    background: #0088cc;
}

.telegram-btn:hover {
    background: #006ba3;
}

.twitter-btn {
    background: #000000;
}

.twitter-btn:hover {
    background: #1a1a1a;
}

.email-btn {
    background: #6c757d;
}

.email-btn:hover {
    background: #5a6268;
}

/* Tema oscuro */
[data-theme="dark"] .room-invite-link-btn {
    color: var(--text-secondary);
}

[data-theme="dark"] .room-invite-link-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--primary-color);
}

[data-theme="dark"] .invite-link-input {
    background: var(--bg-primary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .invite-link-input:focus {
    border-color: var(--primary-color);
}

/* ============================================================================
 * ESTILOS MÓVIL - LAYOUT RESPONSIVO
 * ============================================================================ */

/* Botones CTA móvil en dashboard */
.mobile-cta-buttons {
    display: none;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(180deg, #0D0326 0%, #080618 100%);
    border-radius: 12px;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    flex-direction: row; /* Por defecto en fila para móvil */
}

/* Aplicar fondo solo en modo oscuro - modo claro sin fondo */
:root:not([data-theme="dark"]) .mobile-cta-buttons,
html:not([data-theme="dark"]) .mobile-cta-buttons {
    background: transparent !important;
}

[data-theme="dark"] .mobile-cta-buttons {
    background: linear-gradient(180deg, #0D0326 0%, #080618 100%) !important;
    padding-top: 70px !important; /* Espacio para el header fijo */
}

.mobile-cta-buttons .btn {
    flex: 1;
    padding: 14px 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
}

/* En desktop, mostrar botones en columna */
@media (min-width: 769px) {
    .mobile-cta-buttons {
        flex-direction: column;
    }
    
    .mobile-cta-buttons .btn {
        flex: none;
        width: 100%;
    }
}

/* Botón volver móvil */
.mobile-back-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    color: var(--text-primary);
    margin-right: 8px;
}

.mobile-back-btn:hover {
    color: var(--primary-color);
}

/* Botón participantes móvil en header */
.mobile-participants-btn {
    display: none;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 20px;
    padding: 6px 12px;
    cursor: pointer;
    color: white;
    font-size: 0.9rem;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.mobile-participant-count {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.75rem;
}

/* Bottom Sheet de Salas */
.mobile-bottom-sheet {
    display: flex;
    flex-direction: column;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(180deg, #0D0326 0%, #080618 100%);
    border-top: 2px solid rgba(0, 191, 255, 0.3);
    border-radius: 20px 20px 0 0;
    transition: transform 0.3s ease;
    max-height: 70vh;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.mobile-bottom-sheet.collapsed {
    transform: translateY(calc(100% - 65px));
}

.mobile-bottom-sheet.collapsed .mobile-sheet-content {
    display: none;
}

.mobile-bottom-sheet.expanded {
    transform: translateY(0);
}

.mobile-bottom-sheet.hidden {
    display: none !important;
}

.mobile-sheet-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 16px 16px;
    cursor: pointer;
    position: relative;
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.1), rgba(235, 0, 182, 0.1));
    border-radius: 20px 20px 0 0;
    flex-shrink: 0;
}

.handle-bar {
    position: absolute;
    top: 10px;
    width: 50px;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
}

.mobile-sheet-handle .sheet-title {
    font-weight: 700;
    color: white !important;
    font-size: 1.1rem;
    margin-top: 8px;
}

.mobile-sheet-handle .sheet-count {
    color: white !important;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 8px;
}

.mobile-sheet-handle,
.mobile-sheet-handle * {
    color: white !important;
}

.mobile-sheet-content {
    padding: 0 16px 16px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.mobile-room-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.mobile-room-actions .btn {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
}

.mobile-rooms-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Bottom Sheet de Participantes */
.mobile-participants-sheet {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10002;
}

.mobile-participants-sheet:not(.hidden) {
    display: block;
}

.mobile-sheet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
}

.mobile-sheet-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    background: linear-gradient(180deg, #0D0326 0%, #080618 100%);
    border-left: 1px solid rgba(255,255,255,0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.2);
}

/* Estilos para tema claro */
:root:not([data-theme="dark"]) .mobile-sheet-panel,
html:not([data-theme="dark"]) .mobile-sheet-panel {
    background: #ffffff !important;
    border-left: 1px solid rgba(13, 3, 38, 0.15) !important;
    box-shadow: -4px 0 24px rgba(13, 3, 38, 0.15) !important;
}

.mobile-participants-sheet.open .mobile-sheet-panel {
    transform: translateX(0);
}

.mobile-sheet-header {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    gap: 8px;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

.mobile-sheet-header .sheet-title {
    font-weight: 600;
    color: white;
    font-family: 'Oxanium', sans-serif;
}

.mobile-sheet-header .sheet-count {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Estilos para tema claro */
:root:not([data-theme="dark"]) .mobile-sheet-header,
html:not([data-theme="dark"]) .mobile-sheet-header {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color)) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
}

:root:not([data-theme="dark"]) .mobile-sheet-header .sheet-title,
html:not([data-theme="dark"]) .mobile-sheet-header .sheet-title {
    color: white !important;
}

:root:not([data-theme="dark"]) .mobile-sheet-header .sheet-count,
html:not([data-theme="dark"]) .mobile-sheet-header .sheet-count {
    color: rgba(255, 255, 255, 0.9) !important;
}

.mobile-sheet-close {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.mobile-sheet-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 1);
    transform: rotate(90deg);
}

/* Estilos para tema claro */
:root:not([data-theme="dark"]) .mobile-sheet-close,
html:not([data-theme="dark"]) .mobile-sheet-close {
    color: rgba(255, 255, 255, 0.8) !important;
}

:root:not([data-theme="dark"]) .mobile-sheet-close:hover,
html:not([data-theme="dark"]) .mobile-sheet-close:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: rgba(255, 255, 255, 1) !important;
}

.mobile-participants-list {
    padding: 16px;
    overflow-y: auto;
    max-height: calc(100vh - 60px);
    background: transparent;
}

/* Estilos para tema claro */
:root:not([data-theme="dark"]) .mobile-participants-list,
html:not([data-theme="dark"]) .mobile-participants-list {
    background: #ffffff !important;
}

/* Scrollbar personalizada para mobile-participants-list en tema claro */
:root:not([data-theme="dark"]) .mobile-participants-list::-webkit-scrollbar,
html:not([data-theme="dark"]) .mobile-participants-list::-webkit-scrollbar {
    width: 8px;
}

:root:not([data-theme="dark"]) .mobile-participants-list::-webkit-scrollbar-track,
html:not([data-theme="dark"]) .mobile-participants-list::-webkit-scrollbar-track {
    background: rgba(13, 3, 38, 0.05);
    border-radius: 4px;
}

:root:not([data-theme="dark"]) .mobile-participants-list::-webkit-scrollbar-thumb,
html:not([data-theme="dark"]) .mobile-participants-list::-webkit-scrollbar-thumb {
    background: rgba(235, 0, 182, 0.3);
    border-radius: 4px;
}

:root:not([data-theme="dark"]) .mobile-participants-list::-webkit-scrollbar-thumb:hover,
html:not([data-theme="dark"]) .mobile-participants-list::-webkit-scrollbar-thumb:hover {
    background: rgba(235, 0, 182, 0.5);
}

/* Para Firefox */
:root:not([data-theme="dark"]) .mobile-participants-list,
html:not([data-theme="dark"]) .mobile-participants-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(235, 0, 182, 0.3) rgba(13, 3, 38, 0.05);
}

/* ===== MEDIA QUERIES MÓVIL ===== */
@media (max-width: 768px) {
    /* Body y html sin overflow hidden */
    html, body {
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    /* App container scrollable */
    #appContainer {
        height: auto !important;
        min-height: 100vh;
        overflow: visible !important;
    }

    /* Ocultar sidebars en móvil */
    .sidebar-left,
    .sidebar-right {
        display: none !important;
    }

    /* Layout principal móvil */
    .app-layout {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
        height: auto !important;
        min-height: auto !important;
    }

    /* Main content ocupa todo el ancho */
    .main-content {
        border-radius: 0;
        width: 100vw !important;
        max-width: 100vw !important;
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
    }

    /* Dashboard ocupa todo el ancho */
    .dashboard-right-container,
    .dashboard-container {
        padding: 12px !important;
        padding-bottom: 20px !important;
        width: 100vw !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
        height: auto !important;
        overflow: visible !important;
    }

    .dashboard-right-content,
    .dashboard-content {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        row-gap: var(--spacing-md) !important;
    }

    .dashboard-section {
        margin: 0 0 16px 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .about-content {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Footer en móvil */
    .legal-footer {
        position: relative !important;
        margin-bottom: 0 !important;
        padding-bottom: 90px !important;
    }

    /* Ocultar footer en modo chat móvil */
    body.mobile-chat-mode .legal-footer {
        display: none !important;
    }
    
    /* Botón cerrar sesión en rojo en mobile */
    .dropdown-item.logout-item {
        color: #ef4444 !important;
    }
    
    .dropdown-item.logout-item:hover {
        color: #dc2626 !important;
    }
    
    [data-theme="dark"] .dropdown-item.logout-item {
        color: #ef4444 !important;
    }
    
    [data-theme="dark"] .dropdown-item.logout-item:hover {
        color: #dc2626 !important;
    }

    /* Bottom sheet visible en móvil */
    .mobile-bottom-sheet {
        display: flex !important;
        flex-direction: column !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 9999 !important;
        height: 70vh !important;
        max-height: 70vh !important;
    }
    
    .mobile-bottom-sheet.expanded {
        height: 70vh !important;
        max-height: 70vh !important;
    }
    
    .mobile-sheet-content {
        flex: 1 !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        height: 0 !important; /* Necesario para que flex funcione */
        touch-action: pan-y !important;
        overscroll-behavior: contain !important;
    }
    
    .mobile-rooms-list {
        touch-action: pan-y !important;
    }

    .mobile-bottom-sheet.hidden {
        display: none !important;
    }

    /* Chat input fijo arriba del bottom sheet */
    .chat-input {
        position: fixed !important;
        bottom: 65px !important; /* Altura del bottom sheet colapsado */
        left: 0 !important;
        right: 0 !important;
        z-index: 9998 !important;
        background: transparent !important;
        border-top: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Quitar gap del input-container en mobile */
    .input-container {
        gap: 0 !important;
        height: 100% !important;
        align-items: stretch !important;
    }

    /* textbox-area ocupa 100% de altura dentro de input-container (igual que los botones: 84px) */
    .textbox-area {
        height: 84px !important;
        min-height: 84px !important;
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
    }

    /* message-input ocupa toda la altura del textbox-area (igual que los botones: 40px + 4px gap + 40px = 84px) */
    /* font-size: 16px evita el zoom automático en iOS Safari */
    .message-input {
        height: 84px !important;
        min-height: 84px !important;
        max-height: 84px !important;
        padding: 8px 12px !important;
        font-size: 16px !important; /* 16px mínimo para evitar zoom en iOS */
        resize: none !important;
        overflow-y: auto !important;
        line-height: 1.4 !important;
    }

    /* Reducir tamaño de botones en mobile */
    .emoji-btn,
    .send-btn {
        padding: 8px 12px !important;
        min-width: 40px !important;
        height: 40px !important;
        font-size: 0.9rem !important;
    }

    .emoji-btn i,
    .send-btn i {
        font-size: 0.9rem !important;
    }

    /* Ajustar buttons-column en mobile */
    .buttons-column {
        width: 40px !important;
        gap: 4px !important;
    }

    /* Prevenir zoom en iOS al hacer focus - solo para message-input */
    @supports (-webkit-touch-callout: none) {
        /* Solo aplica en iOS */
        .message-input {
            -webkit-tap-highlight-color: transparent !important;
        }
    }

    /* Ajustar mensajes para no quedar tapados */
    .chat-messages {
        padding-bottom: 140px !important; /* Espacio para input + bottom sheet */
    }

    /* Mostrar botones CTA móvil en dashboard */
    .mobile-cta-buttons {
        display: flex;
    }

    /* Mostrar bottom sheet de salas */
    .mobile-bottom-sheet:not(.hidden) {
        display: block;
    }

    /* Mostrar botones móviles */
    .mobile-back-btn:not(.hidden),
    .mobile-participants-btn:not(.hidden) {
        display: flex;
    }

    /* Chat header fijo arriba */
    .chat-header {
        position: fixed !important;
        top: 60px !important; /* Debajo del header principal */
        left: 0 !important;
        right: 0 !important;
        z-index: 9997 !important;
        padding: 6px 16px 6px 16px;
        border-radius: 0;
        background: linear-gradient(180deg, #0D0326 0%, #080618 100%) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    }

    /* Ajustar mensajes para no quedar tapados por header */
    .chat-messages {
        position: fixed !important;
        top: 110px !important; /* header 60px + chat-header 50px */
        left: 0 !important;
        right: 0 !important;
        bottom: 180px !important; /* input (~115px) + bottom sheet (65px) */
        overflow-y: scroll !important;
        -webkit-overflow-scrolling: touch !important;
        margin: 0 !important;
        padding: 16px !important;
        padding-bottom: 20px !important;
    }

    .room-title-container {
        flex: 1;
        overflow: hidden;
    }

    .room-title {
        font-size: 1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Ocultar solo tags en header móvil */
    .room-tags-container {
        display: none !important;
    }

    /* Mostrar botones de info, editar e invitación en móvil */
    .room-info-tooltip {
        display: flex !important;
    }
    
    /* Solo mostrar botones si no tienen clase hidden */
    .edit-room-btn:not(.hidden),
    .room-invite-link-btn:not(.hidden) {
        display: flex !important;
    }
    
    /* Asegurar que los botones con clase hidden estén ocultos */
    .edit-room-btn.hidden,
    .room-invite-link-btn.hidden {
        display: none !important;
    }

    .room-info-btn,
    .edit-room-btn,
    .room-invite-link-btn {
        padding: 4px !important;
        font-size: 0.9rem !important;
    }

    /* Tooltip de información en móvil */
    .room-info-tooltip .tooltip-content {
        position: fixed !important;
        top: 115px !important;
        left: 16px !important;
        right: 16px !important;
        transform: none !important;
        z-index: 10001 !important;
        max-width: calc(100vw - 32px) !important;
    }

    .room-info-tooltip .tooltip-arrow {
        display: none !important;
    }

    /* Botón de menú contextual en móvil para salas */
    .mobile-room-menu-btn {
        display: flex !important;
        background: none;
        border: none;
        color: rgba(255, 255, 255, 0.6);
        font-size: 1.2rem;
        padding: 8px;
        cursor: pointer;
        border-radius: 50%;
        transition: all 0.2s ease;
    }

    .mobile-room-menu-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        color: white;
    }

    /* Botón de menú contextual para participantes */
    .mobile-participant-menu-btn {
        display: flex !important;
        background: none;
        border: none;
        color: rgba(255, 255, 255, 0.6);
        font-size: 1rem;
        padding: 6px;
        cursor: pointer;
        border-radius: 50%;
        margin-left: auto;
    }

    .mobile-participant-menu-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        color: white;
    }

    /* Room item en móvil con botón de menú */
    .mobile-rooms-list .room-item {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    .mobile-rooms-list .room-item-info {
        flex: 1;
        overflow: hidden;
    }

    /* Participante en móvil con botón de menú */
    .mobile-participants-list .participant {
        display: flex !important;
        align-items: center !important;
        position: relative;
    }

    .mobile-participants-list .participant .mobile-participant-menu-btn {
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    /* Estilos para tema claro en participantes mobile */
    :root:not([data-theme="dark"]) .mobile-participants-list .participant,
    html:not([data-theme="dark"]) .mobile-participants-list .participant {
        background: #ffffff !important;
        border: 1px solid rgba(13, 3, 38, 0.1) !important;
        border-radius: 8px !important;
        padding: 12px !important;
        margin-bottom: 8px !important;
        transition: all 0.3s ease !important;
    }
    
    :root:not([data-theme="dark"]) .mobile-participants-list .participant:hover,
    html:not([data-theme="dark"]) .mobile-participants-list .participant:hover {
        background: #f8f8f8 !important;
        border-color: rgba(235, 0, 182, 0.3) !important;
        box-shadow: 0 2px 8px rgba(235, 0, 182, 0.1) !important;
    }
    
    :root:not([data-theme="dark"]) .mobile-participants-list .participant-name,
    html:not([data-theme="dark"]) .mobile-participants-list .participant-name {
        color: #1a1a1a !important;
    }
    
    :root:not([data-theme="dark"]) .mobile-participants-list .participant-role,
    html:not([data-theme="dark"]) .mobile-participants-list .participant-role {
        color: #4a4a4a !important;
    }
    
    :root:not([data-theme="dark"]) .mobile-participant-menu-btn,
    html:not([data-theme="dark"]) .mobile-participant-menu-btn {
        color: #4a4a4a !important;
    }
    
    :root:not([data-theme="dark"]) .mobile-participant-menu-btn:hover,
    html:not([data-theme="dark"]) .mobile-participant-menu-btn:hover {
        background: rgba(235, 0, 182, 0.1) !important;
        color: #EB00B6 !important;
    }

    /* Z-index alto para menús contextuales en móvil */
    .participant-context-menu {
        z-index: 10010 !important;
    }

    .room-context-menu {
        z-index: 10010 !important;
    }

    /* Chat messages */
    .chat-messages {
        border-radius: 0;
        padding-bottom: 80px;
    }

    /* Chat input */
    .chat-input {
        border-radius: 0;
        padding: 0;
    }

    .message-input {
        font-size: 16px;
    }

    /* Ajustes del dashboard */
    .dashboard-section {
        padding: var(--spacing-md);
        width: 100%;
        box-sizing: border-box;
    }

    .dashboard-h2 {
        font-size: 1.3rem !important;
    }

    .about-content p {
        font-size: 0.95rem;
    }

    /* Features grid 2 columnas en móvil */
    .features-grid,
    .features-grid.features-grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: var(--spacing-sm);
    }

    .feature-card {
        padding: var(--spacing-sm);
    }

    .feature-card h3 {
        font-size: 0.85rem;
    }

    .feature-card p {
        font-size: 0.75rem;
        display: none;
    }

    .feature-icon-svg {
        width: 50px;
        height: 50px;
    }

    /* Salas populares */
    .popular-rooms {
        gap: var(--spacing-sm);
    }

    .popular-room-card {
        padding: var(--spacing-sm);
    }
}

/* Pantallas muy pequeñas */
@media (max-width: 480px) {
    .features-grid,
    .features-grid.features-grid-4 {
        grid-template-columns: 1fr !important;
    }

    .mobile-room-actions {
        flex-direction: column;
    }

    .mobile-sheet-panel {
        width: 100%;
    }
}

/* ===== INDICADOR DE CARGA PARA MENSAJES ANTIGUOS ===== */
.older-messages-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    color: #6c757d;
    font-size: 0.9rem;
    border-bottom: 1px solid #e9ecef;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.older-messages-loader:not([style*="display: none"]) {
    display: flex;
}

.loading-spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid #e9ecef;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { 
        transform: rotate(360deg); 
    }
}

/* Ocultar loader cuando no está activo */
.older-messages-loader[style*="display: none"] {
    display: none !important;
}
