/* ==========================================================================
   NEO CHAT — burbuja flotante + ventana · identidad CORTEX · responsive
   ========================================================================== */

/* Burbuja flotante (esquina inferior derecha) */
#neo-burbuja {
    position: fixed;
    bottom: 22px;
    right: 18px;
    z-index: 9998;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-old-gold, #BD9667);
    color: #050a12;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    box-shadow: 0 6px 22px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#neo-burbuja:hover { transform: scale(1.06); }
#neo-burbuja:active { transform: scale(0.94); }

/* Tooltip "TE escucho" */
#neo-burbuja::after {
    content: 'TE escucho';
    position: absolute;
    bottom: 70px;
    right: 0;
    background: var(--accent-old-gold, #BD9667);
    color: #050a12;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}
#neo-burbuja:hover::after {
    opacity: 1;
    transform: translateY(0);
}

/* Panel de chat */
#neo-chat-panel {
    position: fixed;
    bottom: 92px;
    right: 18px;
    z-index: 9999;
    width: 370px;
    max-width: calc(100vw - 36px);
    height: 520px;
    max-height: calc(100vh - 130px);
    background: var(--bg, #050a12);
    border: 1px solid var(--accent-old-gold, #BD9667);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
    display: none;
    flex-direction: column;
    overflow: hidden;
}
#neo-chat-panel.abierto { display: flex; }

#neo-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(189,150,103,0.18), rgba(189,150,103,0.04));
    border-bottom: 1px solid rgba(189,150,103,0.25);
}
#neo-chat-titulo {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent-old-gold, #BD9667);
    letter-spacing: 1px;
}
#neo-chat-subtitulo {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    color: var(--text-soft, rgba(255,255,255,0.6));
}
#neo-chat-cerrar {
    background: transparent;
    border: none;
    color: var(--text-soft, rgba(255,255,255,0.6));
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
}

#neo-chat-mensajes {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.neo-msg {
    max-width: 82%;
    padding: 11px 15px;
    border-radius: 14px;
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    line-height: 1.5;
    word-wrap: break-word;
}
.neo-msg-bot {
    align-self: flex-start;
    background: rgba(189,150,103,0.14);
    color: var(--text, #fff);
    border-bottom-left-radius: 4px;
}
.neo-msg-user {
    align-self: flex-end;
    background: var(--accent-old-gold, #BD9667);
    color: #050a12;
    border-bottom-right-radius: 4px;
    font-weight: 500;
}
.neo-msg-cargando { opacity: 0.6; font-style: italic; }

#neo-chat-input-zona {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid rgba(189,150,103,0.2);
}
#neo-chat-input {
    flex: 1;
    background: var(--input-bg, rgba(255,255,255,0.04));
    border: 1px solid var(--input-border, rgba(255,255,255,0.2));
    color: var(--text, #fff);
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    padding: 10px 12px;
    border-radius: 10px;
    resize: none;
    max-height: 90px;
    line-height: 1.4;
}
#neo-chat-input:focus { outline: none; border-color: var(--accent-old-gold, #BD9667); }
#neo-chat-enviar {
    background: var(--accent-old-gold, #BD9667);
    color: #050a12;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}
#neo-chat-enviar:active { transform: scale(0.9); }
#neo-chat-enviar:disabled { opacity: 0.5; cursor: wait; }

/* Móvil: chat casi pantalla completa */
@media (max-width: 600px) {
    #neo-burbuja { bottom: 88px; right: 14px; width: 54px; height: 54px; font-size: 1.4rem; }

    /* Etiqueta fija "TE escucho" debajo de la burbuja — solo móvil */
    #neo-burbuja::after {
        content: 'TE escucho';
        position: absolute;
        bottom: -22px;
        right: 50%;
        transform: translateX(50%);
        background: transparent;
        color: var(--accent-old-gold, #BD9667);
        font-family: 'Inter', sans-serif;
        font-size: 0.62rem;
        font-weight: 600;
        letter-spacing: 0.06em;
        white-space: nowrap;
        opacity: 1;
        pointer-events: none;
        box-shadow: none;
        padding: 0;
        border-radius: 0;
        transition: none;
    }
    #neo-chat-panel {
        bottom: 0; right: 0; left: 0;
        width: 100%; max-width: 100%;
        height: 80vh; max-height: 80vh;
        border-radius: 16px 16px 0 0;
        border-left: none; border-right: none; border-bottom: none;
    }
}