/* ==========================================================================
   1. BOTÓN FLOTANTE (EL ROBOT PRINCIPAL)
   ========================================================================== */
#cneip-chat-button {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 120px;
    height: 120px;
    z-index: 9997;
    cursor: pointer;
    
    /* Diseño Sofisticado: Fondo blanco con borde sutil y sombra premium */
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08); 
    border-radius: 50%;
    
    /* Sombra doble capa para efecto elevación */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 10px 25px -5px rgba(0, 0, 0, 0.15);

    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px; 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#cneip-chat-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.2);
    border-color: rgba(0,0,0,0); 
}

/* Solo la imagen del robot dentro del botón tiene vida */
#cneip-chat-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: robotOrganicLife 7s ease-in-out infinite;
    transform-origin: center bottom;
    will-change: transform;
}

/* Animación orgánica del robot */
@keyframes robotOrganicLife {
    0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
    25% { transform: translateY(-3px) rotate(-1.5deg) scale(1.01); }
    50% { transform: translateY(1px) rotate(0deg) scale(1); }
    75% { transform: translateY(-2px) rotate(1.5deg) scale(1.01); }
}















/* =========================================
   1. VARIABLES Y CONFIGURACIÓN (:root)
   ========================================= */
:root {
    /* Dimensiones */
    --floating-btn-size: 110px; 
    --floating-btn-margin: 20px;
    --chat-max-height: 700px;
    
    /* Colores Marca */
    --primary-color: #2563eb;    /* Azul Principal */
    --accent-red: #6f0808;      /* Rojo Identitario */
    --accent-red-hover: #a01010;
    
    /* Colores Neutros */
    --bg-light: #f5f7f9;
    --white: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    
    /* Tipografía */
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-fancy: 'Quicksand', sans-serif;
}

/* (Se deja tu @import original intacto aunque CSS lo ignora si no está al inicio) */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@500;700&family=Inter:wght@400;700;800&display=swap');

/* =========================================
   2. ESTRUCTURA PRINCIPAL (LAYOUT)
   ========================================= */
/* =========================================
   2. ESTRUCTURA PRINCIPAL (LAYOUT)
   ========================================= */

/* Overlay de fondo */
#cneip-chat-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    backdrop-filter: blur(6px);
    z-index: 9998;
    display: none;
}

/* Panel de Chat - Estilos Base */
#cneip-chat-panel {
    position: fixed;
    z-index: 9999;
    
    /* CONFIGURACIÓN CRÍTICA DE FLEXBOX */
    display: none; /* Inicia oculto */
    flex-direction: column; /* Organiza hijos en columna vertical */
    
    background: var(--bg-light);
    font-family: var(--font-main);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
    transition: all 0.3s ease;
}

/* --- CORRECCIÓN DE ORO: Forzar Flexbox cuando el JS lo abre --- */
/* Esto arregla que el input flote. Si JS pone 'display: block', esto lo corrige a flex */
#cneip-chat-panel[style*="display: block"], 
#cneip-chat-panel.active {
    display: flex !important;
    flex-direction: column !important;
}

/* --- REGLA CRÍTICA PARA IMÁGENES --- */
#cneip-chat-panel img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- MODO MOBILE (iPhone/Android) --- */
@media (max-width: 768px) {
    #cneip-chat-panel {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
        margin: 0 !important;
        max-height: 100vh;
    }
}

/* --- MODO DESKTOP --- */
@media (min-width: 769px) {
    #cneip-chat-panel {
        width: 90%;
        max-width: 1400px;
        /* Altura fija necesaria para que el flex funcione */
        height: 85vh; 
        max-height: 800px;
        left: 50%;
        bottom: 24px;
        transform: translateX(-50%);
        border-radius: 18px;
        border: 1px solid var(--border-color);
    }
}






/* =========================================
   3. COMPONENTES INTERNOS
   ========================================= */

/* Header */
.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.chat-header span {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    flex: 1;
}

.close-chat {
    font-size: 28px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}
.close-chat:hover { color: var(--accent-red); }

/* Área de Mensajes */
#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8f9fa;
    scrollbar-width: thin;
}

/* Burbujas Estilo Gemini */
.chat-bubble {
    max-width: 85%;
    padding: 12px 16px;
    font-family: var(--font-fancy);
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.chat-bubble.ai {
    align-self: flex-start;
    background: var(--white);
    color: #4b5563;
    border: 1px solid var(--border-color);
    border-radius: 18px 18px 18px 4px;
}

.chat-bubble.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    color: var(--white);
    border-radius: 18px 18px 4px 18px;
}

/* =========================================
   4. INPUT AREA (Gemini Style)
   ========================================= */
/* =========================================
   4. INPUT AREA (Gemini Style)
   ========================================= */
.chat-input-box {

 /*    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
   */
    
    display: flex;

    align-items: flex-end; 
    gap: 10px;
    padding: 8px 10px; /* Padding ajustado para textarea */
  
    
    
    background: var(--white);
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    margin: 0 20px 5px 20px;
    
    /*    margin: 0 20px 20px 20px; /* Margen inferior ajustado */

    /* CORRECCIÓN: Asegura que se pegue al fondo */
    margin-top: auto; 
    flex-shrink: 0;
}

#chat-text {
    flex: 1;
    /* ALTURA SOLICITADA */
    min-height: 100px; 
    max-height: 180px; /* Límite para que no cubra toda la pantalla */
    
    border: none;
    outline: none;
    background: transparent;
    
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 300;
    color: var(--text-main);
    
    resize: none; 
    overflow-y: auto; /* Scroll suave si pasa de 200px */
    
    /* ALINEACIÓN DEL TEXTO */
    /* En un cuadro grande, el texto debe empezar arriba con un margen cómodo */
    padding-bottom: 5px;
    
    /* ESTO ES VITAL PARA QUE EMPIECE ARRIBA */
    display: block; 
    padding-top: 15px; /* Empuja el texto un poco hacia abajo desde el borde superior */
    line-height: 1.5;
    
    /* Asegura que no haya flexbox afectando al texto interno */
    align-self: stretch;
}

/* Ajuste de los botones (Micrófono y Enviar) */
#chat-mic, #chat-send {
    /* Altura fija para que no se deformen */
    height: 44px; 
    width: 44px;
    
    /* Alineación: Se quedan pegados abajo visualmente */
    margin-bottom: 0; 
    flex-shrink: 0;
}

/* Ajuste específico para el botón de enviar (Esfera) */
#chat-send {
    width: 50px;
    height: 50px;
}

#chat-mic { color: var(--text-muted); padding: 8px; border-radius: 50%; }
#chat-mic.listening { color: #ef4444; background: rgba(239, 68, 68, 0.1); animation: pulse-red 1.5s infinite; }

/* =========================================
   BOTÓN "CRYSTAL SPHERE": DISEÑO ULTRA ESTÉTICO
   ========================================= */
#chat-send {
  
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    border: none;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;

    background: radial-gradient(
        circle at 35% 35%,
        #6b9fff 0%,
        #0053FE 45%,
        #003cb3 85%,
        #002a80 100%
    );

    box-shadow:
        0 10px 30px -5px rgba(0, 83, 254, 0.6),
        inset 0 2px 3px rgba(255, 255, 255, 0.8),
        inset 10px 10px 20px rgba(255, 255, 255, 0.2),
        inset 0 -10px 20px rgba(0, 0, 20, 0.4),
        inset 0 -2px 5px rgba(130, 180, 255, 0.3);

    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 10;
}

#chat-send:hover {
    transform: translateY(-4px) scale(1.05);
    background: radial-gradient(circle at 35% 35%, #8cb6ff 0%, #1a66ff 45%, #003cb3 100%);
    box-shadow:
        0 15px 40px -5px rgba(0, 83, 254, 0.7),
        inset 0 3px 5px rgba(255, 255, 255, 1),
        inset 15px 15px 30px rgba(255, 255, 255, 0.3),
        inset 0 -10px 20px rgba(0, 0, 20, 0.5);
}

#chat-send:active {
    transform: translateY(2px) scale(0.95);
    transition: all 0.1s ease-out;
    background: radial-gradient(circle at 50% 60%, #4d89ff 0%, #0047d9 50%, #001f66 100%);
    box-shadow:
        0 2px 5px rgba(0, 83, 254, 0.3),
        inset 0 6px 10px rgba(0, 0, 30, 0.7),
        inset 0 -2px 5px rgba(255, 255, 255, 0.2);
}

#chat-send svg,
#chat-send i {
    width: 24px;
    height: 24px;
    fill: #ffffff !important;
    color: #ffffff !important;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
    transition: all 0.3s ease;
    position: relative;
    z-index: 11;
}

#chat-send:active svg,
#chat-send:active i {
    transform: scale(0.92);
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.1));
    opacity: 0.9;
}

/* Disclaimer */
.chat-disclaimer {
    font-size: 11px;
    color: #6b7280;
    text-align: center;
    padding: 5px 10px 10px;
    font-family: sans-serif;
    font-weight: 200;
}

/* Disclaimer (Sin cambios) */
.chat-disclaimer {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    padding: 5px 10px 10px;
}

/* =========================================
   RESTAURACIÓN: TARJETAS MIS ASISTENCIAS (Digital Pass)
   ========================================= */
.ma-card {
    position: relative;
    background: #ffffff;
    display: grid;
    grid-template-columns: 6px 1fr 50px; 
    gap: 0 15px;
    min-height: 95px;
    margin-bottom: 16px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border: 1px solid #f0f0f0;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.ma-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.ma-card::before {
    content: '';
    grid-column: 1;
    background: #2d3748;
}

.ma-card p {
    margin: 0;
    padding: 0;
    grid-column: 2;
}

.ma-card p:nth-child(2) {
    font-size: 1.05rem;
    font-weight: 800;
    color: #1a202c;
    padding-top: 15px;
    line-height: 1.2;
}

.ma-card p:nth-child(3) {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #a0aec0;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.ma-card p:nth-child(4), 
.ma-card p:nth-child(5) {
    font-size: 0.8rem;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 5px;
    padding-bottom: 5px;
}

.ma-card p:nth-child(4)::before {
    content: ''; width: 14px; height: 14px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234a5568'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z'%3E%3C/path%3E%3C/svg%3E") center/contain no-repeat;
}

.ma-card p:nth-child(5)::before {
    content: ''; width: 14px; height: 14px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234a5568'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z'%3E%3C/path%3E%3C/svg%3E") center/contain no-repeat;
}

.ma-card p:last-child {
    grid-column: 3;
    grid-row: 1 / span 5;
    background-color: #10b981; 
    color: white;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ma-card strong { display: none !important; }

@media (max-width: 480px) {
    .ma-card { grid-template-columns: 4px 1fr 35px; }
    .ma-card p:nth-child(2) { font-size: 0.9rem; }
}

/* =========================================
   RESTAURACIÓN DE GLOBOS DE MENSAJE (Sólido)
   ========================================= */
#chat-messages {
    flex: 1; 
    overflow-y: auto;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: #f8f9fa;
}

.bubble {
    padding: 10px 14px;
    border-radius: 18px; 
    max-width: 85%;
    line-height: 1.4;
    font-size: 14px;
    font-family: 'Quicksand', sans-serif;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); 
    word-wrap: break-word;
    position: relative;
}

.bubble * { max-width: 100%; } 

.msg-user {
    background: #3b5bdf;
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 4px; 
}

.msg-bot {
    background: #ffffff;  
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid #e0e0e0;
}

.spinner {
    border: 2px solid #f3f3f3;  
    border-top: 2px solid #6f0808; 
    border-radius: 50%;
    width: 14px;
    height: 14px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

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

/* =========================================
   REPARACIÓN: TARJETAS COMPACTAS (.card-compact)
   ========================================= */
.card-compact {
    background-color: #ffffff;
    border-radius: 8px;
    border-left: 4px solid #6366f1;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    padding: 10px 12px;
    margin-bottom: 8px;
    font-family: 'Segoe UI', system-ui, sans-serif;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-compact:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

.card-title-compact {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
    flex: 1;
}

.card-badge-mini {
    background-color: #e0e7ff;
    color: #4338ca;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    text-transform: uppercase;
    flex-shrink: 0;
}

.card-info-row {
    font-size: 0.8rem;
    color: #64748b;
    display: flex;
    flex-wrap: wrap; 
    align-items: center;
    gap: 8px;
    line-height: 1.3;
}

.sep { 
    color: #cbd5e1; 
    font-size: 10px;
    display: flex;
    align-items: center;
}

@media (max-width: 400px) {
    .card-top-row {
        flex-direction: column;
        gap: 5px;
    }
    .card-badge-mini {
        align-self: flex-start;
    }
}

/* ==========================================================================
   2. GLOBO DE TEXTO DEL ROBOT (TOOLTIP EXTERNO)
   ========================================================================== */
.chat-tooltip {
    position: absolute;
    bottom: 110%;
    right: 0; 
    width: 220px;
    background-color: #333333;
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 12px;
    border-bottom-right-radius: 2px;
    font-size: 13px;
    line-height: 1.4;
    text-align: right;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
    z-index: 9998;
}

.chat-tooltip.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.chat-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 15px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #333333;
}

/* ==========================================================================
   3. ENCABEZADO DEL CHAT (CORRECCIÓN IMPORTANTE)
   ========================================================================== */
.chat-header .chat-logo {
    width: 40px !important; 
    height: 40px !important;
    object-fit: contain;
    border-radius: 50%;
    margin-right: 10px;
    animation: none !important; 
    transform: none !important;
}


.res-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: linear-gradient(
        120deg,
        rgba(0,229,255,0.35),
        rgba(124,77,255,0.25),
        rgba(0,229,255,0.35)
    );
    opacity: 0;
    transition: opacity .35s ease;
    pointer-events: none;
}

.res-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 18px 40px rgba(0,0,0,0.15),
        0 0 25px rgba(0,229,255,0.25);
}

.res-card:hover::before {
    opacity: 1;
}

.res-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.res-modalidad {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, #00e5ff, #7c4dff);
    box-shadow: 0 0 12px rgba(124,77,255,0.45);
}

.res-title {
    font-size: 17px;
    font-weight: 800;
    color: #1c1c1c;
    margin-bottom: 6px;
    line-height: 1.35;
}

.res-author {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #00695c;
    font-style: italic;
    margin-bottom: 12px;
}

.res-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.08);
    font-size: 12px;
    color: #333;
}

.res-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.res-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.6);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.6);
}

.res-clave {
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 999px;
    color: #7c4dff;
    background: rgba(124,77,255,0.15);
    box-shadow: 0 0 12px rgba(124,77,255,0.25);
}





/* =========================================
   CORRECCIÓN DEFINITIVA: TARJETA DE AGENDA
   ========================================= */

.contenedor-resultados {
    width: 100%;
    display: grid;
    gap: 16px;
    box-sizing: border-box;
}


/* BUSCA ESTO EN TU CSS Y ACTUALÍZALO ASÍ: */

.res-card {
    position: relative;
    
    /* --- EL CAMBIO CRÍTICO ESTÁ AQUÍ --- */
    width: 100% !important;     
    min-width: 280px;           /* <--- ESTO ES LO QUE OBLIGA A LA BURBUJA A ABRIRSE */
    box-sizing: border-box;    
    display: block;            
    
    background: linear-gradient(
        135deg,
        rgba(255,255,255,0.65),
        rgba(240,255,255,0.45)
    );
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow:
        0 10px 25px rgba(0,0,0,0.08),
        inset 0 0 0 1px rgba(255,255,255,0.35);
    transition: all .35s ease;
    overflow: hidden;
}





.res-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: linear-gradient(
        120deg,
        rgba(0,229,255,0.35),
        rgba(124,77,255,0.25),
        rgba(0,229,255,0.35)
    );
    opacity: 0;
    transition: opacity .35s ease;
    pointer-events: none;
}

.res-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 18px 40px rgba(0,0,0,0.15),
        0 0 25px rgba(0,229,255,0.25);
}

.res-card:hover::before {
    opacity: 1;
}

/* --- ESTILOS INTERNOS DE LA TARJETA --- */
.res-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    width: 100%; /* Asegura que el encabezado llene la tarjeta */
}

.res-modalidad {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, #00e5ff, #7c4dff);
    box-shadow: 0 0 12px rgba(124,77,255,0.45);
}

.res-title {
    font-size: 17px;
    font-weight: 800;
    color: #1c1c1c;
    margin-bottom: 6px;
    line-height: 1.35;
}

.res-author {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #00695c;
    font-style: italic;
    margin-bottom: 12px;
}

.res-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.08);
    font-size: 12px;
    color: #333;
    width: 100%;
}


















/* Contenedor principal del loader */
.gemini-loader-container {
    position: relative;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 5px auto;
}

.gemini-spinning-ring {
    position: absolute;
    width: 75%;
    height: 75%;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #800020;
    border-right-color: #D4AF37;
    border-bottom-color: #C0C0C0;
    border-left-color: transparent;
    filter: drop-shadow(0 0 4px rgba(128, 0, 32, 0.6)) drop-shadow(0 0 4px rgba(212, 175, 55, 0.6));
    animation: gemini-spin 1.2s linear infinite;
}

.gemini-logo-wrapper {
    position: relative;
    z-index: 2;
    width: 40%;
    height: 40%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gemini-logo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    animation: gemini-pulse 2s ease-in-out infinite;
}

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

@keyframes gemini-pulse {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.08); filter: brightness(1.1); }
}

/* =========================================
   BOTÓN SCROLL (ESTILO CHATGPT SUTIL)
   ========================================= */
#chat-scroll-btn {
    position: absolute;
    bottom: 180px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #555;
    cursor: pointer;
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

#chat-scroll-btn svg {
    width: 16px;
    height: 16px;
    stroke: #0053FE;
}

#chat-scroll-btn.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: translateX(-50%) translateY(0);
}

#chat-scroll-btn:hover {
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(0, 83, 254, 0.3);
    transform: translateX(-50%) translateY(-3px);
}

/* ==========================================================================
   4. PANTALLA DE BIENVENIDA Y SUGERENCIAS (CORRECCIÓN DE BRILLO)
   ========================================================================== */
.suggestions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 5px;
}

.suggestion-chip {
    position: relative; 
    overflow: hidden;   
    border-radius: 24px 24px 24px 4px; 
    padding: 18px 26px;
    font-size: 14px;
    font-weight: 200;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    background-color: white; 
    border: 1px solid #e1e4e8;
    color: black;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08); 
    animation: floatPulse 3s ease-in-out infinite;
    transition: all 0.2s ease;
    z-index: 1; 
}

.suggestion-chip span, 
.suggestion-chip {
    z-index: 2;
}

.suggestion-chip::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100px;
    width: 60px;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.9) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-20deg); 
    z-index: 1;
    animation: shineMove 5s infinite;
}

.suggestion-chip:nth-child(1)::after { animation-delay: 0s; }
.suggestion-chip:nth-child(2)::after { animation-delay: 2.5s; }
.suggestion-chip:nth-child(3)::after { animation-delay: 1.2s; }
.suggestion-chip:nth-child(4)::after { animation-delay: 3.8s; }
.suggestion-chip:nth-child(5)::after { animation-delay: 0.5s; }

@keyframes shineMove {
    0% {
        left: -100%;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    20% {
        left: 200%;
        opacity: 0;
    }
    100% {
        left: 200%;
        opacity: 0;
    }
}

@keyframes floatPulse {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-4px) scale(1.02); }
}

.suggestion-chip:hover {
    background-color: #ffffff;
    border-color: #cce0ff;
    color: #0056b3;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0,86,179, 0.15);
}

.suggestions-grid.typing-active .suggestion-chip::after {
   display: none; 
}


/* 1. La intro (Splash) debe estar HASTA ARRIBA mientras carga */
#cneip-splash-screen {
    z-index: 20000 !important;
}

/* 2. El Chat debe estar un nivel abajo, pero encima de la página */
#cneip-chat-panel {
    z-index: 10000 !important; 
}

/* 3. IMPORTANTE: Cuando la intro se va, debe dejar de estorbar */
#cneip-splash-screen:not(.active) {
    pointer-events: none; /* Permite dar clic a lo que hay debajo */
    opacity: 0;
}





/* =========================================
   NUEVO SPLASH SCREEN (ROBOT GIGANTE SALUDANDO)
   ========================================= */

/* Contenedor de la pantalla completa */
#cneip-splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Fondo blanco con un toque de transparencia para profundidad */
    background-color: rgba(255, 255, 255, 0.98); 
    z-index: 20000 !important; /* Siempre encima */
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Estados de visibilidad */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

/* Cuando se activa */
#cneip-splash-screen.active {
    opacity: 1;
    pointer-events: all;
}

.splash-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px; /* Más espacio entre robot y texto */
}

/* EL ROBOT GIGANTE */
.splash-robot {
    /* MUCHO MÁS GRANDE */
    width: 220px; 
    height: 220px;
    object-fit: contain;
    
    /* Estado inicial (antes de animar) */
    opacity: 0;
    /* Empieza un poco abajo y rotado hacia la izquierda */
    transform: translateY(30px) rotate(-15deg);
    /* IMPORTANTE: El movimiento sale desde su base */
    transform-origin: center bottom;
}

/* Texto debajo */
.splash-text {
    font-family: sans-serif;
    font-size: 18px; /* Texto un poco más grande también */
    color: #555;
    font-weight: 500;
    opacity: 0;
    transform: translateY(20px);
}

/* === APLICACIÓN DE LAS NUEVAS ANIMACIONES === */
.animate-splash .splash-robot {
    /* Dura 1.8s para dar tiempo al saludo */
    animation: robotWaveHola 1.8s ease-in-out forwards;
}

.animate-splash .splash-text {
    animation: textFadeInUp 1.5s ease forwards 0.3s; /* Retraso de 0.3s */
}

/* === NUEVOS KEYFRAMES DEL SALUDO "HOLA" === */
@keyframes robotWaveHola {
    0% {
        opacity: 0;
        /* Empieza abajo y rotado */
        transform: translateY(30px) rotate(-15deg);
    }
    20% {
        opacity: 1;
        /* Sube rápido al centro */
        transform: translateY(0) rotate(0deg);
    }
    /* --- Secuencia de Saludo (Lado a Lado) --- */
    35% {
        transform: rotate(15deg); /* Se inclina a la derecha */
    }
    50% {
        transform: rotate(-10deg); /* Se inclina a la izquierda */
    }
    65% {
        transform: rotate(5deg); /* Derecha un poco menos */
    }
    80% {
        transform: rotate(-2deg); /* Izquierda casi nada */
    }
    /* ---------------------------------------- */
    100% {
        opacity: 1;
        /* Termina quieto en el centro */
        transform: translateY(0) rotate(0deg);
    }
}

/* Keyframe simple para el texto */
@keyframes textFadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}







/* =========================================
   FIX DE MODAL VIP (SUPERIORIDAD DE CAPAS)
   ========================================= */

/* 1. El Modal debe estar ENCIMA del Chat (10000) y del Splash (20000) */
#modal_login_vip {
    z-index: 30005 !important;
    background: rgba(0, 0, 0, 0.5); /* Fondo oscuro semitransparente */
}

/* 2. Asegurar que el contenido del modal no se oculte */
#modal_login_vip .modal-dialog {
    z-index: 30010 !important; /* Un poco más arriba que el fondo */
    margin-top: 10vh; /* Centrado visual */
}

/* 3. Si usas Bootstrap, fuerza el backdrop también arriba */
.modal-backdrop {
    z-index: 30000 !important;
}







