feat(ai): redesign mobile chat widget with Mercado Libre bottom-sheet UX and keyboard docking (v3.8.36)

This commit is contained in:
2026-10-27 22:25:13 -03:00
parent d56b2570d1
commit 939878c4a8
9 changed files with 775 additions and 310 deletions
+484 -223
View File
@@ -4,53 +4,84 @@
{% set current_user_name = active_auth_user.first_name if (active_auth_user and active_auth_user.first_name) else (active_auth_user.name if active_auth_user else '') %}
{% set current_role_name = (active_auth_user.role if active_auth_user and active_auth_user.role else 'alumno') | lower %}
<!-- ===================================================== -->
<!-- WIDGET FLOTANTE: UdeCi - TUTOR VIRTUAL UNICABA -->
<!-- SDD-010: Arquitectura RAG y Asistencia Contextual -->
<!-- WIDGET UdeCi: TUTOR VIRTUAL UNICABA (UX ESTILO MELI) -->
<!-- Bottom Sheet Nativo en Móvil + Input Dock Inteligente -->
<!-- ===================================================== -->
<!-- Backdrop de Bloqueo en Móvil -->
<div id="aiChatBackdrop" class="ai-chat-backdrop d-none" aria-hidden="true"></div>
<div id="aiChatContainer" class="ai-chat-container"
data-user-id="{{ current_user_id }}"
data-user-email="{{ current_user_email }}"
data-user-name="{{ current_user_name }}"
data-user-role="{{ current_role_name }}">
<!-- Botón Lanzador Flotante -->
<button id="aiChatLauncher" class="ai-chat-launcher btn shadow-lg" type="button" aria-label="Abrir UdeCi" title="UdeCi - Tutor Virtual UniCABA">
<span class="ai-launcher-icon"><i class="bi bi-chat-heart-fill"></i></span>
<button id="aiChatLauncher" class="ai-chat-launcher btn shadow-lg" type="button" aria-label="Abrir tutor UdeCi" title="UdeCi - Tutor Virtual UniCABA">
<span class="ai-launcher-icon"><i class="bi bi-stars"></i></span>
<span class="ai-launcher-badge pulse-dot"></span>
</button>
<!-- Panel de Conversación -->
<div id="aiChatPanel" class="ai-chat-panel card shadow-lg border-0 d-none" role="dialog" aria-modal="true" aria-labelledby="aiChatTitle">
<!-- Cabecera Limpia e Institucional de UdeCi -->
<div class="card-header ai-chat-header d-flex align-items-center justify-content-between p-3 border-bottom">
<div class="d-flex align-items-center gap-2 overflow-hidden">
<div class="ai-avatar-circle">
<i class="bi bi-mortarboard-fill text-white"></i>
<!-- Panel de Conversación (Bottom Sheet en Móvil / Ventana Flotante en Desktop) -->
<div id="aiChatPanel" class="ai-chat-panel card border-0 d-none" role="dialog" aria-modal="true" aria-labelledby="aiChatTitle">
<!-- Drag Handle Superior (Estilo Nativo Móvil) -->
<div class="ai-sheet-handle-bar" id="aiSheetHandleBar" title="Desliza para cerrar">
<span class="ai-sheet-handle"></span>
</div>
<!-- Cabecera de Navegación y Acciones -->
<div class="ai-chat-header d-flex align-items-center justify-content-between px-3 pt-1 pb-2">
<!-- Botón de Retroceso / Minimizar (Móvil & Desktop) -->
<button type="button" class="ai-btn-circle" id="aiChatBackBtn" title="Cerrar asistente" aria-label="Volver">
<i class="bi bi-chevron-left fs-6"></i>
</button>
<!-- Título Central con Ícono IA -->
<div class="d-flex align-items-center gap-2 text-center overflow-hidden">
<div class="ai-header-sparkle-badge">
<i class="bi bi-stars"></i>
</div>
<div class="lh-sm text-truncate">
<div class="d-flex align-items-center gap-2">
<h6 class="mb-0 fw-bold text-white" id="aiChatTitle">UdeCi</h6>
<span class="badge bg-white text-primary fw-semibold rounded-pill px-2 py-0" style="font-size: 0.68rem;">Tutor Virtual</span>
</div>
<small class="text-white-50 d-flex align-items-center gap-1 mt-1" style="font-size: 0.73rem;">
<span class="status-indicator-dot"></span>
<span>UniCABA &bull; En línea</span>
</small>
<div class="lh-1 text-truncate">
<h6 class="mb-0 fw-bold ai-header-title text-truncate" id="aiChatTitle">UdeCi</h6>
<small class="ai-header-subtitle">Tutor Virtual UniCABA</small>
</div>
</div>
<!-- Botones de Acción Derecha: Nuevo Chat + Opciones + Cerrar -->
<div class="d-flex align-items-center gap-1">
<button type="button" class="btn btn-sm btn-outline-light border-0 py-1 px-2" id="aiChatClearBtn" title="Reiniciar chat">
<i class="bi bi-arrow-clockwise"></i>
<button type="button" class="ai-btn-circle" id="aiChatClearBtn" title="Nueva conversación" aria-label="Nueva conversación">
<i class="bi bi-pencil-square fs-6"></i>
</button>
<button type="button" class="btn btn-sm btn-outline-light border-0 py-1 px-2" id="aiChatCloseBtn" title="Cerrar">
<i class="bi bi-x-lg"></i>
<button type="button" class="ai-btn-circle" id="aiChatChipsToggleBtn" title="Temas de ayuda" aria-label="Temas sugeridos">
<i class="bi bi-sliders fs-6"></i>
</button>
<button type="button" class="ai-btn-circle d-none d-md-inline-flex" id="aiChatCloseBtn" title="Cerrar ventana" aria-label="Cerrar">
<i class="bi bi-x-lg fs-6"></i>
</button>
</div>
</div>
<!-- Área de Mensajes -->
<div class="card-body ai-chat-messages p-3" id="aiChatMessages" tabindex="0">
<!-- Mensaje de bienvenida inicial y conversación -->
<!-- Subtítulo / Disclaimer Institucional (Estilo Mercado Libre) -->
<div class="ai-chat-disclaimer px-3 py-1">
<small class="text-muted d-block text-center">UdeCi usa inteligencia artificial para responderte.</small>
</div>
<!-- Panel Desplegable de Temas / Sugerencias Rápidas (+) -->
<div id="aiChatQuickChips" class="ai-quick-chips-drawer d-none px-3 py-2 border-bottom">
<div class="d-flex align-items-center justify-content-between mb-1">
<span class="small fw-semibold text-muted text-uppercase" style="font-size:0.68rem; letter-spacing:0.05em;">Consultas Rápidas</span>
<button type="button" class="btn-close btn-close-sm" id="aiChatCloseChipsBtn" aria-label="Ocultar"></button>
</div>
<div class="ai-chips-container d-flex flex-wrap gap-1" id="aiRoleChipsContainer">
<!-- Se inyectan dinámicamente según el rol -->
</div>
</div>
<!-- Área de Conversación (Mensajes) -->
<div class="ai-chat-messages px-3 py-2" id="aiChatMessages" tabindex="0">
<!-- Conversación generada dinámicamente -->
</div>
<!-- Indicador de Respuesta en Progreso -->
@@ -63,32 +94,58 @@
</small>
</div>
<!-- Área de Entrada / Envío -->
<div class="card-footer ai-chat-footer p-2 border-top">
<form id="aiChatForm" class="d-flex align-items-center gap-2 m-0" onsubmit="handleAiChatSubmit(event)">
<textarea id="aiChatInput" class="form-control form-control-sm ai-chat-textarea"
rows="1"
placeholder="Escribe tu consulta aquí..."
aria-label="Mensaje para UdeCi"></textarea>
<button type="submit" class="btn btn-primary btn-sm rounded-circle ai-send-btn" id="aiChatSendBtn" title="Enviar consulta">
<i class="bi bi-send-fill"></i>
</button>
<!-- Dock de Entrada (Input estilo Mercado Libre) -->
<div class="ai-chat-footer px-3 py-2" id="aiChatFooter">
<form id="aiChatForm" class="m-0" onsubmit="handleAiChatSubmit(event)">
<div class="ai-input-pill-container d-flex align-items-center gap-2">
<!-- Botón + para abrir atajos rápidos -->
<button type="button" class="ai-input-plus-btn" id="aiChatPlusBtn" title="Consultas rápidas" aria-label="Abrir temas">
<i class="bi bi-plus-lg"></i>
</button>
<!-- Campo de texto autorregulable -->
<textarea id="aiChatInput" class="form-control ai-chat-textarea border-0 shadow-none p-0"
rows="1"
placeholder="Pregúntame"
aria-label="Mensaje para UdeCi"></textarea>
<!-- Botón Enviar con ícono elevado -->
<button type="submit" class="ai-send-btn" id="aiChatSendBtn" title="Enviar consulta" aria-label="Enviar">
<i class="bi bi-arrow-up-circle-fill fs-4"></i>
</button>
</div>
</form>
</div>
</div>
</div>
<style>
/* Contenedor Flotante */
/* ==============================================================
ESTILOS BASE: WIDGET UdeCi CON ESTÉTICA MERCADO LIBRE
============================================================== */
/* Backdrop para Móvil */
.ai-chat-backdrop {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(15, 23, 42, 0.55);
backdrop-filter: blur(3px);
-webkit-backdrop-filter: blur(3px);
z-index: 1065;
transition: opacity 0.25s ease;
}
/* Contenedor Flotante Principal */
.ai-chat-container {
position: fixed;
bottom: 24px;
right: 24px;
z-index: 1060;
z-index: 1070;
font-family: inherit;
}
/* Botón Lanzador */
/* Botón Lanzador Flotante (Desktop y estado cerrado) */
.ai-chat-launcher {
width: 56px;
height: 56px;
@@ -109,7 +166,7 @@
box-shadow: 0 12px 30px rgba(180, 62, 142, 0.5) !important;
}
.ai-launcher-icon {
font-size: 1.55rem;
font-size: 1.45rem;
line-height: 1;
}
.pulse-dot {
@@ -130,212 +187,226 @@
100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
/* Panel de Conversación */
/* ==============================================================
PANEL DE CONVERSACIÓN: DESKTOP
============================================================== */
.ai-chat-panel {
width: 380px;
width: 400px;
max-width: calc(100vw - 32px);
height: 520px;
height: 560px;
max-height: calc(100vh - 90px);
border-radius: 18px !important;
border-radius: 24px !important;
overflow: hidden;
display: flex;
flex-direction: column;
box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35) !important;
animation: aiSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45) !important;
backdrop-filter: none !important;
-webkit-backdrop-filter: none !important;
opacity: 1 !important;
background: #ffffff;
border: 1px solid rgba(180, 62, 142, 0.2) !important;
z-index: 1075;
}
@keyframes aiSlideUp {
from { opacity: 0; transform: translateY(16px) scale(0.97); }
to { opacity: 1; transform: translateY(0) scale(1); }
}
/* Modo Oscuro 100% Sólido y Opaco (Cero Transparencia) */
[data-bs-theme="dark"] .ai-chat-panel,
[data-bs-theme="dark"] #aiChatPanel {
background-color: #0f172a !important;
background: #0f172a !important;
border: 1px solid #334155 !important;
opacity: 1 !important;
/* Ocultar handle bar en desktop */
.ai-sheet-handle-bar {
display: none;
width: 100%;
text-align: center;
padding: 8px 0 2px 0;
cursor: grab;
user-select: none;
}
[data-bs-theme="dark"] .ai-chat-header {
background-color: #1e293b !important;
background: #1e293b !important;
border-bottom: 1px solid #334155 !important;
}
[data-bs-theme="dark"] .ai-chat-messages,
[data-bs-theme="dark"] #aiChatMessages {
background-color: #0f172a !important;
background: #0f172a !important;
opacity: 1 !important;
}
[data-bs-theme="dark"] .ai-chat-footer {
background-color: #1e293b !important;
background: #1e293b !important;
border-top: 1px solid #334155 !important;
}
[data-bs-theme="dark"] .ai-chat-textarea {
background-color: #0f172a !important;
color: #f8fafc !important;
border: 1px solid #475569 !important;
.ai-sheet-handle {
display: inline-block;
width: 40px;
height: 4px;
background: rgba(100, 116, 139, 0.35);
border-radius: 4px;
}
/* Modo Claro 100% Sólido y Opaco */
[data-bs-theme="light"] .ai-chat-panel,
[data-bs-theme="light"] #aiChatPanel {
background-color: #ffffff !important;
background: #ffffff !important;
border: 1px solid rgba(180, 62, 142, 0.25) !important;
opacity: 1 !important;
/* Cabecera Estilo Mercado Libre */
.ai-chat-header {
background: #ffffff;
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
[data-bs-theme="light"] .ai-chat-header {
background: linear-gradient(135deg, #B43E8E 0%, #8A256B 100%) !important;
border-bottom: 1px solid rgba(180, 62, 142, 0.2) !important;
.ai-header-title {
color: #0F172A;
font-size: 0.98rem;
}
[data-bs-theme="light"] .ai-chat-messages,
[data-bs-theme="light"] #aiChatMessages {
background-color: #FAF5F8 !important;
background: #FAF5F8 !important;
opacity: 1 !important;
.ai-header-subtitle {
font-size: 0.72rem;
color: #64748B;
}
[data-bs-theme="light"] .ai-chat-footer {
background-color: #ffffff !important;
background: #ffffff !important;
border-top: 1px solid rgba(180, 62, 142, 0.2) !important;
}
[data-bs-theme="light"] .ai-chat-textarea {
background-color: #ffffff !important;
color: #1e293b !important;
border: 1px solid #cbd5e1 !important;
}
.ai-avatar-circle {
width: 36px;
height: 36px;
.ai-header-sparkle-badge {
width: 32px;
height: 32px;
border-radius: 50%;
background: rgba(255, 255, 255, 0.25);
background: linear-gradient(135deg, rgba(180, 62, 142, 0.15) 0%, rgba(37, 99, 235, 0.15) 100%);
color: #B43E8E;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.15rem;
}
.status-indicator-dot {
display: inline-block;
width: 7px;
height: 7px;
background-color: #22c55e;
border-radius: 50%;
font-size: 1.05rem;
}
/* Mensajes */
/* Botones Circulares del Header */
.ai-btn-circle {
width: 36px;
height: 36px;
border-radius: 50%;
border: 1px solid transparent;
background: rgba(241, 245, 249, 0.85);
color: #334155;
display: inline-flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.18s ease;
}
.ai-btn-circle:hover {
background: rgba(226, 232, 240, 1);
color: #0F172A;
transform: translateY(-1px);
}
/* Disclaimer Institucional */
.ai-chat-disclaimer {
background: rgba(248, 250, 252, 0.85);
border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.ai-chat-disclaimer small {
font-size: 0.73rem;
color: #64748B !important;
}
/* Drawer de Chips / Consultas Rápidas */
.ai-quick-chips-drawer {
background: #F8FAFC;
max-height: 180px;
overflow-y: auto;
}
.ai-chip-pill {
font-size: 0.76rem;
padding: 5px 12px;
border-radius: 20px;
background: #FFFFFF;
border: 1px solid #CBD5E1;
color: #1E293B;
cursor: pointer;
transition: all 0.15s ease;
font-weight: 500;
}
.ai-chip-pill:hover {
background: #B43E8E;
border-color: #B43E8E;
color: #FFFFFF;
transform: translateY(-1px);
}
/* Área de Mensajes */
.ai-chat-messages {
flex: 1 1 auto;
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 10px;
gap: 14px;
scroll-behavior: smooth;
background: #FFFFFF;
}
/* Mensajes Estilo Mercado Libre */
.ai-msg {
max-width: 86%;
padding: 9px 13px;
border-radius: 14px;
font-size: 0.86rem;
line-height: 1.45;
max-width: 88%;
word-break: break-word;
font-size: 0.92rem;
line-height: 1.48;
}
/* Mensaje del Usuario: Cápsula suave a la derecha con hora */
.ai-msg-user {
align-self: flex-end;
background-color: #0d6efd;
color: #ffffff;
border-bottom-right-radius: 3px;
background: #F1F5F9;
color: #0F172A;
padding: 9px 14px 6px 14px;
border-radius: 20px 20px 4px 20px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.ai-msg-user .ai-msg-time {
font-size: 0.68rem;
color: #94A3B8;
text-align: right;
margin-top: 3px;
display: block;
}
/* Mensaje del Asistente (UdeCi): Lienzo limpio sin caja pesada */
.ai-msg-assistant {
align-self: flex-start;
border-bottom-left-radius: 3px;
color: #0F172A;
padding: 2px 4px;
background: transparent;
width: 100%;
}
[data-bs-theme="dark"] .ai-msg-assistant {
background-color: #1e293b;
color: #f8fafc;
border: 1px solid #334155;
}
[data-bs-theme="light"] .ai-msg-assistant {
background-color: #f8fafc;
color: #0f172a;
border: 1px solid #e2e8f0;
.ai-msg-assistant p:last-child {
margin-bottom: 0;
}
/* Hipervínculos e Integraciones en los Mensajes */
.ai-chat-link {
/* Fila de Acciones debajo de la respuesta de UdeCi (Copiar, Audio, Feedback) */
.ai-msg-actions {
display: flex;
align-items: center;
gap: 10px;
margin-top: 8px;
padding-top: 4px;
}
.ai-action-icon-btn {
background: transparent;
border: none;
color: #94A3B8;
cursor: pointer;
padding: 3px 5px;
font-size: 0.9rem;
border-radius: 6px;
display: inline-flex;
align-items: center;
gap: 4px;
padding: 4px 10px;
margin: 4px 0;
border-radius: 8px;
font-size: 0.81rem;
font-weight: 500;
text-decoration: none !important;
transition: all 0.2s ease;
word-break: break-all;
justify-content: center;
transition: all 0.15s ease;
}
[data-bs-theme="light"] .ai-chat-link {
background-color: rgba(13, 110, 253, 0.08);
color: #0d6efd;
border: 1px solid rgba(13, 110, 253, 0.25);
.ai-action-icon-btn:hover {
color: #0F172A;
background: rgba(0, 0, 0, 0.05);
}
[data-bs-theme="light"] .ai-chat-link:hover {
background-color: #0d6efd;
color: #ffffff !important;
transform: translateY(-1px);
box-shadow: 0 2px 6px rgba(13, 110, 253, 0.25);
}
[data-bs-theme="dark"] .ai-chat-link {
background-color: rgba(56, 189, 248, 0.12);
color: #38bdf8;
border: 1px solid rgba(56, 189, 248, 0.3);
}
[data-bs-theme="dark"] .ai-chat-link:hover {
background-color: #38bdf8;
color: #0f172a !important;
transform: translateY(-1px);
box-shadow: 0 2px 6px rgba(56, 189, 248, 0.3);
.ai-action-icon-btn.active {
color: #B43E8E;
}
/* Botones de sugerencias debajo de la respuesta */
/* Opciones / Chips sugeridos en la respuesta */
.ai-msg-options {
display: flex;
flex-wrap: wrap;
gap: 6px;
margin-top: 8px;
margin-top: 10px;
}
.ai-option-btn {
font-size: 0.74rem;
padding: 3px 9px;
border-radius: 12px;
background-color: rgba(13, 110, 253, 0.08);
border: 1px solid rgba(13, 110, 253, 0.25);
color: #0d6efd;
font-size: 0.78rem;
padding: 5px 12px;
border-radius: 18px;
background-color: #FFFFFF;
border: 1px solid #CBD5E1;
color: #0F172A;
cursor: pointer;
transition: all 0.15s ease;
}
[data-bs-theme="dark"] .ai-option-btn {
background-color: rgba(56, 189, 248, 0.1);
border-color: rgba(56, 189, 248, 0.3);
color: #38bdf8;
font-weight: 500;
}
.ai-option-btn:hover {
background-color: #0d6efd;
color: #ffffff;
border-color: #0d6efd;
background-color: rgba(180, 62, 142, 0.1);
border-color: #B43E8E;
color: #8C256B;
transform: translateY(-1px);
}
[data-bs-theme="dark"] .ai-option-btn:hover {
background-color: #38bdf8;
color: #0f172a;
border-color: #38bdf8;
}
/* Indicador de Escritura */
.ai-typing-indicator .typing-dot {
@@ -353,81 +424,271 @@
40% { transform: scale(1.1); opacity: 1; }
}
/* Textarea y Botón */
.ai-chat-textarea {
resize: none;
border-radius: 18px;
padding-left: 12px;
padding-right: 12px;
max-height: 75px;
/* Dock de Entrada / Input Pill (Estilo Meli) */
.ai-chat-footer {
background: #ffffff;
border-top: 1px solid rgba(0, 0, 0, 0.06);
position: relative;
z-index: 2;
}
.ai-send-btn {
width: 36px;
height: 36px;
flex-shrink: 0;
display: flex;
.ai-input-pill-container {
background: #FFFFFF;
border: 1px solid #CBD5E1;
border-radius: 28px;
padding: 6px 8px 6px 12px;
transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ai-input-pill-container:focus-within {
border-color: #B43E8E;
box-shadow: 0 0 0 3px rgba(180, 62, 142, 0.15);
}
.ai-input-plus-btn {
width: 28px;
height: 28px;
border-radius: 50%;
border: none;
background: #F1F5F9;
color: #475569;
display: inline-flex;
align-items: center;
justify-content: center;
cursor: pointer;
font-size: 0.95rem;
flex-shrink: 0;
transition: all 0.15s ease;
}
.ai-input-plus-btn:hover {
background: #E2E8F0;
color: #0F172A;
}
.ai-chat-textarea {
background: transparent !important;
resize: none;
max-height: 80px;
font-size: 0.95rem;
color: #0F172A;
line-height: 1.4;
}
.ai-chat-textarea::placeholder {
color: #94A3B8;
font-size: 0.95rem;
}
.ai-send-btn {
background: transparent;
border: none;
color: #B43E8E;
cursor: pointer;
padding: 0;
display: inline-flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
transition: transform 0.15s ease, color 0.15s ease;
}
.ai-send-btn:hover {
color: #8C256B;
transform: scale(1.08);
}
.ai-send-btn:disabled {
color: #CBD5E1;
cursor: not-allowed;
transform: none;
}
/* ==============================================================
TEMA OSCURO ([data-bs-theme="dark"])
============================================================== */
[data-bs-theme="dark"] .ai-chat-panel {
background: #0F172A;
border-color: #334155 !important;
box-shadow: 0 20px 48px rgba(0, 0, 0, 0.6) !important;
}
[data-bs-theme="dark"] .ai-chat-header {
background: #0F172A;
border-bottom-color: #1E293B;
}
[data-bs-theme="dark"] .ai-header-title {
color: #F8FAFC;
}
[data-bs-theme="dark"] .ai-header-subtitle {
color: #94A3B8;
}
[data-bs-theme="dark"] .ai-header-sparkle-badge {
background: rgba(255, 138, 182, 0.18);
color: #FF8AB6;
}
[data-bs-theme="dark"] .ai-btn-circle {
background: #1E293B;
color: #CBD5E1;
}
[data-bs-theme="dark"] .ai-btn-circle:hover {
background: #334155;
color: #F8FAFC;
}
[data-bs-theme="dark"] .ai-chat-disclaimer {
background: #131D31;
border-bottom-color: #1E293B;
}
[data-bs-theme="dark"] .ai-chat-disclaimer small {
color: #94A3B8 !important;
}
[data-bs-theme="dark"] .ai-quick-chips-drawer {
background: #131D31;
border-bottom-color: #1E293B;
}
[data-bs-theme="dark"] .ai-chip-pill {
background: #1E293B;
border-color: #334155;
color: #F8FAFC;
}
[data-bs-theme="dark"] .ai-chip-pill:hover {
background: #B43E8E;
border-color: #B43E8E;
}
[data-bs-theme="dark"] .ai-chat-messages {
background: #0F172A;
}
[data-bs-theme="dark"] .ai-msg-user {
background: #1E293B;
color: #F8FAFC;
}
[data-bs-theme="dark"] .ai-msg-assistant {
color: #F8FAFC;
}
[data-bs-theme="dark"] .ai-action-icon-btn:hover {
color: #F8FAFC;
background: rgba(255, 255, 255, 0.08);
}
[data-bs-theme="dark"] .ai-option-btn {
background: #1E293B;
border-color: #334155;
color: #F8FAFC;
}
[data-bs-theme="dark"] .ai-option-btn:hover {
background: rgba(255, 138, 182, 0.2);
border-color: #FF8AB6;
color: #FF8AB6;
}
[data-bs-theme="dark"] .ai-chat-footer {
background: #0F172A;
border-top-color: #1E293B;
}
[data-bs-theme="dark"] .ai-input-pill-container {
background: #1E293B;
border-color: #334155;
}
[data-bs-theme="dark"] .ai-input-pill-container:focus-within {
border-color: #FF8AB6;
box-shadow: 0 0 0 3px rgba(255, 138, 182, 0.2);
}
[data-bs-theme="dark"] .ai-input-plus-btn {
background: #334155;
color: #CBD5E1;
}
[data-bs-theme="dark"] .ai-input-plus-btn:hover {
background: #475569;
color: #F8FAFC;
}
[data-bs-theme="dark"] .ai-chat-textarea {
color: #F8FAFC;
}
[data-bs-theme="dark"] .ai-send-btn {
color: #FF8AB6;
}
[data-bs-theme="dark"] .ai-send-btn:hover {
color: #FFA5C8;
}
[data-bs-theme="dark"] .ai-sheet-handle {
background: rgba(255, 255, 255, 0.3);
}
/* ==============================================================
UX MÓVIL EXACTA ESTILO MERCADO LIBRE (< 768px):
Bottom Sheet Nativo, Sólido, Sin Desbordes, Acoplado al Teclado
============================================================== */
@media (max-width: 768px) {
.ai-chat-container {
bottom: 16px;
right: 16px;
z-index: 1070;
position: static !important;
}
.ai-chat-launcher {
width: 52px;
height: 52px;
position: fixed !important;
bottom: 20px !important;
right: 20px !important;
width: 54px !important;
height: 54px !important;
z-index: 1060 !important;
}
.ai-chat-launcher.chat-open {
display: none !important;
}
/* Bottom Sheet que ocupa casi toda la pantalla (92vh/92dvh) dejando ver el contexto */
.ai-chat-panel {
position: fixed !important;
top: 0 !important;
left: 0 !important;
right: 0 !important;
bottom: 0 !important;
top: auto !important;
width: 100vw !important;
max-width: 100vw !important;
height: 100dvh !important;
max-height: 100dvh !important;
border-radius: 0 !important;
z-index: 1080 !important;
box-shadow: none !important;
height: 92vh !important;
height: 92dvh !important;
max-height: 92dvh !important;
border-top-left-radius: 28px !important;
border-top-right-radius: 28px !important;
border-bottom-left-radius: 0 !important;
border-bottom-right-radius: 0 !important;
border: none !important;
box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.4) !important;
z-index: 1080 !important;
animation: aiSheetSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
overscroll-behavior: contain;
}
@keyframes aiSheetSlideUp {
from { transform: translateY(100%); }
to { transform: translateY(0); }
}
/* Mostrar drag handle bar */
.ai-sheet-handle-bar {
display: block !important;
}
.ai-chat-header {
border-radius: 0 !important;
padding: 0.75rem 1rem !important;
padding: 0.4rem 1rem 0.6rem !important;
}
.ai-chat-messages {
padding: 0.85rem !important;
padding: 0.85rem 1rem !important;
-webkit-overflow-scrolling: touch;
}
.ai-msg {
max-width: 90% !important;
font-size: 0.88rem !important;
}
.ai-option-btn {
font-size: 0.78rem !important;
padding: 6px 12px !important;
min-height: 32px;
}
/* Dock Inferior móvil anclado */
.ai-chat-footer {
padding: 0.65rem 0.85rem !important;
padding-bottom: max(0.65rem, env(safe-area-inset-bottom, 0px)) !important;
padding: 0.65rem 0.9rem !important;
padding-bottom: max(0.65rem, env(safe-area-inset-bottom, 10px)) !important;
box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.04);
}
.ai-input-pill-container {
padding: 7px 10px 7px 12px !important;
}
.ai-chat-textarea {
font-size: 16px !important; /* Previene el auto-zoom involuntario en Safari iOS */
padding: 8px 12px !important;
font-size: 16px !important; /* Previene auto-zoom molesto en iOS */
}
.ai-send-btn i {
font-size: 1.85rem !important;
}
}
/* Bloqueo de scroll en fondo cuando el Bottom Sheet está abierto */
body.ai-chat-mobile-open {
overflow: hidden !important;
touch-action: none;
position: fixed;
width: 100%;
height: 100%;
}
</style>