/* Importing Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

*{
    font-family: "Inter", serif;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

body{
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(#eeeeff,#c8c7ff);
}

.chatbot-popup{
    position: relative;
    width: 420px;
    background-color: #fff;
    overflow: hidden;
    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);
}

.chat-header{
    display: flex;
    padding: 15px 22px;
    background: #5350c4;
    align-items: center;
    justify-content: space-between;
}

.chat-header .header-info{
    display: flex;
    gap: 10px;
    align-items: center;
}

.header-info .chatbot-logo{
    height: 35px;
    width: 35px;
    background: #fff;
    fill: #5350c4;
    padding: 6px;
    flex-shrink: 0;
    border-radius: 50%;
}

.header-info .logo-text{
    color: #fff;
    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: #3d39ac;
}

.chat-body{
    padding: 25px 22px;
    display: flex;
    gap: 20px;
    height: 344px;
    margin-bottom: 82px;
    overflow-y: auto;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: #ccccf5 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: #5350c4;
    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;
    background: #f2f2ff;
}

.chat-body .bot-message.thinking .message-text{
    padding: 2px 16px;
}

.chat-body .bot-message .message-text{
    background: #f2f2ff;
    border-radius: 13px 13px 13px 3px;
}

.chat-body .user-message .message-text{
    background: #5350c4;
    color: #fff;
    border-radius: 13px 13px 3px 13px;
}

.chat-body .bot-message .thinking-indicator{
    display: flex;
    gap: 4px;
    padding-block: 15px;
}

.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(0);
    }
    28%{
        opacity: 0.4;
        transform: translateY(-4px);
    }
    44%{
        opacity: 0.2;
    }
}

.chat-footer{
    position: absolute;
    bottom: 0;
    width: 100%;
    background: #fff;
    padding: 15px 22px 20px;
}

.chat-footer .chat-form:focus-within{
    outline: 2px solid #5350c4;
}

.chat-footer .chat-form{
    display: flex;
    align-items: center;
    border-radius: 32px;
    background: #fff;
    outline: 1px solid #cccce5;
}

.chat-form .chat-controls #send-message{
    background: #5350c4;
    color: #fff;
    display: none;
}

.chat-form .message-input:valid~.chat-controls #send-message{
    display: block;
}

.chat-form .chat-controls #send-message:hover{
    background: #3d39ac;
}

.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: #706db0;
    background: none;
    border-radius: 50%;
    transition: 0.2s ease;
}

.chat-form .chat-controls button:hover{
    background: #f1f1ff;
}

.chat-body .user-message .attachment{
    width: 50%;
    margin-top: -7px;
    border-radius: 13px 3px 13px 13px;
}

.chat-form .file-upload-wrapper{
    height: 35px;
    width: 35px;
    position: relative;
}

.chat-form .file-upload-wrapper img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.chat-form .file-upload-wrapper :where(img,button){
    position: absolute;
}

.chat-form .file-upload-wrapper #file-cancel{
    color: #ff0000;
    background: #fff;
}

.chat-form .file-upload-wrapper :where(img,#file-cancel),
.chat-form .file-upload-wrapper .file-uploaded #file-upload{
    display: none;
}

.chat-form .file-upload-wrapper .file-uploaded img,
.chat-form .file-upload-wrapper .file-uploaded:hover #file-cancel{
    display: block;
}

@media screen and (min-width:800px) {
    .chatbot-popup{
        margin-top: 40px;
        margin-bottom: 40px;
    }
    .chat-body{
        height: 344px;
    }
}