@import url('https://fonts.googleapis.com/css?family=Poppins:wght@400;500;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Porpins", sans-serif;

}

body {
    background: #E3F2FD;
}

.chatbot-toggler {
    position: fixed;
    right: 20px;
    bottom: 35px;
    height: 50px;
    width: 50px;
    background-color: #724ae8;
    color: #fff;
    border-radius: 50%;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.show-chatbot .chatbot-toggler {
    transform: rotate(90deg);
}

.chatbot-toggler span {
    position: absolute;
}

.chatbot-toggler span:first-child {
    transform: translateY(10%);
}

.show-chatbot .chatbot-toggler span:first-child,
.chatbot-toggler span:last-child {
    opacity: 0;
}

.show-chatbot .chatbot-toggler span:last-child {
    opacity: 1;
}

.chatbot {
    position: fixed;
    right: 20px;
    bottom: 100px;
    width: 400px;
    height: 500px;
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    transform: scale(0.5);
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    transform-origin: bottom right;
    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.1s ease;
}

.show-chatbot .chatbot {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
}

.chatbot header {
    background: #724ae8;
    padding: 16px 0;
    text-align: center;
    position: relative;

}

.chatbot header span {
    position: absolute;
    right: 20px;
    top: 50%;
    color: #fff;
    cursor: pointer;
    transform: translateY(-50%);
    display: none;

}

.chatbot header h2 {
    color: #fff;
    font-size: 1.4rem;

}

.chatbot .chatbox {
    height: 378px;
    overflow-y: auto;
    padding: 30px 20px 70px;
}

.chatbox .chat {
    display: flex;
}

.chatbox .incoming span {
    height: 32px;
    width: 32px;
    color: #fff;
    align-self: flex-end;
    background-color: #724ae8;
    text-align: center;
    line-height: 32px;
    border-radius: 4px;
    margin: 0 10px 7px 0;


}

.chatbox .outgoing {
    justify-content: flex-end;
    margin: 20px 0;

}

.chatbox .chat p {
    padding: 12px 16px;
    max-width: 75%;
    white-space: pre-wrap;
    color: #fff;
    border-radius: 10px 10px 0 10px;
    background: #724ae8;
}

.chatbot .incoming p {
    color: black;
    background-color: #f2f2f2;
    border-radius: 10px 10px 10px 0;
}

.chatbox .chat p.error {
    color: #721c24;
    background-color: #f8d7da;
}

.chatbot .chat-input {
    position: absolute;
    bottom: 0;
    width: 100%;
    display: flex;
    gap: 5px;
    border-top: 1px solid #ccc;
    background-color: #fff;
    padding: 5px 20px;

}

.chat-input textarea {
    height: 55px;
    width: 100%;
    border: none;
    outline: none;
    font-size: 0.95rem;
    resize: none;
    padding: 16px 15px 16px 0;
    max-height: 180px;
}

.chat-input span {
    align-self: flex-end;
    color: #724ae8;
    font-size: 1.5rem;
    cursor: pointer;
    height: 55px;
    line-height: 55px;
    visibility: hidden;

}

.chat-input textarea:valid~span {
    visibility: visible;
}

@media(max-width: 490px) {
    .chatbot {
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .chatbot .chatbox {
        height: 90%;
    }

    .chatbot header span {
        display: block;
    }
}