
#lega-chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    font-family: Arial, sans-serif;
}

/* Botón flotante */

/* #chatbot-toggle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,.3);
    border: 4px solid #8f2fff;
    transition: .3s;
} */

/* #chatbot-toggle:hover {
    transform: scale(1.05);
}

#chatbot-toggle img {
    width: 58px;
    height: 58px;
    border-radius: 50%;
} */

/* Ventana */

#chatbot-window {

    width: 360px;
    height: 560px;

    background: #fff;

    border-radius: 25px;

    overflow: hidden;

    box-shadow: 0 15px 50px rgba(0,0,0,.2);

    position: fixed;

    bottom: 20px;
    right: 20px;

    display: none;

    flex-direction: column;
}

#chatbot-window.active {
    display: flex;
}

/* Header */

.chatbot-header {

    background: linear-gradient(135deg, #5177c3, #8f2fff);

    color: #fff;

    padding: 15px;

    display: flex;

    justify-content: space-between;

    align-items: center;
}

.chatbot-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-header-left img {
    width: 80px;
    height: 50px;
    border-radius: 50%;
}

.chatbot-header-left h4 {
    margin: 0;
    font-size: 16px;
}

.chatbot-header-left span {
    font-size: 12px;
    opacity: .8;
}

#chatbot-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
}

/* Body */

.chatbot-body {

    flex: 1;

    overflow-y: auto;

    padding: 20px;

    background: #f4f4f4;

    display: flex;

    flex-direction: column;

    gap: 15px;
}

/* Mensajes */

.bot-message,
.user-message {

    max-width: 80%;

    padding: 12px 16px;

    border-radius: 18px;

    font-size: 14px;

    line-height: 1.4;
}

.bot-message {

    background: white;

    color: #222;

    align-self: flex-start;

    border-bottom-left-radius: 5px;
}

.user-message {

    background: linear-gradient(135deg, #8f2fff, #4b0082);

    color: white;

    align-self: flex-end;

    border-bottom-right-radius: 5px;
}

/* Footer */

.chatbot-footer {

    padding: 15px;

    background: white;

    border-top: 1px solid #eee;
}

#chatbot-form {

    display: flex;

    gap: 10px;
}

#chatbot-input {

    flex: 1;

    border: 1px solid #ddd;

    border-radius: 50px;

    padding: 12px 16px;

    outline: none;

    font-size: 14px;
}

#chatbot-form button {

    width: 45px;
    height: 45px;

    border: none;

    border-radius: 50%;

    background: linear-gradient(135deg, #8f2fff, #4b0082);

    color: white;

    cursor: pointer;

    transition: .3s;
}

#chatbot-form button:hover {
    transform: scale(1.05);
}

/* Typing */

.typing-area {

    display: none;

    align-items: center;

    gap: 5px;

    padding: 0 20px 15px;
}

.typing-area span {

    width: 10px;
    height: 10px;

    background: #8f2fff;

    border-radius: 50%;

    animation: bounce 1.5s infinite;
}

.typing-area span:nth-child(2) {
    animation-delay: .2s;
}

.typing-area span:nth-child(3) {
    animation-delay: .4s;
}

@keyframes bounce {

    0%, 80%, 100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Responsive */

@media(max-width: 480px) {

    #chatbot-window {

        width: calc(100vw - 20px);

        height: 80vh;

        right: 10px;
        bottom: 10px;
    }

}

/* =========================
   BOT ORB ANIMATION
========================= */

/* .bot-orb {

    position: relative;

    width: 58px;
    height: 58px;

    display: flex;
    align-items: center;
    justify-content: center;
}


.bot-orb .core {

    width: 18px;
    height: 18px;

    border-radius: 50%;

    background: radial-gradient(circle,
        #d7b6ff 0%,
        #9c4dff 35%,
        #4b0082 70%,
        #13001f 100%
    );

    box-shadow:
        0 0 10px #8f2fff,
        0 0 20px rgba(143,47,255,.8),
        0 0 35px rgba(143,47,255,.6);

    position: absolute;

    z-index: 10;

    animation: pulseCore 2s infinite ease-in-out;
}


.bot-orb .glow {

    position: absolute;

    width: 42px;
    height: 42px;

    border-radius: 50%;

    background: radial-gradient(circle,
        rgba(143,47,255,.45),
        rgba(143,47,255,0)
    );

    animation: glowPulse 3s infinite ease-in-out;
}


.bot-orb .ring {

    position: absolute;

    border-radius: 50%;

    border: 2px solid rgba(170, 92, 255, 0.7);

    box-shadow:
        0 0 12px rgba(143,47,255,.6),
        inset 0 0 10px rgba(143,47,255,.4);

    backdrop-filter: blur(2px);
}


.bot-orb .ring-1 {

    width: 42px;
    height: 42px;

    animation:
        rotateRing1 5s linear infinite;
}


.bot-orb .ring-2 {

    width: 50px;
    height: 20px;

    border-color: rgba(210, 180, 255, 0.8);

    animation:
        rotateRing2 3.5s linear infinite;
}


.bot-orb .ring-3 {

    width: 20px;
    height: 50px;

    border-color: rgba(111, 0, 255, 0.8);

    animation:
        rotateRing3 4s linear infinite;
}


@keyframes rotateRing1 {

    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes rotateRing2 {

    from {
        transform: rotateX(70deg) rotate(0deg);
    }

    to {
        transform: rotateX(70deg) rotate(360deg);
    }
}

@keyframes rotateRing3 {

    from {
        transform: rotateY(70deg) rotate(0deg);
    }

    to {
        transform: rotateY(70deg) rotate(-360deg);
    }
}

@keyframes pulseCore {

    0%, 100% {

        transform: scale(1);

        box-shadow:
            0 0 10px #8f2fff,
            0 0 20px rgba(143,47,255,.8),
            0 0 35px rgba(143,47,255,.6);
    }

    50% {

        transform: scale(1.15);

        box-shadow:
            0 0 18px #b86cff,
            0 0 35px rgba(184,108,255,.9),
            0 0 50px rgba(143,47,255,.8);
    }
}

@keyframes glowPulse {

    0%, 100% {
        transform: scale(1);
        opacity: .7;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}
 */

/* =========================================
   ULTRA MODERN AI BUTTON
========================================= */

/* #chatbot-toggle {

    width: 78px;
    height: 78px;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    position: relative;

    overflow: visible;

    background: rgba(10,10,20,.95);

    border: 2px solid rgba(120,120,255,.25);

    box-shadow:
        0 0 20px rgba(0,255,255,.15),
        0 0 40px rgba(138,43,226,.2),
        inset 0 0 25px rgba(255,255,255,.04);

    backdrop-filter: blur(10px);

    transition: .4s ease;
}

#chatbot-toggle:hover {

    transform: scale(1.08);

    box-shadow:
        0 0 25px rgba(0,255,255,.4),
        0 0 60px rgba(138,43,226,.45),
        inset 0 0 25px rgba(255,255,255,.08);
}



.ai-core {

    width: 100%;
    height: 100%;

    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;
}



.ai-center {

    width: 36px;
    height: 36px;

    position: relative;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        radial-gradient(circle at center,
        rgba(255,255,255,.95) 0%,
        rgba(80,200,255,.9) 20%,
        rgba(138,43,226,.9) 55%,
        rgba(0,0,0,0) 100%);

    box-shadow:
        0 0 10px rgba(255,255,255,.9),
        0 0 25px rgba(80,200,255,.9),
        0 0 40px rgba(138,43,226,.7);

    animation: corePulse 2.5s infinite ease-in-out;
}


.inner-core {

    width: 12px;
    height: 12px;

    border-radius: 50%;

    background: white;

    box-shadow:
        0 0 10px white,
        0 0 20px cyan;

    animation: innerFlash 1.5s infinite alternate;
}



.energy {

    position: absolute;

    border-radius: 50%;

    border: 1px solid rgba(255,255,255,.8);

    opacity: .7;
}

.energy-1 {

    width: 50px;
    height: 20px;

    animation:
        rotateEnergy1 3s linear infinite;
}

.energy-2 {

    width: 20px;
    height: 50px;

    border-color: rgba(0,255,255,.9);

    animation:
        rotateEnergy2 2.5s linear infinite reverse;
}



.wave {

    position: absolute;

    border-radius: 50%;

    border: 2px solid rgba(0,255,255,.4);

    animation: waveExpand 3s infinite;
}

.wave-1 {
    animation-delay: 0s;
}

.wave-2 {
    animation-delay: 1s;
}

.wave-3 {
    animation-delay: 2s;
}



.particle {

    position: absolute;

    width: 4px;
    height: 4px;

    border-radius: 50%;

    background: white;

    box-shadow:
        0 0 10px cyan,
        0 0 20px cyan;
}

.p1 {
    top: 8px;
    left: 38px;
    animation: floatParticle 2s infinite ease-in-out;
}

.p2 {
    bottom: 10px;
    right: 14px;
    animation: floatParticle 3s infinite ease-in-out;
}

.p3 {
    left: 12px;
    top: 25px;
    animation: floatParticle 2.7s infinite ease-in-out;
}

.p4 {
    right: 10px;
    top: 18px;
    animation: floatParticle 3.2s infinite ease-in-out;
}



@keyframes corePulse {

    0%,100% {

        transform: scale(1);

        filter: hue-rotate(0deg);
    }

    50% {

        transform: scale(1.15);

        filter: hue-rotate(30deg);
    }
}

@keyframes innerFlash {

    from {

        opacity: .7;
        transform: scale(1);
    }

    to {

        opacity: 1;
        transform: scale(1.4);
    }
}

@keyframes rotateEnergy1 {

    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes rotateEnergy2 {

    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(-360deg);
    }
}

@keyframes waveExpand {

    0% {

        width: 40px;
        height: 40px;

        opacity: .7;
    }

    100% {

        width: 90px;
        height: 90px;

        opacity: 0;
    }
}

@keyframes floatParticle {

    0%,100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-6px);
    }
}


/* =========================================
   ROBOT FLOATING CHAT BUTTON
========================================= */



#chatbot-toggle {

    position: fixed;

    right: 25px;
    bottom: 25px;

    /* width: 170px;
    height: 170px; */

    z-index: 99999;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    transition: .4s ease;
}

/* =========================================
   ANILLO IA
========================================= */

.chatbot-ring {

    position: absolute;

    width: 145px;
    height: 145px;

    border-radius: 50%;

    background:
        conic-gradient(
            from 0deg,
            #00e5ff,
            #8f2fff,
            #00e5ff
        );

    animation:
        rotateRing 6s linear infinite;

    filter:
        blur(1px);

    opacity: .95;

    z-index: 1;
}

/* Fondo interior */

.chatbot-ring::after {

    content: '';

    position: absolute;

    inset: 10px;

    border-radius: 50%;

    background:
        radial-gradient(circle,
            #10111a 0%,
            #0a0b13 100%
        );
}

/* =========================================
   ROBOT
========================================= */

.robot-chat-wrapper {

    position: relative;

    z-index: 3;

    display: flex;
    align-items: center;
    justify-content: center;
}

/* Robot */

.robot-chat-image {

    width: 145px;

    user-select: none;
    pointer-events: none;

    animation:
        floatRobot 3s ease-in-out infinite;

    filter:
        drop-shadow(0 0 15px rgba(143,47,255,.45));
}

/* Hover */

#chatbot-toggle:hover .robot-chat-image {

    transform:
        scale(1.05)
        translateY(-4px);
}

/* =========================================
   TEXTO IA
========================================= */

.chatbot-label {

    position: absolute;

    bottom: -12px;

    padding:
        6px 14px;

    border-radius: 30px;

    background:
        linear-gradient(135deg,
            #8f2fff,
            #00d9ff
        );

    color: white;

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;

    box-shadow:
        0 0 15px rgba(143,47,255,.45);

    z-index: 5;
}

/* =========================================
   ONLINE DOT
========================================= */

.chatbot-online {

    position: absolute;

    top: 25px;
    right: 25px;

    width: 18px;
    height: 18px;

    border-radius: 50%;

    background: #00ff7b;

    border: 3px solid white;

    z-index: 6;

    box-shadow:
        0 0 15px #00ff7b;

    animation:
        pulseOnline 2s infinite;
}

/* =========================================
   ANIMACIONES
========================================= */

@keyframes rotateRing {

    from {

        transform: rotate(0deg);
    }

    to {

        transform: rotate(360deg);
    }
}

@keyframes floatRobot {

    0%,100% {

        transform:
            translateY(0px);
    }

    50% {

        transform:
            translateY(-8px);
    }
}

@keyframes pulseOnline {

    0%,100% {

        transform: scale(1);

        opacity: 1;
    }

    50% {

        transform: scale(1.2);

        opacity: .7;
    }
}

