.chatbot{
    z-index: 99999;
    position: fixed;
    right: 40px;
    bottom: 100px;
    width: 400px;
    height: 80vh;
    transform: scale(0.5);
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    transform-origin: bottom right;
    background: #fff;
    border-radius: 15px;
    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;
}

.chatbot header h2{
    color: #fff;
    font-size: 1.2rem;
    width: 90%;
}

.chatbot header span{
    position: absolute;
    right: 15px;
    top: 33px;
    font-size: 25px;
    color: #fff;
    cursor: pointer;
    display: none;
    transform: translateY(-50%);
    padding-left: 10px;
}

.chatbot .chatbox{
    overflow-y: auto;
    padding: 30px 20px 100px;
}

.chatbox .chat{
    display: flex;
}

.chatbox .incoming span{
    height: 32px;
    width: 32px;
    color: #fff;
    align-self: flex-start;
    background: #724ae8;
    text-align: center;
    line-height: 32px;
    border-radius: 4px;
    margin: 0 10px 7px 0;
}

.chatbox .incoming span img{
    width: 100%;
    height: 100%;
}

.chatbox .outgoing{
    margin: 20px 0;
    justify-content: flex-end;
}

.chatbox .chat p{
    color: #fff;
    max-width: 75%;
    white-space: pre-wrap;
    padding: 12px 16px;
    border-radius: 10px 10px 0 10px;
    background: #724ae8;
    font-size: 0.95rem;
}

.chatbot .container{
    overflow-y: scroll;
    height: 90%;
}

.chatbox .incoming p{
    color: #000;
    background: #f2f2f2;
    border-radius: 10px 10px 10px 0;
}

.chatbot .chat-input{
    position: absolute;
    bottom: 0;
    width: 100%;
    background: #fff;
    padding: 5px 20px;
    border-top: 1px solid #ccc;
    display: flex;
    gap: 5px;
}

.chat-input textarea{
    height: 55px;
    width: 100%;
    border: none;
    outline: none;
    font-size: 0.95rem;
    resize: none;
    padding: 16px 15px 16px 0;
}

.chat-input span{
    align-self: flex-end;
    height: 55px;
    line-height: 55px;
    color: #724ae8;
    font-size: 1.35rem;
    cursor: pointer;
    visibility: hidden;
}

.chat-input textarea:valid ~ span{
    visibility: visible;
}

/* The Open and close button */
.chatbot-toggler{
    position: fixed;
    right: 5px;
    bottom: 50px;
    height: 50px;
    width: 50px;
    color: #fff;
    cursor: pointer;
    background: #724ae8;
    border: none;
    outline: none;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

.show-chatbot .chatbot-toggler{
    transform: rotate(90deg);
}
.chatbot-toggler span{
    position: absolute;
    font-size: 25px;
}

.show-chatbot .chatbot-toggler span:first-child,
.chatbot-toggler span:last-child{
    opacity: 0;
}

.show-chatbot .chatbot-toggler span:last-child{
    opacity: 1;
}

@media (max-width:490px){
    .chatbot{
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .chatbot .container{
        overflow-y: scroll;
    }

    .chatbot .chatbox{
        width: 90%;
    }

    .chatbot header span{
        display: block;
    }
}