/* Container for the entire chat widget, initially hidden */
#AI24AI-chatbot-container {
    position: fixed;
    bottom: 110px;
    right: 24px;
    width: 425px;
    height: 700px;
    background-color: #ffff;
    box-shadow: 0 8px 12px rgba(0,0,0,0.1);
    border-radius: 15px;
    z-index: 9998; 
    overflow: hidden;
    transform: translateY(200px); 
    opacity: 0;
    pointer-events: none; 
    transition: transform 0.5s ease, opacity 0.6s ease, visibility 0.6s ease;
    display: none;
    box-sizing: border-box;
}

#AI24AI-chatbot-container.active {
    transform: translateY(0); 
    opacity: 1;
    pointer-events: auto; 
    display: block;
}

/* Style for the chat messages container */
#chat-messages {
    height: calc(100% - 180px);
    top: 3px;
    overflow-y: auto;
    padding: 10px 15px;
    border-radius: 18px;
    position: relative;
    display: flex;
    flex-direction: column;
    margin: 0px 0;
    font-size: 16px !important;
    word-break: break-word;
    color: black;
    word-wrap: break-word;
    line-height: 1.5;
    text-rendering: auto;
    letter-spacing: 1px;
    box-sizing: content-box;
}
  
/* Adjust padding and margins for the chat message bubbles */
.chat-message {
    padding: 8px 15px; 
    margin: 5px 0; 
    border-radius: 20px; 
    font-size: 16px !important; 
    max-width: 70%; 
    word-break: break-word;
    display: flex;
    flex-direction: column;
    gap: 10px;
    white-space: nowrap;
    flex-wrap: wrap;
    overflow-wrap: break-word;
}

.chat-message .message-content {
    flex-grow: 1; 
    white-space: pre-wrap; 
}

/* Adjust the user message bubble styles for right alignment */
.chat-message.user-message {
    text-align: left;
    margin-left: auto;
    margin-right: 5px;
    border-bottom-right-radius: 3px;
    max-width: 75%;
    background-color: #eeeeee;
    flex-direction: row-reverse;
    align-items: center; 
    justify-content: flex-end; 
    position: relative;
    white-space: normal;

}

/* Adjust the assistant message bubble styles for left alignment */
.chat-message.assistant-message {
    text-align: left;
    margin-left: 5px;
    margin-right: auto;
    border-bottom-left-radius: 3px;
    max-width: 75%;
    background-color: #eeeeee;
    flex-direction: row;
    position: relative;
    justify-content: flex-end;
    align-items: center;
    white-space: normal;
    line-height: 1.5;
}

/* Style for the input field */
#chat-input {
    width: calc(90% - 30px);
    height: 50px;
    padding: 10px;
    margin: 0 15px;
    border: 1px solid lightgrey;
    position: absolute;
    bottom: 32px;
    left: 0px;
    margin-right: 10px;
    border-radius: 15px;
    box-sizing: border-box;
    overflow-y: hidden; 
    resize: none;
    max-height: 75%;
    min-height: 50px;
    transition: height 0s;
    font-size: 16px !important;
    text-align: left; 
    vertical-align: middle; 
    line-height: 28px;
    letter-spacing: 1px;
}

/*Style for input field when active */
#chat-input:focus {
    border: none; 
    box-shadow: 0 0 5px #632289; 
    outline: none; 
}

/* Style for the send button's container */
.send-button-container {
    position: absolute;
    right: 12px; 
    bottom: 32px;
    height: 50px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

/* Style for the send SVG itself */
#send-button {
    width: 38.4px !important; 
    height: auto; 
    cursor: pointer;
}

@keyframes fadeIn {
    from {
        opacity: 0; /* Start hidden */
    }
    to {
        opacity: 1; /* Fade to fully visible */
    }
}

@keyframes fadeOut {
    from {
        opacity: 1; /* Start visible */
    }
    to {
        opacity: 0; /* Fade to fully hidden */
    }
}

/* Circular button to open the chat widget */
#AI24AI-chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 70px;
    height: 70px;
    background-color: #632289; 
    border-radius: 50%;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 9999;
    opacity: 0; 
    animation: fadeIn 1s ease forwards; 
    transition: transform 0.21s ease-in-out;
}

.toggle-visible {
    opacity: 1; 
    transition: opacity 0.5s ease; 
}

#AI24AI-chatbot-toggle:hover {
    transform: scale(1.1); 
}

#AI24AI-chatbot-toggle:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0, 0, 0, 0.2); 
    border-radius: 50%; 
    pointer-events: none; 
}

/* Style for the SVG inside the toggle button */
#AI24AI-chatbot-toggle img {
    width: 65%;
    height: auto;
    filter: brightness(0) invert(1);
}

/* Container for the chatbox controls */
#chatbox-controls {
    position: absolute;
    top: 4;
    right: 15px;
}

/* Style for minimize and close buttons */
#chatbox-controls button {
    background-color: transparent;
    color: white;
    border: none;
    box-shadow: none; 
    outline: none; 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0;
    padding: 0;
    width: 20px;
    height: 20px; 
    line-height: 16px; 
    overflow: hidden;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    font-family: Arial, sans-serif;
}

/* Styles for the chatbox header */
#chatbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #632289;
    color: white;
    padding: 15px 20px; 
    font-family: Arial, sans-serif; 
    font-size: 20px !important; 
    box-shadow: 0 2px 4px 0 rgba(0,0,0,0.2);
    font-weight: 600;
    justify-content: start !important;
    letter-spacing: 1px;
    line-height: 0;
    min-height: 70px;
    max-height: 70px;
}

.modal {
    display: none; 
    position: fixed; 
    left: 0;
    right: 0;
    top: 80px;
    z-index: 9999;
    bottom: 20px; 
    justify-content: center; 
    align-items: center; 
}

.modal.active {
    display: flex; /* Flex display to enable centering with justify-content and align-items */
}

.modal-content {
    background-color: #fefefe;
    padding: 15px;
    border: 1px solid #888;
    max-width: 90%; 
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    justify-content: center; 
    align-items: center; 
}

#exit-confirmation-modal button {
    width: auto; 
    height: 40px; 
    padding: 5px 15px; 
    margin: 0 5px; 
    border: none !important; 
    background: none !important; 
    text-align: center;
    display: inline-block; 
    vertical-align: middle;
    line-height: 40px; 
    cursor: pointer;
    outline: none !important; 
    box-shadow: none !important; 
    color: #000; 
    font-weight: bold; 
}

/* Ensure the buttons have the same width */
#exit-confirmation-modal button#confirm-exit,
#exit-confirmation-modal button#cancel-exit {
    min-width: 100px; 
}

/* Logic for typing idicator */
#typing-indicator {
    width: 100%; 
    height: 50px; 
    margin-bottom: 10px; 
}

/* Style for the chat messages container to hide the scrollbar */
#chat-messages {
    overflow-y: scroll;
}

/* Hide scrollbar for Chrome, Safari, and Opera */
#chat-messages::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge, and Firefox */
#chat-messages {
    -ms-overflow-style: none; 
    scrollbar-width: none; 
}

/* Image styling */
.va-image {
    width: 75px; /* Adjust width as necessary */
    height: 75px; 
    border-radius: 50px; 
    border: 2px solid #000; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); 
    margin-bottom: 8px;
    vertical-align: top;
}

.va-header-image {
    width: 40px;
    height: 40px;
    margin-right: 10px;
}

.va-top-info {
    text-align: center;
    padding-top: 10px; 
    border-radius: 75px;
} 

/* VA name styling */
.va-name {
    font-weight: bold;
    font-size: 20px !important; 
    color: #333; 
    margin-bottom: 4px; 
}

/* VA description styling */
.va-description {
    font-size: 16px !important;
    line-height: 1.5;
    color: #666; 
    margin-bottom: 12px; 
}

/* Separator Line */
.va-info-separator {
    width: 80%; 
    margin: 0 auto 10px;
    border-top: 1px solid #ccc;
}

/* VA Info Section */
.va-info-section {
    text-align: center;
    padding: 5px;
    text-rendering: auto;
    letter-spacing: 1px;
} 

.va-image, .va-header-image {
    border-radius: 50px !important;
}

#powered-by {
    position: absolute;
    bottom: 3px; 
    width: 100%;
    text-align: center;
    font-size: 15px  !important; 
    color: #999;
    line-height: 28px !important;
    letter-spacing: 0.5px !important;
}

#powered-by a {
    color: #632289; 
    text-decoration: none;
}

#powered-by a:hover {
    text-decoration: underline;
}

.chat-timestamp-user {
    position: absolute; 
    left: -15px;
    transform: translateX(-100%); 
    white-space: nowrap; 
    display: block;
    opacity: 0;
    color: #333; 
    transition: all 0.2s ease; 
}

.chat-message:hover .chat-timestamp-user {
    opacity: 1;
}

.chat-timestamp-assistant {
    position: absolute; 
    right: -15px;
    transform: translateX(100%); 
    white-space: nowrap; 
    display: block;
    opacity: 0;
    color: #333; 
    transition: all 0.2s ease; 
}

.chat-message.assistant-message:hover .chat-timestamp-assistant {
    opacity: 1; 
}

.chat-timestamp-assistant, .chat-timestamp-user {
    font-size: 12px;
}

.typing-indicator {
    max-width: 75%; 
    position: relative; 
    left: 0; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    align-self: flex-start;
    margin-top: 0;
    margin-bottom: 0;
}

#typing-animation {
    width: 85%; 
    height: 100%;
}

@keyframes fadeInZoom {
    from {
        opacity: 0;
        transform: scale(0.85); 
    }
    to {
        opacity: 1;
        transform: scale(1); 
    }
}

.chat-message.fade-in {
    animation: fadeInZoom 0.3s ease-out forwards; 
}

/* Laptops */
@media (min-width: 1024px) and (max-width: 1440px) {
    html {
        font-size: 15px !important; 
    }
    #AI24AI-chatbot-container {
        /* Adjust the size of the chatbox for laptops */
        width: 350px; 
        height: 600px; 
        bottom: 80px; 
        right: 20px; 
    }

    #AI24AI-chatbot-toggle {
        /* Adjust the position of the toggle widget for laptops */
        bottom: 10px; 
        right: 10px; 
    }
}

/* Then you can use media queries to adjust the base font size for different screen widths */
@media (max-width: 768px) {
    html {
        font-size: 14px; 
    }
    #AI24AI-chatbot-container {
        width: calc(100% - 30px); 
        height: calc(100% - 30px); 
    }
}

@media (max-width: 520px) {
    html {
        font-size: 16px; 
    }

    body, html {
        margin: 0;
        padding: 0;
    }
    
    #AI24AI-chatbot-container {
        width: calc(100% - 20px); 
        height: calc(100% - 20px); 
        max-width: none; 
        max-height: none; 
        bottom: 10px; 
        right: 10px; 
        top: 10px; 
        left: 10px;
        z-index: 1000;
    }

    #chatbox-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px;
        justify-content: start !important;
    }

    #AI24AI-chatbot-toggle.hide-toggle {
        animation: fadeOut 0.5s ease forwards; /* Fade out animation on class addition */
        pointer-events: none;
    }

    #AI24AI-chatbot-toggle.toggle-visible {
        opacity: 1; /* Fully visible */
        transition: opacity 0.5s ease; 
    }
}

/* CSS class to hide elements */
.hide-element {
    display: none !important;
}



/* Styling for MD in the messages container */
/* Adjust the list styles for better alignment */
#AI24AI-chatbot-container ol {
    padding-left: 20px; /* Adjust the padding as needed */
    margin: 0 0 10px 0; /* Remove extra margins and add margin bottom for even spacing */
}

#AI24AI-chatbot-container ol li {
    list-style-position: outside; /* Ensure the numbers are inside the padding */
    margin-bottom: 10px; /* Increase the margin between items */
    padding-left: 0px; /* Adjust the padding to reduce the gap between number and text */
}

/* Ensure even spacing between lists and paragraphs */
#AI24AI-chatbot-container p {
    margin-top: 2px;
    margin-bottom: 2px; /* Ensure even spacing */
}

/* Ensure even spacing between lists and paragraphs */
#AI24AI-chatbot-container ol {
    margin-top: 10px;
    margin-bottom: 10px; /* Ensure even spacing */
}

/* Reduce the gap/extra padding at the bottom of the chat */
#AI24AI-chatbot-container .chat-widget {
    padding-bottom: 5px; /* Adjust the value to reduce bottom padding */
}

/* Additional styling to fix the padding and margins within the chat */
#AI24AI-chatbot-container .chat-message {
    padding: 10px 15px; /* Adjust the padding for chat messages */
    margin-bottom: 5px; /* Reduce the margin between chat messages */
}

#AI24AI-chatbot-container .chat-response {
    padding: 10px 15px; /* Adjust the padding for chat responses */
    margin-bottom: 5px; /* Reduce the margin between chat responses */
}

/* Adjust white-space property */
#AI24AI-chatbot-container .chat-message .message-content {
    white-space: normal; /* Change white-space to normal */
}

#AI24AI-chatbot-container ul {
    padding-left: 5px !important;
}

#AI24AI-chatbot-container ul li {
    list-style-position: inside;
}