/* =========================================================
   ASISTENTE TÉCNICO
   Diseño independiente
========================================================= */

#asistenteTecnico {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 99999;

    font-family:
        Arial,
        Helvetica,
        sans-serif;
}


/* =========================================================
   PERSONAJE
========================================================= */

#asistentePersonaje {
    position: relative;

    width: 64px;
    height: 64px;

    border: 0;
    border-radius: 50%;

    background: #ffffff;

    box-shadow:
        0 8px 30px rgba(0, 0, 0, .25);

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    transition:
        transform .25s ease,
        box-shadow .25s ease;
}


#asistentePersonaje:hover {
    transform: scale(1.08);

    box-shadow:
        0 12px 35px rgba(0, 0, 0, .30);
}


.asistente-robot {
    font-size: 34px;

    line-height: 1;

    user-select: none;
}


/* Indicador */

.asistente-indicador {
    position: absolute;

    right: 4px;
    top: 4px;

    width: 11px;
    height: 11px;

    border-radius: 50%;

    background: #22c55e;

    border: 2px solid #ffffff;
}


/* =========================================================
   CHAT
========================================================= */

.asistente-chat {
    position: absolute;

    right: 0;
    bottom: 78px;

    width: 350px;
    max-width: calc(100vw - 30px);

    height: 500px;
    max-height: calc(100vh - 110px);

    display: flex;
    flex-direction: column;

    background: #ffffff;

    border: 1px solid #dbe4ee;

    border-radius: 18px;

    box-shadow:
        0 20px 60px rgba(15, 23, 42, .28);

    overflow: hidden;

    opacity: 0;
    visibility: hidden;

    transform:
        translateY(15px)
        scale(.97);

    pointer-events: none;

    transition:
        opacity .25s ease,
        transform .25s ease,
        visibility .25s ease;
}


.asistente-chat.abierto {
    opacity: 1;

    visibility: visible;

    transform:
        translateY(0)
        scale(1);

    pointer-events: auto;
}


/* =========================================================
   CABECERA
========================================================= */

.asistente-header {
    min-height: 62px;

    padding: 0 16px;

    display: flex;

    align-items: center;
    justify-content: space-between;

    background:
        linear-gradient(
            135deg,
            #0f172a,
            #1e293b
        );

    color: #ffffff;
}


.asistente-header strong {
    display: block;

    font-size: 14px;
}


.asistente-header small {
    display: block;

    margin-top: 3px;

    color: #94a3b8;

    font-size: 10px;
}


#cerrarAsistente {
    width: 32px;
    height: 32px;

    border: 0;

    border-radius: 50%;

    background:
        rgba(255,255,255,.10);

    color: #ffffff;

    font-size: 22px;

    cursor: pointer;
}


/* =========================================================
   MENSAJES
========================================================= */

.asistente-mensajes {
    flex: 1;

    padding: 16px;

    overflow-y: auto;

    background: #f8fafc;
}


.asistente-mensaje {
    max-width: 88%;

    margin-bottom: 10px;

    padding: 10px 12px;

    border-radius: 12px;

    font-size: 12px;

    line-height: 1.5;
}


.asistente-mensaje.ia {
    margin-right: auto;

    background: #ffffff;

    border: 1px solid #e2e8f0;

    color: #1e293b;
}


.asistente-mensaje.usuario {
    margin-left: auto;

    background: #0f172a;

    color: #ffffff;
}


/* =========================================================
   OPCIONES
========================================================= */

.asistente-opciones {
    padding: 8px 14px;

    background: #f8fafc;
}


.asistente-opcion {
    width: 100%;

    margin: 4px 0;

    padding: 10px 12px;

    text-align: left;

    border: 1px solid #dbe4ee;

    border-radius: 10px;

    background: #ffffff;

    color: #0f172a;

    font-size: 11px;
    font-weight: 600;

    cursor: pointer;

    transition: .2s;
}


.asistente-opcion:hover {
    border-color: #38bdf8;

    background: #f0f9ff;
}


/* =========================================================
   FORMULARIO
========================================================= */

.asistente-form {
    display: flex;

    gap: 8px;

    padding: 10px;

    background: #ffffff;

    border-top:
        1px solid #e2e8f0;
}


#asistenteEntrada {
    flex: 1;

    min-width: 0;

    padding: 11px 12px;

    border:
        1px solid #dbe4ee;

    border-radius: 10px;

    outline: none;

    color: #0f172a;

    font-size: 12px;
}


#asistenteEntrada:focus {
    border-color: #38bdf8;

    box-shadow:
        0 0 0 3px
        rgba(56,189,248,.12);
}


.asistente-form button {
    width: 42px;

    border: 0;

    border-radius: 10px;

    background: #0f172a;

    color: #ffffff;

    cursor: pointer;

    font-size: 16px;
}


/* =========================================================
   MÓVIL
========================================================= */

@media (max-width: 520px) {

    #asistenteTecnico {
        right: 14px;
        bottom: 14px;
    }


    #asistentePersonaje {
        width: 58px;
        height: 58px;
    }


    .asistente-robot {
        font-size: 30px;
    }


    .asistente-chat {

        right: 0;
        bottom: 70px;

        width:
            calc(100vw - 28px);

        height:
            min(520px, calc(100vh - 95px));

        border-radius: 16px;
    }

}