/*IMPORTANDO GOOGLE FONTS - INTER*/
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,100..900&display=swap');


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Inter", sans-serif;
}

body {
    min-height: 100vh;
    background: linear-gradient(#EEEEFF, #C8C7FF);
}

#chatbot-toggler {
    background-color: white;
    color: black;
   position: fixed;
    bottom: 30px;
    right: 35px; 
    border: none;
    height: 50px;
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow:     0 12px 25px rgba(0, 0, 0, 0.4)
}

#chatbot-toggler:hover{
    background-color: black;
  color: white;
  -webkit-box-shadow: -3px 3px 11px rgba(41, 59, 95, 0.25);
  transform: scale(1.1); /* crece un poco */
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.4),
            0 0 15px rgba(255, 255, 255, 1); /* sombra */
}

#chatbot-toggler:hover span {
        color: white;
}

body.show-chatbot #chatbot-toggler {
    transform: rotate(90deg);
}

#chatbot-toggler span {
    color: black; /* icono por defecto en negro */
    position: absolute;
    transition: color 0.18s ease;
}


#chatbot-toggler span:last-child {
    opacity: 0;
}

body.show-chatbot #chatbot-toggler span:last-child {
    opacity: 1;
}

body.show-chatbot #chatbot-toggler span:first-child{
    opacity: 0;
}


.chat-popup{
    position: fixed;
    right: 90px;
    bottom: 0px;
    width: 420px;
    background: #fff;
    overflow: hidden;
    border-radius: 15px;
    opacity: 0;
    transform: scale(0.2);
    transform-origin: bottom right;
    pointer-events: none;
    box-shadow: 0 0 128px 0 rgba(0, 0, 0, 0.1), 0 32px 64px -48px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
}



body.show-chatbot .chat-popup {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);

}

.chat-header {
    display: flex;
    align-items: center;
    background: #000066;
    padding: 15px 22px;
    justify-content: space-between;
}

.chat-header .header-info {
display: flex;
gap: 10px;
align-items: center;
}

.header-info .chatbot-logo {
    height: 35px;
    width: 35px;
    padding: 6px;
    fill: #000066;
    flex-shrink: 0;
    background: #fff;
    border-radius: 50%;
}

.header-info .logo-texto {
    color: white;
    font-size: 1.31rem;
    font-weight: 600;
}

.chat-header #close-chatbot {
    border: none;
    color: #fff;
    height: 40px;
    width: 40px;
    font-size: 1.9rem;
    margin-right: -10px;
    padding-top: 2px;
    cursor: pointer;
    border-radius: 50%;
    background: none;
    transition: 0.2s ease;
}

.chat-header #close-chatbot:hover {
    background: white;
    color: black;
}

.chat-body {
    padding: 25px 22px;
    display: flex;
    gap: 20px;
    height: 420px;
    margin-bottom: 82px;
    overflow-y: auto;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: #CCCCFF transparent;
}

.chat-body .message{
    display: flex;
    gap: 11px;
    align-items: center;
}

.chat-body .bot-message .bot-avatar {
    height: 35px;
    width: 35px;
    padding: 6px;
    fill: #fff;
    flex-shrink: 0;
    margin-bottom: 2px;
    align-self: flex-end;
    background: #000066;
    border-radius: 50%;
}

.chat-body .user-message {
    flex-direction: column;
    align-items: flex-end;
}

.chat-body .message .message-text {
    padding: 12px 16px;
    max-width: 75%;
    font-size: 0.95rem;
}


.chat-body .bot-message.thinking .message-text  {
    padding: 2px 10px;
}

.chat-body .bot-message .message-text {
    background: #CCCCFF;
    border-radius: 13px 13px 13px 13px;

}


.chat-body .user-message .message-text {
    color: black;
    background: #E5E5FF;
    border-radius: 13px 13px 13px 13px;
    white-space: pre-wrap; /* Permite saltos de línea */
    word-break: break-word;

}

.chat-body .bot-message .thinking-indicator {
    display: flex;
    gap: 7px;
    padding-block: 12px;
    white-space: pre-wrap; /* Permite saltos de línea */
    word-break: break-word;
}

.chat-body .bot-message .thinking-indicator .dot {
    height: 7px;
    width: 7px;
    opacity: 0.7;
    border-radius: 50%;
    background: #6F6BC2;
   animation: dotPulse 1.8s ease-in-out infinite; 
}

.chat-body .bot-message .thinking-indicator .dot:nth-child(1) {
    animation-delay: 0.2s;
}

.chat-body .bot-message .thinking-indicator .dot:nth-child(2) {
    animation-delay: 0.3s;
}

.chat-body .bot-message .thinking-indicator .dot:nth-child(3) {
    animation-delay: 0.4s;
}


@keyframes dotPulse {
    0%, 44% {
        transform: translateY(-4px);
    }

    28% {
        opacity: 0.4;
        transform: translateY(-4px);
    }

    44% {
        opacity: 0.4;
    }
}

.chat-footer {
    position:absolute;
    bottom: 0;
    width: 100%;
    background: #fff;
    padding: 15px 22px 20px;
}

.chat-footer  .chat-form {
    display:flex;
    position: relative;
    align-items: center;
    background: #fff;
    border-radius: 32px;
    outline: 1px solid #CCCCE5;
}

.chat-footer  .chat-form:focus-within {
    outline: 2px solid #0000ff;

}

.chat-form .message-input {
    border: none; 
    outline: none;
    height: 47px;
    width: 100%;
    resize: none;
    font-size: 0.95rem;
    padding: 14px 0 13px 18px;
    border-radius: inherit;
}

.chat-form .chat-controls {
    display: flex;
    height: 47px;
    gap: 3px;
    align-items: center;
    align-self: flex-end;
    padding-right: 6px;
}

.chat-form .chat-controls button {
    height: 35px;
    width: 35px;
    border: none;
    font-size: 1.15rem;
    cursor: pointer;
    color: #0000ff;
    background: none;
    border-radius: 50%;
    transition: 0.2s ease;
}

.chat-form .chat-controls #send-message {
    color: #fff;
    display: none;
    background: #9999FF;
}

.chat-form .message-input:valid~.chat-controls #send-message {
    display: block;
}

.chat-form .chat-controls #send-message:hover {
    background: #3d39ac;
}

.chat-form .chat-controls button:hover {
background: #f1f1ff;
}

em-emoji-picker {
    position: absolute;
    left: 50%;
    top: -337px;
    width: 100%;
    max-width: 350px;
    max-height: 330px;
    visibility: hidden;
    transform: translateX(-50%);
}

body.show-emoji-picker em-emoji-picker {
    visibility: visible;
}


#whatsapp-float {
    position: fixed;
    bottom: 95px; /* ajusta según el tamaño y separación del botón de chatbot */
    right: 35px;
    height: 50px;
    width: 50px;
    border-radius: 50%;
    background-color: #25D366; /* verde de WhatsApp */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    text-decoration: none;
    box-shadow: 0 12px 25px rgba(0,0,0,0.4);
    transition: 0.2s ease;
    z-index: 1000;
}

#whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 25px rgba(0,0,0,0.6), 0 0 15px #25D366;
}

  
  
@media (max-width: 520px) {
    #chatbot-toggler {
        right: 20px;
        bottom: 20px;
    }

    .chat-popup {
        right: 0;
        bottom: 0;
        height: 100%;
        border-radius: 0;
        width: 100%;
    }
    
    .chat-popup .chat-header {
        padding: 12px 15px;
    }

    .chat-body {
        height: calc(90% - 55px);
        padding: 25px 15px;
    }

    .chat-footer {
        padding: 10px 15px 15px;
    }

    /* Alinear el botón de WhatsApp con el toggler en pantallas pequeñas */
    #whatsapp-float {
        right: 20px !important; /* igual que #chatbot-toggler */
        bottom: 78px !important; /* sitúa justo encima del toggler (20px bottom + 50px height + ~8px gap) */
    }

    /* Ocultar el botón de WhatsApp cuando el chatbot esté abierto en pantallas pequeñas */
    body.show-chatbot #whatsapp-float {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }


}