@import url('https://fonts.googleapis.com/css2?family=Popins:wght@400;500;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

body {
    background: #f0f0f0;
    z-index: 100;
}

.chatbot-toggler {
    position: fixed;
    right: 40px;
    bottom: 35px;
    height: 100px;
    width: 100px;
    color: #fff;
    background: #1609d4;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    outline: none;
    cursor: pointer;
    border-radius: 50%;
    z-index: 100;
}

.chatbot-toggler span {
    position: absolute;
    z-index: 100;
}

.chatbot {
    position: fixed;
    right: 40px;
    bottom: 100px;
    transform: scale(0.5);
    opacity: 0;
    pointer-events: none;
    width: 420px;
    background: #fff;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 100;
}

.show-chatbot {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
    z-index: 100;
}

.chatbot header {
    z-index: 1000;
    background: #1609d4;
    padding: 16px 0;
    text-align: center;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.chatbot header h2 {
    color: #fff;
    font-size: 1.4rem;
    margin-bottom: 8px;
    z-index: 100;
}

.chatbox {
    height: 300px;
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.chatbox .chat {
    display: flex;
    flex-direction: column;
    z-index: 100;
    margin-bottom: 12px;
}

.chatbox .incoming {
    display: flex;
    align-items: flex-start;
    z-index: 100;
}

.chatbox .incoming span {
    height: 32px;
    width: 32px;
    background: #1609d4;
    color: #fff;
    align-self: flex-end;
    text-align: center;
    line-height: 32px;
    border-radius: 50%;
    margin-right: 10px;
    z-index: 100;
}

.chatbox .incoming p {
    color: #333;
    font-size: 0.9rem;
    max-width: 75%;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 10px;
    word-wrap: break-word; /* Para manejar palabras largas */
    z-index: 100;
}

.chatbox .outgoing {
    display: flex;
    flex-direction: column-reverse; /* Invierte el orden de los mensajes salientes */
    align-items: flex-end;
    z-index: 100;
}

.chatbox .outgoing p {
    color: #333;
    font-size: 0.9rem;
    max-width: 75%;
    padding: 10px;
    background: #1609d4;
    border-radius: 10px;
    color: #fff;
    word-wrap: break-word; /* Para manejar palabras largas */
    z-index: 1000;
}

.chat-input {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #f0f0f0;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    z-index: 100;
}

.chat-input textarea {
    flex: 1;
    min-height: 36px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 8px;
    resize: none;
    font-size: 0.9rem;
    outline: none;
    color: #333;
    z-index: 1000;
}

.chat-input #send-btn {
    cursor: pointer;
    margin-left: 10px;
    font-size: 1.2rem;
    color: #1609d4;
    z-index: 100;
}

.close-button {
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    z-index: 100;
}

.close-button .material-symbols-outlined {
    color: #fff;
    font-size: 1.4rem;
    z-index: 100;
}


.chatbox .incoming span {
    height: 32px;
    width: 32px;
    background: #1609d4;
    color: #fff;
    align-self: flex-end;
    text-align: center;
    line-height: 32px;
    border-radius: 50%;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.material-symbols-outlined {
    font-family: 'Material Icons Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    z-index: 100;
}


@media screen and (max-width: 600px) {
    .chatbot {
        width: 100%;
        bottom: 0;
        border-radius: 0;
    }

    .chatbox {
        height: 200px;
    }

    .chat-input {
        border-radius: 0;
    }
}
