/* Chat Widget Container */
#ai-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 550px;
    /* Increased height for buttons */
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    display: none;
    /* Hidden by default */
    flex-direction: column;
    z-index: 99999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

/* Header */
#ai-chatbot-header {
    background-color: #0073aa;
    /* WP Blue */
    color: #ffffff;
    padding: 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#ai-chatbot-close {
    cursor: pointer;
    font-size: 20px;
}

/* Quick Actions Bar */
#ai-chatbot-actions {
    display: flex;
    justify-content: space-around;
    padding: 10px;
    background-color: #f1f1f1;
    border-bottom: 1px solid #ddd;
}

.ai-chatbot-action-btn {
    background: none;
    border: 1px solid #aaa;
    border-radius: 20px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ai-chatbot-action-btn:hover {
    background-color: #e0e0e0;
}

/* Messages Area */
#ai-chatbot-messages {
    height: calc(100% - 190px);
    /* Adjusted for action bar */
    padding: 15px;
    overflow-y: auto;
    background-color: #f9f9f9;
}

.ai-chatbot-message {
    margin-bottom: 10px;
    padding: 10px 15px;
    border-radius: 8px;
    max-width: 80%;
    line-height: 1.4;
    font-size: 14px;
    word-wrap: break-word;
}

.ai-chatbot-message.bot {
    background-color: #e0e0e0;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 0;
}

.ai-chatbot-message.user {
    background-color: #0073aa;
    color: #ffffff;
    margin-left: auto;
    border-bottom-right-radius: 0;
}

.ai-chatbot-message.error {
    background-color: #ffdddd;
    color: #a00000;
}

.ai-chatbot-message.typing {
    background-color: transparent;
    color: #999;
    font-style: italic;
    padding: 5px;
}

/* Input Area */
#ai-chatbot-input-area {
    padding: 15px;
    border-top: 1px solid #eee;
    background-color: #fff;
    display: flex;
    gap: 10px;
}

#ai-chatbot-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
}

#ai-chatbot-send {
    padding: 10px 15px;
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

#ai-chatbot-send:hover {
    background-color: #005177;
}

#ai-chatbot-send:disabled {
    background-color: #ccc;
    cursor: default;
}

/* Toggle Button */
#ai-chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #0073aa;
    color: #ffffff;
    padding: 15px 25px;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 99998;
    font-weight: bold;
    display: block;
    /* Visible by default */
}

#ai-chatbot-toggle:hover {
    background-color: #005177;
}

/* FAQ Modal/Overlay */
#ai-chatbot-faq-overlay {
    position: absolute;
    top: 50px;
    /* Below header */
    left: 0;
    width: 100%;
    height: calc(100% - 110px);
    /* Above input, below header */
    background: white;
    z-index: 5;
    padding: 20px;
    box-sizing: border-box;
    display: none;
    overflow-y: auto;
}

.ai-chatbot-faq-item {
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.ai-chatbot-faq-q {
    font-weight: bold;
    cursor: pointer;
    color: #0073aa;
    margin-bottom: 5px;
}

.ai-chatbot-faq-a {
    font-size: 14px;
    color: #555;
    display: none;
}

/* Responsive */
@media (max-width: 480px) {
    #ai-chatbot-container {
        width: 90%;
        bottom: 10px;
        right: 5%;
        height: 80vh;
    }
}