@import url('https://fonts.googleapis.com/css2?family=Forum&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Open+Sans:wght@300..800&display=swap');

*{
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}
body{
    font-family: "Open Sans", sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-image: linear-gradient(#EEEEFF , #C8C7FF);
}
.show-button{
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background-color: #5350C4;
    cursor: pointer;
    color: #fff;
    font-size: 24px;
}
.chatbot{
    transform: scale(0);
    background-color: #fff;
    opacity: 0;
    overflow: hidden;
    width: 400px;
    box-shadow: 0 0 128px 0 rgba(0, 0,0,0.1) , 0 32px 64px -48px rgba(0,0,0,0.5);
    /* height: 500px; */
    border-radius: 15px;
    position: fixed;
    right: 35px;
    bottom: 50px;
    transform-origin: bottom right;
    transition: 0.3s;
}

.chatbot.active{
    opacity: 1;
    transform: scale(1);
}
.chatbot .chat-head{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 22px;
    background-color: #5350C4;

}
.chatbot .chat-head .logo{
    display: flex;
    align-items: center;
    gap: 10px;
}
.chatbot .chat-head .logo .bot-logo{
    width: 35px;
    height: 35px;
    padding: 6px;
    fill: #5350C4;
    background-color: #fff;
    border-radius: 50%;
}
.chatbot .chat-head .logo h2{
    color: #fff;
    font-size: 20px;
    font-weight: 600;
}
.chatbot .chat-head .close{
    border: none;
    color: #fff;
    height: 40px;
    width: 40px;
    font-size: 20px;
    border-radius: 50%;
    cursor: pointer;
    background-color: transparent;
    transition: 0.3s;
}
.chatbot .chat-head .close:hover{
    background-color: #3d39ac;
}

.chat-body{
    padding: 25px 22px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ccccf5 transparent;
}
@media (min-width : 768px) {
    .chat-body{
        height: 70vh !important;
    }
}
.chat-body .message{
    display: flex;
    gap: 10px;
}
.chat-body .message.user-message{
    justify-content: flex-end;
}
.chat-body .user-message:has(img){
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 5px;
}
.chat-body .user-message img{
    width: 50%;
    border-radius:  13px 13px 3px 13px ;
}
.chat-body .message .icon{
    width: 35px;
    height: 35px;
    padding: 6px;
    fill: #fff;
    flex-shrink: 0;
    align-self: flex-end;
    background-color: #5350C4;
    border-radius: 50%;
    margin-bottom: 2px;
}
.chat-body .message  .text{
    padding: 12px 16px;
    max-width: 75%;
    font-size: 14px;
    display: flex;
    flex-wrap: wrap;
}
.chat-body .message.bot-message .text{
    background-color: #f2f2ff;
    border-radius:  13px 13px 13px 3px;
}
.chat-body .message.user-message .text{
    color: #fff;
    border-radius:  13px 13px 3px 13px ;
    background-color: #5350C4;
}

.chat-body .message .text .thinking-mode {
    display: flex;
    gap: 5px;
    padding-block:5px ;
}
.chat-body .message .text .thinking-mode .dot{
    width: 7px;
    height: 7px;
    opacity: 0.7;
    border-radius: 50%;
    background-color: #6f6bc2;
    animation: dotAnimation 1.8s ease-in-out infinite;
    animation-delay: 0.2s;
}
.chat-body .message .text .thinking-mode .dot:nth-child(2){
    animation-delay: 0.3s;
}
.chat-body .message .text .thinking-mode .dot:nth-child(3){
    animation-delay: 0.4s;
}



.chat-foot{
    width: 100%;
    background-color: #fff;
    padding: 5px 12px 10px;
    position: absolute;
    bottom: 0;
    left: 0;

}
.chat-foot .form{
    display: flex;
    align-items: center;
    border-radius: 32px;
    outline: 1px solid #cccce5;
    position: relative;
    transition: 0.3s;
}
.chat-foot .form:focus-within{
    outline-color: #5350C4;
}

.chat-foot .form textarea{
    width: 100%;
    height: 47px;
    outline: none;
    border: none;
    padding: 14px 0 13px 18px;
    border-radius: inherit;
    resize: none;
    max-height: 50vh;
    overflow-y: auto;
    scrollbar-width:thin;
    scrollbar-color: #fff transparent;
}


.chat-foot .form .buttons{
    display: flex;
    align-items: center;
    height: 47px;
    gap: 3px;
    align-self: flex-end;
    margin-right: 3px;
}
.chat-foot .form .buttons button{
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    color: #706db0;
    background-color: transparent;
    transition: 0.3s;
    cursor: pointer;
    font-size: 18px;
}
.chat-foot .form .buttons button:hover{
    background-color: #f1f1ff;
}
.chat-foot .form .buttons button.submit{
    display: none;
    background-color: #5350C4;
    color: #fff;
    line-height:35px;
    text-align: center;
}
.chat-foot .form .buttons button.submit:hover{
    background-color: #3d39ac;
}
.chat-foot .form textarea:valid ~ .buttons button.submit{
    display: block;
}
.chat-foot .form .buttons button:hover{
    background-color:cornsilk
}
.chat-foot .form .buttons button:active{
    background-color: blanchedalmond;
}
.chat-foot .form .buttons .file-upload-wrapper {
    width: 35px;
    height: 35px;
    position: relative;
    /* display: flex;
    align-items: center;
    gap: 3px; */
}
.chat-foot .form .buttons .file-upload-wrapper .attach-image{
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: none;
    
}
.chat-foot .form .buttons .file-upload-wrapper.uploaded .attach-image{
    display: block;
}
.chat-foot .form .buttons .file-upload-wrapper #cancel-upload{
    display: none;
    position: absolute;
    color: #ff0000;
    background-color: #fff;
    transition: 0.3s;

}
.chat-foot .form .buttons .file-upload-wrapper.uploaded:hover #cancel-upload{
    display: block;
}

.chat-foot .form .emoji{


    position: absolute;
    left: 50%;
    top: -337px;
    width: 100%;
    max-width: 350px;
    max-height: 330px;
    transform: translateX(-50%);
    visibility: hidden;
    
    
}
.show-emoji-picker .chat-foot .form .emoji{
    visibility: visible;
}
@media (max-width:767px) {
    .chatbot{
        border-radius: 0;
        width: 100vw;
        height: 100vh;
        position: sticky;
    }
    .chatbot .chat-head{
        height: 70px;
    }
    .chatbot .chat-body{
        height: calc(100vh - 140px);
    }
}
@keyframes dotAnimation {
    0% , 44%{
        opacity: 1;
        transform: translateY(0);
    }
    28%{
        opacity: 0.4;
        transform: translateY(-5px);
    }
    44%{
        opacity: 0.2;
    }
}