#chatbot-toggler {
    position: fixed;
    bottom: 30px;
    right: 35px;
    border: none;
    height: 50px;
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    background: rgb(0, 124, 90);;
    transition: all 0.2s ease;
    z-index: 99;
}

body.show-chatbot #chatbot-toggler {
    transform: rotate(90deg);
}

#chatbot-toggler span {
    color: #fff;
    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;
}

.chatbot-popup {
    position: fixed;
    right: 35px;
    bottom: 90px;
    width: 420px;
    max-height: 600px;
    background: #fff;
    overflow: hidden;
    border-radius: 15px;
    opacity: 0;
    transform: scale(0.2);
    display: none;
    transform-origin: bottom right;
    pointer-events: none;
    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;
    z-index: 99;
}

body.show-chatbot .chatbot-popup {
    opacity: 1;
    display: block;
    pointer-events: auto;
    transform: scale(1);
}

.chat-header {
    display: flex;
    align-items: center;
    color: #fff;
    background: rgb(0, 124, 90);;
    padding: 15px 22px;
    justify-content: space-between;
}

.chat-header .header-info {
    display: flex;
    gap: 10px;
    align-items: center;
}

.header-info .chatbot-logo {
    height: 35px;
    width: 35px;
    padding: 6px;
    fill: rgb(0, 124, 90);;
    flex-shrink: 0;
    background: #fff;
    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;
    cursor: pointer;
    border-radius: 50%;
    background: none;
    transition: 0.2s ease;
    padding: 0;
}

.chat-header #close-chatbot:hover {
    background-color: rgb(0, 124, 90);;
}

.chat-body {
    padding: 25px 22px;
    display: flex;
    gap: 20px;
    height: 460px;
    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;
    margin-bottom: 2px;
    align-self: flex-end;
    flex-shrink: 0;
    background: rgb(0, 124, 90);;
    border-radius: 50%;
}

.chat-body .user-message {
    flex-direction: column;
    align-items: flex-end;
}

.chat-body .user-message .attachment {
    width: 50%;
    margin-top: -7px;
    border-radius: 13px 3px 13px 13px;
}

.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 a {
    text-decoration: underline;
    color: black;
}

.chat-body .bot-message .message-text {
    background: #F2F2FF;
    border-radius: 13px 13px 13px 3px;
}

.chat-body .user-message .message-text {
    color: #fff;
    background: rgb(0, 124, 90);;
    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: rgb(0, 124, 90);;
    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;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.chat-footer .chat-form {
    display: flex;
    width: 100%;
    position: relative;
    align-items: center;
    background: #fff;
    border-radius: 32px;
    outline: 1px solid #CCCCE5;
    height: 47px;
}

.chat-footer .chat-form:focus-within {
    outline: 2px solid rgb(0, 124, 90);;
}

#clear-button {
    align-items: center;
    height: 47px;
    width: 47px;
    border: none;
    font-size: 11px;
    cursor: pointer;
    padding: 12px;
    background: #f1f1ff;
    border-radius: 50%;
    transition: 0.2s ease;
    outline: 1px solid #CCCCE5
}

#clear-button:hover {
    background: rgba(148, 25, 37, 1);
}

.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: rgb(0, 124, 90);;
    background: #f1f1ff;
    border-radius: 50%;
    transition: 0.2s ease;
    margin: 6px;
}

.chat-form .chat-controls button:hover {
    background: #f1f1ff;
}

.chat-form .chat-controls #send-message {
    color: #fff;
    padding: 0;
    background: rgb(0, 124, 90);;
}
.chat-form .chat-controls #send-message {
    background: rgb(0, 124, 90);
    margin: 0;
}
.chat-form .message-input:valid~.chat-controls #send-message {
    display: block;
}

/* responsiveness*/
@media (max-width: 600px) {
    
    .chatbot-popup {
      width: 95%;        
      right: 2.5%;    
      bottom: 20px;      
      height: 80vh;       
      border-radius: 10px;
    }
    
    .chat-header,
    .chat-body,
    .chat-footer {
      padding: 10px 15px;
    }
    
    .chat-header .logo-text {
      font-size: 1.1rem;
    }
    
    .chat-body .message .message-text {
      font-size: 0.9rem;
      max-width: 90%;  
    }
    
    .chat-form .message-input {
      font-size: 0.9rem;
      padding: 10px 12px;
    }

    .chat-form .chat-controls button {
      height: 30px;
      width: 30px;
      font-size: 1rem;
    }
  }