:root {
    --header-color: #8231D3;
    --bot-message-color: #f0f2f5;
    --user-message-color: #8231D3;
    --font-family: 'Quicksand', sans-serif;
    --font-size: 14px;
    --footer-bg-color: #8231D3;
    --footer-font-color: #ffffff;
    --footer-font-family: 'Quicksand', sans-serif;
    --footer-font-size: 12px;
    --input-bg-color: #ffffff;
    --user-font-color: #ffffff;
    --user-font-family: 'Quicksand', sans-serif;
    --user-font-size: 14px;
    --send-button-color: #8231D3;
    --chat-area-bg-color: #f8f9fa;
    --widget-color: #8231D3;
    --bot-font-color: #000000;
    --bot-font-family: 'Quicksand', sans-serif;
    --bot-font-size: 14px;
}

@import url('https://fonts.googleapis.com/css2?family=Quicksand&display=swap');

.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 600px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: none;  /* Start hidden */
    flex-direction: column;
    z-index: 1000;
    transition: all 0.3s ease;
    font-family: var(--font-family);
    font-size: var(--font-size);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

/* Show state */
.chatbot-container.show {
    display: flex !important;  /* Override any other display settings */
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.chatbot-header {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #1e73be;
    border-radius: 10px 10px 0 0;
    color: white;
}

.chatbot-header img {
    width: 30px;
    height: 30px;
    margin-right: 10px;
    border-radius: 50%;
}

.chatbot-header-title {
    flex-grow: 1;
    font-weight: 600;
}

.close-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    font-size: 18px;
}

#chatbot-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
}

#chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    background: var(--chat-area-bg-color);
}

.message {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    width: 100%;
	padding:0px!important;
}

.message.bot {
    justify-content: flex-start;
}

.message.user {
    justify-content: flex-end;
}

.bot-message-container {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.bot-icon {
    width: 24px;
    height: 24px;
    margin-top: 4px;
    border-radius: 50%;
    flex-shrink: 0;
}

.message-content {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 15px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.message.bot .message-content {
    background: var(--bot-message-color);
    color: var(--bot-font-color) !important;
    font-family: var(--bot-font-family);
    font-size: var(--bot-font-size);
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 80%;
    margin: 5px 0;
    word-wrap: break-word;
}

.message.user .message-content {
    background: var(--user-message-color);
    color: var(--user-font-color);
    margin-right: 8px;
    font-family: var(--user-font-family);
    font-size: var(--user-font-size);
}

#chat-form {
    display: flex;
    padding: 10px;
    border-top: 1px solid #eee;
    background: #fff;
}

#chat-input {
    flex-grow: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 15px;
    max-height: 60px;
    min-height: 40px;
    resize: none;
    background: var(--input-bg-color);
    margin-right: 10px;
}

#chat-form button {
    background: #1e73be;
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
}

/* Chat toggle styles */
#chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    z-index: 999;
    transition: all 0.3s ease;
}

.toggle-message {
    background-color: #1e73be;
    color: #ffffff;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    margin-right: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#chat-toggle img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

#chat-toggle:hover .toggle-message {
    opacity: 0.9;
}

#chat-toggle:hover img {
    transform: scale(1.1);
}

#chat-toggle.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.processing-message {
    display: flex;
    align-items: center;
    justify-content: center;
}

.processing-dots::after {
    content: "...";
    color: #333;
    font-size: 24px;
    animation: dots 1s infinite;
}

.toggle-animation {
    animation: bounce 1s infinite;
}

@keyframes dots {
    0% { content: ""; }
    33% { content: "."; }
    66% { content: ".."; }
    100% { content: "..."; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.animate-bottom {
    position: relative;
    -webkit-animation-name: animatebottom;
    -webkit-animation-duration: 1s;
    animation-name: animatebottom;
    animation-duration: 1s
}

@-webkit-keyframes animatebottom {
    from { bottom:-50px; opacity:0 } 
    to { bottom:0px; opacity:1 }
}

@keyframes animatebottom { 
    from{ bottom:-50px; opacity:0 } 
    to{ bottom:0; opacity:1 }
}

/* Chat arrow styles */
.chat-arrow {
    border: solid white;
    border-width: 0 3px 3px 0;
    display: inline-block;
    padding: 3px;
}

.chat-arrow-down {
    transform: rotate(45deg);
    -webkit-transform: rotate(45deg);
}

.chat-arrow-right {
    width: 20px;
    height: 20px;
    display: grid;
    overflow: hidden;
    color: white;
}

.chat-arrow-right:before,
.chat-arrow-right:after {
    content: "";
    grid-area: 1/1;
    background: currentColor;
    clip-path: polygon(0 10px,calc(100% - 15px) 10px,calc(100% - 15px) 0,100% 50%,calc(100% - 15px) 100%,calc(100% - 15px) calc(100% - 10px),0 calc(100% - 10px));
    transform: translate(calc(0% + var(--s,0%)));
}

.chat-arrow-right:after {
    --s:-100%;
}

/* Mobile responsiveness */
@media screen and (max-width: 768px) {
    .chatbot-container {
        width: 90%;
        height: 80vh;
        right: 5%;
        bottom: 10%;
    }
    
    .toggle-message {
        display: none;
    }
    
    #chat-toggle img {
        width: 50px;
        height: 50px;
    }
}