/* =========================================================
   FX AUTOMATION ASSISTANT
   bot-ans.css
   ========================================================= */


/* =========================================================
   VARIABLES CORPORATIVAS FX
   ========================================================= */

:root {

    --fx-blue: #0064B8;

    --fx-blue-dark: #004095;

    --fx-blue-light: #0878D1;

    --fx-dark: #1B242D;

    --fx-dark-2: #111820;

    --fx-white: #FFFFFF;

    --fx-gray-bg: #F3F5F7;

    --fx-gray-border: #DDE2E7;

    --fx-gray-text: #68727D;
}


/* =========================================================
   CONTENEDOR
   ========================================================= */

#fx-bot {

    position: fixed;

    right: 24px;
    bottom: 24px;

    z-index: 99999;

    font-family:
        Arial,
        Helvetica,
        sans-serif;
}


/* =========================================================
   BOTÓN FLOTANTE
   ========================================================= */

#fx-bot-button {

    width: 72px;
    height: 72px;

    padding: 0;

    border: 3px solid var(--fx-white);

    border-radius: 50%;

    background: var(--fx-white);

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    overflow: hidden;

    box-shadow:
        0 6px 20px rgba(27, 36, 45, 0.28),
        0 0 0 2px rgba(0, 100, 184, 0.15);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}


#fx-bot-button:hover {

    transform: scale(1.08);

    box-shadow:
        0 10px 30px rgba(27, 36, 45, 0.35),
        0 0 0 3px rgba(0, 100, 184, 0.20);
}


#fx-bot-button:active {

    transform: scale(0.94);
}


#fx-bot-button img {

    width: 100%;
    height: 100%;

    object-fit: contain;

    pointer-events: none;
}


/* =========================================================
   PANEL
   ========================================================= */

#fx-bot-panel {

    position: absolute;

    right: 0;
    bottom: 88px;

    width: 380px;
    height: 540px;

    background: var(--fx-white);

    border-radius: 18px;

    overflow: hidden;

    display: flex;
    flex-direction: column;

    border:
        1px solid var(--fx-gray-border);

    box-shadow:
        0 20px 60px rgba(27, 36, 45, 0.30);

    opacity: 0;

    visibility: hidden;

    transform:
        translateY(15px)
        scale(0.96);

    transform-origin:
        bottom right;

    transition:
        opacity 0.22s ease,
        transform 0.22s ease,
        visibility 0.22s ease;
}


/* =========================================================
   PANEL ABIERTO
   ========================================================= */

#fx-bot-panel.open {

    opacity: 1;

    visibility: visible;

    transform:
        translateY(0)
        scale(1);
}


/* =========================================================
   HEADER
   ========================================================= */

#fx-bot-header {

    min-height: 74px;

    padding:
        0 18px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    background:
        linear-gradient(
            135deg,
            var(--fx-dark),
            var(--fx-dark-2)
        );

    color: var(--fx-white);

    border-bottom:
        3px solid var(--fx-blue);
}


/* =========================================================
   TÍTULO
   ========================================================= */

.fx-bot-title {

    display: flex;

    align-items: center;

    gap: 11px;
}


.fx-bot-title img {

    width: 44px;
    height: 44px;

    object-fit: contain;

    border-radius: 50%;

    background: var(--fx-white);

    border:
        2px solid var(--fx-blue);
}


.fx-bot-title div {

    display: flex;

    flex-direction: column;

    gap: 3px;
}


.fx-bot-title strong {

    font-size: 14px;

    font-weight: 700;

    letter-spacing: 0.2px;
}


.fx-bot-title span {

    font-size: 10px;

    color:
        rgba(255, 255, 255, 0.65);

    letter-spacing: 0.7px;

    text-transform: uppercase;
}


/* =========================================================
   BOTÓN CERRAR
   ========================================================= */

#fx-bot-close {

    width: 34px;
    height: 34px;

    padding: 0;

    border: none;

    background: transparent;

    color: var(--fx-white);

    font-size: 27px;

    line-height: 1;

    display: flex;

    align-items: center;
    justify-content: center;

    cursor: pointer;

    border-radius: 50%;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}


#fx-bot-close:hover {

    background:
        rgba(0, 100, 184, 0.25);

    color: var(--fx-blue-light);

    transform: rotate(90deg);
}


/* =========================================================
   MENSAJES
   ========================================================= */

#fx-bot-messages {

    flex: 1;

    padding: 18px;

    overflow-y: auto;

    background:
        var(--fx-gray-bg);

    display: flex;

    flex-direction: column;

    gap: 12px;
}


/* =========================================================
   SCROLLBAR
   ========================================================= */

#fx-bot-messages::-webkit-scrollbar {

    width: 6px;
}


#fx-bot-messages::-webkit-scrollbar-track {

    background: transparent;
}


#fx-bot-messages::-webkit-scrollbar-thumb {

    background:
        var(--fx-dark);

    border-radius: 10px;
}


#fx-bot-messages::-webkit-scrollbar-thumb:hover {

    background:
        var(--fx-blue);
}


/* =========================================================
   MENSAJE
   ========================================================= */

.fx-bot-message {

    display: flex;

    width: 100%;
}


.fx-bot-message-content {

    max-width: 78%;

    padding:
        10px 13px;

    border-radius: 13px;

    font-size: 13px;

    line-height: 1.5;

    word-break: break-word;
}


/* =========================================================
   MENSAJE DEL BOT
   ========================================================= */

.fx-bot-message.bot {

    justify-content: flex-start;
}


.fx-bot-message.bot
.fx-bot-message-content {

    background:
        var(--fx-white);

    color:
        var(--fx-dark);

    border:
        1px solid var(--fx-gray-border);

    border-left:
        3px solid var(--fx-blue);

    border-bottom-left-radius: 4px;

    box-shadow:
        0 2px 7px rgba(27, 36, 45, 0.05);
}


/* =========================================================
   MENSAJE DEL USUARIO
   ========================================================= */

.fx-bot-message.user {

    justify-content: flex-end;
}


.fx-bot-message.user
.fx-bot-message-content {

    background:
        var(--fx-blue);

    color:
        var(--fx-white);

    border-bottom-right-radius: 4px;

    box-shadow:
        0 3px 10px rgba(0, 100, 184, 0.25);
}


/* =========================================================
   INPUT
   ========================================================= */

#fx-bot-input {

    min-height: 68px;

    padding:
        12px;

    background:
        var(--fx-white);

    border-top:
        1px solid var(--fx-gray-border);

    display: flex;

    align-items: center;

    gap: 8px;
}


/* =========================================================
   CAMPO DE TEXTO
   ========================================================= */

#fx-bot-text {

    flex: 1;

    min-width: 0;

    height: 44px;

    padding:
        0 14px;

    border:
        1px solid var(--fx-gray-border);

    border-radius: 12px;

    outline: none;

    background:
        var(--fx-gray-bg);

    color:
        var(--fx-dark);

    font-family: inherit;

    font-size: 13px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}


#fx-bot-text:focus {

    background:
        var(--fx-white);

    border-color:
        var(--fx-blue);

    box-shadow:
        0 0 0 3px rgba(0, 100, 184, 0.12);
}


#fx-bot-text::placeholder {

    color:
        var(--fx-gray-text);
}


/* =========================================================
   BOTÓN ENVIAR
   ========================================================= */

#fx-bot-send {

    width: 44px;
    height: 44px;

    flex-shrink: 0;

    border: none;

    border-radius: 12px;

    background:
        var(--fx-blue);

    color:
        var(--fx-white);

    cursor: pointer;

    display: flex;

    align-items: center;
    justify-content: center;

    font-size: 18px;

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}


#fx-bot-send:hover {

    background:
        var(--fx-blue-dark);

    transform:
        translateY(-1px);

    box-shadow:
        0 5px 14px rgba(0, 100, 184, 0.30);
}


#fx-bot-send:active {

    transform:
        scale(0.93);
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 600px) {

    #fx-bot {

        right: 16px;

        bottom: 16px;
    }


    #fx-bot-button {

        width: 64px;

        height: 64px;
    }


    #fx-bot-panel {

        position: fixed;

        left: 12px;

        right: 12px;

        bottom: 88px;

        width: auto;

        height:
            min(
                540px,
                calc(100vh - 110px)
            );

        border-radius: 16px;

        transform-origin:
            bottom center;
    }

}


/* =========================================================
   REDUCIR ANIMACIONES
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    #fx-bot-button,
    #fx-bot-panel,
    #fx-bot-close,
    #fx-bot-send,
    #fx-bot-text {

        transition: none;
    }

}


/* =========================================================
   MENÚ DE OPCIONES
   ========================================================= */

#fx-bot-options {

    display: flex;

    flex-direction: column;

    gap: 9px;

    margin-top: 4px;
}


.fx-bot-option {

    width: 100%;

    min-height: 54px;

    padding: 10px 12px;

    display: flex;

    align-items: center;

    gap: 11px;

    border:
        1px solid var(--fx-gray-border);

    border-left:
        3px solid var(--fx-blue);

    border-radius: 11px;

    background:
        var(--fx-white);

    color:
        var(--fx-dark);

    cursor: pointer;

    text-align: left;

    font-family: inherit;

    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}


.fx-bot-option:hover {

    background:
        #f8fbff;

    border-color:
        var(--fx-blue);

    transform:
        translateX(3px);

    box-shadow:
        0 4px 12px rgba(0, 100, 184, 0.12);
}


.fx-bot-option-icon {

    width: 32px;

    height: 32px;

    flex-shrink: 0;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 8px;

    background:
        rgba(0, 100, 184, 0.09);

    font-size: 17px;
}


.fx-bot-option-text {

    flex: 1;

    font-size: 13px;

    font-weight: 600;
}


.fx-bot-option-arrow {

    color:
        var(--fx-blue);

    font-size: 18px;

    transition:
        transform 0.18s ease;
}


.fx-bot-option:hover
.fx-bot-option-arrow {

    transform:
        translateX(3px);
}


/* =========================================================
   BOTÓN VOLVER
   ========================================================= */

#fx-bot-back {

    align-self: flex-start;

    margin-top: 4px;

    padding: 8px 12px;

    border: none;

    background: transparent;

    color: var(--fx-blue);

    font-family: inherit;

    font-size: 12px;

    font-weight: 600;

    cursor: pointer;

    border-radius: 8px;

    transition:
        background 0.18s ease;
}


#fx-bot-back:hover {

    background:
        rgba(0, 100, 184, 0.08);
}

/* =========================================================
   HEADER ACTIONS
   ========================================================= */

.fx-bot-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}


/* =========================================================
   LANGUAGE
   ========================================================= */

#fx-bot-language {
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.06);
    color: #ffffff;

    min-width: 36px;
    height: 30px;

    border-radius: 7px;

    font-size: 10px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

#fx-bot-language:hover {
    background: rgba(0,100,184,0.30);
    border-color: var(--fx-blue);
}


/* =========================================================
   NAVIGATION
   ========================================================= */

#fx-bot-navigation {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}


#fx-bot-navigation button {
    border: none;
    background: transparent;

    color: var(--fx-blue);

    font-family: inherit;
    font-size: 12px;
    font-weight: 600;

    cursor: pointer;

    padding: 7px 10px;
    border-radius: 7px;

    transition:
        background 0.18s ease;
}


#fx-bot-navigation button:hover {
    background:
        rgba(0,100,184,0.08);
}


/* =========================================================
   ATTENTION INDICATOR
   ========================================================= */

#fx-bot-attention {
    position: absolute;

    right: 4px;
    bottom: 82px;

    opacity: 0;
    visibility: hidden;

    transform:
        translateY(8px)
        scale(0.95);

    transition:
        opacity 0.25s ease,
        transform 0.25s ease,
        visibility 0.25s ease;

    pointer-events: none;
}


#fx-bot-attention.show {
    opacity: 1;
    visibility: visible;

    transform:
        translateY(0)
        scale(1);
}


#fx-bot-attention span {
    display: block;

    padding: 8px 12px;

    background: var(--fx-dark);

    color: #ffffff;

    border-radius: 9px;

    font-size: 11px;
    font-weight: 600;

    white-space: nowrap;

    box-shadow:
        0 5px 18px rgba(0,0,0,0.20);
}


#fx-bot-attention span::after {
    content: "";

    position: absolute;

    right: 25px;
    bottom: -5px;

    width: 10px;
    height: 10px;

    background: var(--fx-dark);

    transform: rotate(45deg);
}


/* =========================================================
   PULSE
   ========================================================= */

#fx-bot-button.pulse {
    animation:
        fxBotPulse 1.8s ease-in-out infinite;
}


@keyframes fxBotPulse {

    0% {
        transform: scale(1);
        box-shadow:
            0 6px 20px rgba(27,36,45,0.28),
            0 0 0 2px rgba(0,100,184,0.15);
    }

    50% {
        transform: scale(1.07);
        box-shadow:
            0 10px 30px rgba(27,36,45,0.30),
            0 0 0 9px rgba(0,100,184,0.08);
    }

    100% {
        transform: scale(1);
        box-shadow:
            0 6px 20px rgba(27,36,45,0.28),
            0 0 0 2px rgba(0,100,184,0.15);
    }
}