:root {
    --chatbot-theme-color: #2860AD;
}

/* Reset styles for chatbot elements */
#chatbot-container,
#chatbot-container * {
    all: unset; /* Reset all inherited styles */
    box-sizing: border-box;
}

/* Chatbot Container */
#chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    max-width: 460px;
    max-height: 400px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    font-family: Arial, sans-serif;
    z-index: 9999;
    display: none; /* Initially hidden */
    flex-direction: column;
    background-color: #ffffff;
    transition: all 0.3s ease-in-out;
}

#chatbot-container.open {
    display: flex; /* Show chatbot when open */
}

#chatbot-container.minimized {
    height: 60px; /* Minimized state */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Chatbot Header */
#chatbot-container #chatbot-header {
    background-color: var(--chatbot-theme-color);
    color: #ffffff;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 10px 10px 0 0;
}

#chatbot-header .header-title {
    margin: 11px 5px;
}

#chatbot-header .control-buttons {
    display: flex;
    gap: 1px;
}
#chatbot-header .control-buttons .minimize-btn {
    color: #ffffff;
}
#chatbot-header .control-buttons button {
    border: 0px;
    font-weight: bold;
    background: none;
    padding: 12px;
    margin: 0 5px;
    color: #ffffff;
}
#chatbot-header .control-buttons button:focus {
    outline: none;
    background-color: inherit;
    color: inherit;
}
#chatbot-header .control-btn {
    background-color: transparent;
    color: #ffffff;
    border: none;
    font-size: 14px;
    cursor: pointer;
}

#chatbot-header .control-btn:hover {
    color: #dddddd;
}
/* Chabot Footer */
#chatbot-footer {
    font-size: 11px;
    padding: 8px 10px;
    text-align: right;
}
/* Chatbot Window */
#chatbot-window {
    flex: 1;
    padding: 10px;
    overflow: hidden; /* Ensures proper container behavior */
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
}

/* Chatbot Messages */
#chatbot-messages {
    overflow-y: auto; /* Enables vertical scrolling */
    max-height: 100%; /* Ensures it respects the parent container */
    flex-grow: 1; /* Allows it to expand within the window */
    padding-right: 10px; /* Space for scrollbar */
}

/* User Message */
#chatbot-window .user-message {
    align-self: flex-end;
    background-color: #e1f5c4;
    color: #333333;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 14px;
    margin: 5px 0;
    display: flex;
}

/* Bot Message */
#chatbot-window .bot-message {
    align-self: flex-start;
    background-color: #f0f0f0;
    color: #333333;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 14px;
    margin: 5px 0;
    display: flex; /* Ensure proper alignment */
    flex-direction: row; /* Inline bot name and message */
    gap: 5px; /* Space between bot name and message */
}

/* Bot Name */
#chatbot-window .bot-message .bot-name {
    font-size: 12px; /* Smaller font size for bot name */
    font-weight: bold;
    color: var(--chatbot-theme-color);
    display: contents;
}

/* Chat Input */
#chatbot-input-container {
    display: flex;
    align-items: center;
    border-top: 1px solid #ddd;
    padding: 5px;
    background-color: #ffffff;
    border-radius: 0 0 10px 10px;
}

#chatbot-input-container input[type="text"] {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    font-size: 14px;
    outline: none;
}

#chatbot-input-container input[type="text"]:focus {
    border-color: var(--chatbot-theme-color);
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
}

#chatbot-input-container button {
    background-color: var(--chatbot-theme-color);
    color: #ffffff;
    border: none;
    padding: 10px 15px;
    margin-left: 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
}

#chatbot-input-container button:hover {
    background-color: #c36;
}

/* Scrollbar Styling */
#chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

#chatbot-messages::-webkit-scrollbar-thumb {
    background-color: var(--chatbot-theme-color);
    border-radius: 5px;
}

#chatbot-messages::-webkit-scrollbar-track {
    background-color: #f0f0f0;
}

/* Close Button */
#chatbot-header .close-btn {
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    color: #ffffff;
    background: none;
    border: none;
}

#chatbot-header .close-btn:hover {
    color: #dddddd;
}

/* Responsive Design */
@media (max-width: 600px) {
    #chatbot-container {
        width: 90%; /* Adjust width for smaller screens */
        bottom: 10px; /* Reduce bottom margin */
        right: 5%; /* Center horizontally */
    }

    #chatbot-window {
        max-height: 200px; /* Adjust height for smaller screens */
    }
}
.loading-indicator {
    display: flex;
    align-items: center;
    font-style: italic;
    color: #888;
}

.loading-indicator::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-left: 5px;
    border-radius: 50%;
    background-color: #888;
    animation: loadingDots 1s infinite alternate;
}

@keyframes loadingDots {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-5px);
    }
}