@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Roboto:wght@100..900&display=swap');

*{
    font-family:'Inter',sans-serif;
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{
    /* display:flex;
    align-items:center;
    justify-content:center; */
    background:linear-gradient(#CC3333,lightslategrey);
    min-height:100vh;
}

.chatbot-popup{
    width:420px;
    background:aliceblue;
    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);
    position:fixed;
    right:35px;
    bottom:90px;
    opacity:0;
    pointer-events:none;
    transition:all 0.5s ease;
    transform:scale(0.2);
    transform-origin:bottom right;
}

body.show-chatbot .chatbot-popup{
    opacity: 1;
    pointer-events:auto;
    transform:scale(1);
}

.chat-header{
    background:#990000;
    display:flex;
    align-items:center;
    padding:15px 22px;
    justify-content:space-between;
}

.chat-header .header-info{
    display:flex;
    align-items:center;
    gap:10px;
    color:#7DF9FF
}

.header-info .chatbot-logo{
    height:35px;
    width:35px;
    background:#7DF9FF;
    border-radius:10px;
    padding:6px;
    fill:#CC3333;
    flex-shrink:0;
}

.header-info .logo-text{
    color:#7DF9FF;
    font-size:1.31rem;
    font-weight:600;
}

.chat-header #close-chatbot{
    border:none;
    color:#7DF9FF;
    height:40px;
    width:40px;
    border-radius:50%;
    background:none;
    font-size:1.9rem;
    margin-right:-10px;
    padding-top:2px;
    cursor:pointer;
    transition:0.2s ease;
}

.chat-header #close-chatbot:hover{
    background:#CC3333;
}

.chat-body{
    padding:25px 22px;
    display:flex;
    flex-direction:column;
    gap:20px;
    height:460px;
    margin-bottom:82px;
    overflow-y:auto;
    scrollbar-width:thin;
    scrollbar-color:#990000 transparent;
}

.chat-footer{
    position:absolute;
    background: #990000;
    bottom:0;
    padding:15px 22px 20px;
    width:100%
}

.chat-body .message{
    display:flex;
    gap:10px;
    align-items:center;
}

.chat-body .bot-message .bot-avatar{
    height:35px;
    width:35px;
    padding:6px;
    fill:#CC3333;
    align-self:flex-end;
    flex-shrink:0;
    background:#7DF9FF;
    border-radius:50%;
    margin-bottom:2px;
}

.chat-body .message .message-text{
    padding:12px 16px;
    max-width:75%;
    font-size:0.95rem;
    background:#7DF9FF;
    border-radius:10px;
}

.chat-body .bot-message.thinking .message-text{
    padding:2px 16px;
}

.chat-body .user-message{
    flex-direction:column;
    align-items:flex-end;
}

.chat-body .bot-message .message-text{
    color:#990000;
    background:#7DF9FF;
    border-radius:13px 13px 13px 3px;
}

.chat-body .user-message .message-text{
    color:#7DF9FF;
    background:#990000;
    border-radius:13px 13px 3px 13px;
}

.chat-body .bot-message .thinking-indicator .dot{
    height:8px;
    width:8px;
    border-radius:50%;
    background:#990000;
    opacity:0.7;
    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-body .bot-message .thinking-indicator{
    display:flex;
    gap:4px;
    padding-block:15px;
}

.chat-footer .chat-form{
    display:flex;
    align-items:center;
    background:#7DF9FF;
    outline:1px solid black;
    border-radius:32px;
    position:relative;
}

.chat-footer .chat-form:focus-within{
    outline:2px solid #CC3333;
}

.chat-form .message-input{
    border:none;
    outline:none;
    height:48px;
    width:100%;
    font-size:0.95rem;
    padding:14px 0 13px 18px;
    border-radius:inherit;
    background:#7DF9FF;
    resize:none;
    max-height:180px;
    white-space:pre-line;
    scrollbar-width:thin;
    scrollbar-color: transparent ;
}

.chat-form .message-input:hover{
    scrollbar-color:transparent;
}

.chat-form .chat-controls{
    display:flex;
    align-items:center;
    align-self:flex-end;
    padding-right:6px;
    height:48px;
    gap:3px;
}

.chat-form .chat-controls button{
    height:35px;
    width:35px;
    border:none;
    cursor:pointer;
    background:none;
    border-radius:50%;
    font-size:1.15rem;
    transition:0.2s ease;
}

.chat-form .chat-controls button:hover{
    background:#5FCFEF
}

.material-symbols-rounded{
    color:#990000;
}

.chat-form .chat-controls #send-message{
    color:#CC3333;
    background:#4CB8D8;
    display:none;
}

.chat-form .message-input:valid~.chat-controls #send-message{
    display:block;
}

.chat-form .chat-controls #send-message:hover{
    color:#7DF9FF;
    background:#990000;
}

.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{
    position:absolute;
    width:100%;
    height:100%;
    object-fit:cover;
    border-radius:50%;
    
}

.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;
}

.chat-form .file-upload-wrapper :where(img, button){
    position:absolute;
}

.chat-form .file-upload-wrapper #file-cancel{
    color:#990000;
    background:#4CB8D8;
}

em-emoji-picker{
    position:absolute;
    left:50%;
    top:-337px;
    width:100%;
    max-width:350px;
    max-height:330px;
    transform:translateX(-50%);
    visibility: hidden;
}

body.show-emoji-picker em-emoji-picker{
    visibility: visible;
}

#chatbot-toggler{
    position:fixed;
    bottom:30px;
    right:35px;
    border:none;
    height:50px;
    width:50px;
    cursor:pointer;
    border-radius:50%;
    background:#7DF9FF;
    display:flex;
    align-items:center;
    justify-content:center;
    transition:all 0.5s ease;
}

body.show-chatbot #chatbot-toggler{
    transform:rotate(90deg);
}

#chatbot-toggler span{
    color:#990000;
    fill:#990000;
    position:absolute;
}

body.show-chatbot #chatbot-toggler span:first-child,
#chatbot-toggler span:last-child{
    opacity:0;
}

body.show-chatbot #chatbot-toggler span:last-child{
    opacity:1;
}


@media(max-width:520px){
    
    #chatbot-toggler{
        right:20px;
        bottom:20px;
    }

    .chatbot-popup{
        right:0;
        bottom:0;
        height:100%;
        border-radius:0;
        width:100%;
    }

    .chatbot-popup .chat-header{
        padding:12px 15px;
    }

    .chat-body{
        height:calc(90% - 55px);
        padding:25px 15px;
    }

    .chat-footer{
        padding:10px 15px 15px;
    }

    .chat-form .file-upload-wrapper.file-uploaded #file-cancel{
        opacity:0;
    }
}

