/* Main container for the floating elements */
#lucky-chatbot-embed {
    font-family: 'Segoe UI', sans-serif;
}

/* The Floating Action Button (FAB) */
#chatbot-fab {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background-color: #1a6919;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 9998;
    transition: transform 0.2s ease-in-out;
}

#chatbot-fab:hover {
    transform: scale(1.1);
}

#chatbot-fab img {
    width: 32px;
    height: 32px;
    filter: brightness(0) invert(1); /* Makes the icon white */
}

/* The Chat Container (Popup) */
#chat-container {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 90%;
    max-width: 400px;
    height: 70vh;
    max-height: 600px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    
    /* Animation */
    transform-origin: bottom right;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

/* State when chat is closed */
#chat-container.chatbot-closed {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

/* State when chat is open */
#chat-container.chatbot-open {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* Chat Header */
#chat-header {
    background-color: #e9eeeb;
    color: rgb(12, 71, 28);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    font-size: 16px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.header-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

#chatbot-close-btn {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 28px;
    color: #555;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
}

/* Chat Area */
#chat {
    padding: 15px;
    flex-grow: 1;
    overflow-y: auto;
}

.message { margin-bottom: 15px; display: flex; align-items: flex-start; flex-wrap: wrap; }
.message.bot { justify-content: flex-start; }
.message.user { justify-content: flex-end; }
.bubble { max-width: 90%; padding: 12px 15px; border-radius: 15px; font-size: 14px; line-height: 1.4; word-wrap: break-word; }
.bot .bubble { background-color: #f1f0f0; color: #333; border-top-left-radius: 0; }
.user .bubble { background-color: #1a6919; color: #fff; border-top-right-radius: 0; }
.bot-icon { width: 30px; height: 30px; margin-right: 10px; border-radius: 50%; object-fit: cover; }
.bot .bubble-link { color: #37ab0d; text-decoration: underline; word-break: break-word; }

/* Input Section */
#input-section { padding: 10px 15px; border-top: 1px solid #eee; display: flex; gap: 10px; flex-wrap: wrap; flex-shrink: 0; }
#userInput { flex: 1; padding: 10px; border-radius: 10px; border: 1px solid #ccc; font-size: 14px; }
#input-section button { padding: 10px 16px; border: none; border-radius: 10px; background-color: #1a6919; color: white; cursor: pointer; font-size: 14px; white-space: nowrap; }
button.option-btn { background-color: #d8f3dc; color: #1a6919; margin: 4px 4px 0 0; border-radius: 8px; padding: 8px 12px; font-size: 13px; border: 1px solid #a3d9a5; flex-shrink: 0; word-wrap: break-word; white-space: normal; }
button.option-btn:hover { background-color: #c0ebc5; }
.message.bot.buttons-inline { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 5px; }
.message.bot.buttons-inline .option-btn { white-space: nowrap; }

/* Mobile Responsive */
@media (max-width: 600px) {
    #chat-container {
        left: 5px;
        right: 5px;
        bottom: 85px;
        width: auto;
        max-width: none;
    }
    #chatbot-fab {
        bottom: 15px;
        right: 15px;
    }
}