/* Chatbot CSS */

.chat-container {
    position: fixed;
    bottom: 10px;
    right: 0;
    width: 350px;
    margin-bottom: 20px;
    margin-right: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 2px 2px 8px 4px rgba(0, 0, 0, 0.1);
    z-index: 9999; /* Ensure the chatbox appears on top of other content */
    display: none; /* Hide chatbot container by default */
}
/* Media query for mobile devices */
@media (max-width: 767px) {
    .chat-container {
        width: calc(100% - 40px); /* Adjust width to fit the screen width */
        margin-left: 20px; /* Add margin to maintain space from left edge */
        margin-right: 20px; /* Add margin to maintain space from right edge */
        left: 0; /* Reset left positioning */
        transform: none; /* Remove any previous transform */
    }
}

.chat-title {
    background-color: #8a2be2; /* Purple color */
    color: #fff; /* White text color */
    padding: 10px;
    text-align: center;
    font-size: 18px; /* Adjust font size as needed */
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    font-family: 'Open Sans', sans-serif; /* Add Open Sans font */
}



.chat-box {
    height: 300px;
    padding: 10px;
    overflow-y: auto;
    background-color: whitesmoke; /* Set background color of chatbox */
}

.message {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
    font-family: 'Open Sans', sans-serif; /* Add Open Sans font */
    background-color: white;
    border-radius: 4px; /* Add border-radius for rounded corners */
    padding: 10px; /* Add padding to increase space inside the message container */
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1); /* Add box shadow for a modern border effect */
}

.message-text pre {
    font-family: 'Open Sans', sans-serif; /* Use Open Sans font */
    font-size:15px;
    white-space: pre-wrap; /* Preserve whitespace but wrap long lines */
    margin: 0; /* Remove default margins from pre tag */
}


.avatar {
    background-color: #ccc;
    color: #fff;
    width: 40px; /* Fixed width */
    height: 40px; /* Fixed height */
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    margin-right: 10px;
    font-family: 'Open Sans', sans-serif; /* Add Open Sans font */

}



.assistant-message .avatar {
    background-color: #8a2be2;
    font-family: 'Open Sans', sans-serif; /* Add Open Sans font */

}

.user-message .avatar {
    background-color: #999;
    font-family: 'Open Sans', sans-serif; /* Add Open Sans font */

}


.message-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex-grow: 1;
    max-width: calc(100% - 50px); /* Adjust the width as needed */
    word-wrap: break-word; /* Allow long words to wrap */
    overflow-wrap: break-word; /* Ensure words break at appropriate points */
    font-size:15px;
}


.message-title {
    font-weight: bold;
}

.message-text {
    margin-top: 5px;
    max-width: 100%; /* Ensure the message text doesn't overflow */
}


.input-container {
    display: flex;
    padding: 10px;
    background-color: whitesmoke;
}

#messageInput {
    flex: 1;
    margin-right: 10px;
    display: flex;
    padding: 15px; /* Increase padding for a bigger input container */
    background-color: white; /* Light gray background color for a modern look */
    border-radius: 20px; /* Add rounded corners */
    font-family: 'Open Sans', sans-serif; /* Add Open Sans font */

}

#sendButton {
    background-color: #8a2be2;
    color: #fff;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    border-radius: 20px; /* Adjust the border radius to make the button more rounded */
    font-family: 'Open Sans', sans-serif; /* Add Open Sans font */

}
.user-message .avatar,
.assistant-message .avatar {
    width: 45px; /* Fixed width */
    height: 40px; /* Fixed height */
}

   /* Custom styles for the powered by text */
   .powered-by-text {
    font-size: 15px;
    background-color: whitesmoke;
    color: #888;
    text-align: center;
    font-family: 'Open Sans', sans-serif; /* Add Open Sans font */
    padding: 4px;

}

.chat-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #8a2be2;
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    text-align: center;
    animation: fadeIn 1s forwards, pulse 2s infinite 1s; /* Chain fade-in and pulse animations */
    font-size: 24px;
    font-family: 'Open Sans', sans-serif;
    align-content:center;
    
}

.chat-icon i {
    position: relative;
    top: 1px; /* Adjust vertically */
    left: 1px; /* Adjust horizontally */
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}



.chat-visible {
    display: block !important;
}

.close-button {
    position: absolute;
    top: -7px;
    right: 10px;
    cursor: pointer;
    color: #fff; /* White color for the X */
    font-size: 44px;
    padding: 5px;
    z-index: 999; /* Ensure the close button is on top of other content */
}

.fade-in {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-out {
    opacity: 1;
    animation: fadeOut 0.5s ease forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes typingDots {
    0% {
        content: "";
    }
    25% {
        content: ".";
    }
    50% {
        content: "..";
    }
    75% {
        content: "...";
    }
}

/* Apply the typingDots animation to the loading message container */
.loading-message:after {
    content: "";
    animation: typingDots 1s infinite; /* Apply the typingDots animation */
    display: inline-block;
    vertical-align: middle;
}

.faq-container {
    display: flex;
    flex-direction: column;
    padding: 10px;
    background-color: whitesmoke;
    border-top: 1px solid #ccc;
}

.faq-button {
    background-color: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px;
    margin-bottom: 5px;
    cursor: pointer;
    text-align: center;
    font-family: 'Open Sans', sans-serif;
    font-size: 13px;
    transition: background-color 0.3s, transform 0.3s;
    animation: slideIn 0.5s ease;
    max-width: 90%;  /* Adjust the width to fit nicely */
    margin: 5px auto;  /* Center the buttons */
}

.faq-button:hover {
    background-color: #e7e7e7;
    transform: translateY(-2px);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}