/* --- Root Variables for Easy Customization --- */
:root {
    --primary-color: #007bff; /* Main brand color for Animweb */
    --secondary-color: #f0f2f5; /* Background for chat messages area */
    --bot-message-color: #e9e9eb; /* Bot message bubble color */
    --user-message-color: #007bff; /* User message bubble color */
    --font-color: #ffffff;
    --dark-font-color: #333333;
}

/* --- Chatbot Toggle Button --- */
#chatbot-toggle-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: var(--font-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    transition: transform 0.2s ease-in-out;
}

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

/* --- Chatbot Container --- */
#chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 350px;
    max-width: 90vw;
    height: 500px;
    max-height: 70vh;
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    transform-origin: bottom right;
}

#chatbot-container.hidden {
    opacity: 0;
    transform: scale(0.5);
    pointer-events: none;
}

/* --- Chatbot Header --- */
#chatbot-header {
    background-color: var(--primary-color);
    color: var(--font-color);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
}

#chatbot-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

#chatbot-close-btn {
    background: none;
    border: none;
    color: var(--font-color);
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* --- Messages Area --- */
#chatbot-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: var(--secondary-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    padding: 10px 15px;
    border-radius: 20px;
    max-width: 80%;
    line-height: 1.4;
    font-size: 0.95rem;
}

.chat-message a {
    color: #0056b3;
    font-weight: bold;
    text-decoration: underline;
}

.bot-message {
    background-color: var(--bot-message-color);
    color: var(--dark-font-color);
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.user-message {
    background-color: var(--user-message-color);
    color: var(--font-color);
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

/* --- Input Area --- */
#chatbot-input-area {
    display: flex;
    padding: 15px;
    border-top: 1px solid #ddd;
    background-color: #fff;
}

#chatbot-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 1rem;
    margin-right: 10px;
    outline: none;
}

#chatbot-input:focus {
    border-color: var(--primary-color);
}

#chatbot-send-btn {
    background-color: var(--primary-color);
    border: none;
    color: var(--font-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s;
}

#chatbot-send-btn:hover {
    background-color: #0056b3;
}