/* mg_chatbot.css */
:root {
    --primary: #2E7D32;
    --secondary: #81C784;
    --chat-bg: #ffffff;
    --border-color: #e5e7eb;
}

#mg-chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

#mg-chatbot-open-btn {
    width: 60px;
    height: 60px;
    background-color: var(--primary);
    border-radius: 50%;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}
#mg-chatbot-open-btn:hover {
    transform: scale(1.1);
}
#mg-chatbot-open-btn img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

#mg-chatbot-window {
    display: none;
    flex-direction: column;
    width: 400px;
    height: 65vh;
    min-height: 500px;
    max-height: 600px;
    background: var(--chat-bg);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
    position: absolute;
    bottom: 90px;
    right: 0;
}

.mg-chatbot-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.mg-chatbot-header h3 {
    margin: 0;
    font-size: 1.1em;
    color: #333;
    font-weight: 600;
}
#mg-chatbot-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.mg-chat-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
}

.mg-message { display: flex; gap: 15px; margin-bottom: 20px; max-width: 95%; }
.mg-user-message { flex-direction: row-reverse; margin-left: auto; }
.mg-avatar { width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mg-bot-avatar img { width: 100%; height: 100%; object-fit: contain; padding: 5px; border: 1px solid var(--border-color); border-radius: 8px; }
.mg-user-avatar { background: var(--primary); color: white; font-size: 20px; }
.mg-message-content { padding: 12px 16px; border-radius: 15px; line-height: 1.5; font-size: 15px; background-color: #f1f3f5; color: #333; border-radius: 15px 15px 15px 0; }
.mg-user-message .mg-message-content { background-color: var(--primary); color: white; border-radius: 15px 15px 0 15px; }
.mg-message-actions { display: flex; gap: 8px; margin-top: 10px; }
.mg-action-btn { cursor: pointer; color: #666; font-size: 14px; background: #e9ecef; border: none; border-radius: 50%; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; }
.mg-user-message .mg-action-btn { background-color: #2b6b2e; color: #cce2cf; }
.mg-action-btn:hover { color: var(--primary); }

.mg-footer-area { flex-shrink: 0; border-top: 1px solid var(--border-color); }
.mg-suggestions-container { padding: 12px; background: #fafafa; }
.mg-suggestions-title { font-size: 0.85em; color: #666; margin: 0 0 8px 4px; font-weight: 500; }
.mg-suggestions-grid { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.mg-suggestion-button { background: var(--secondary); color: white; border: none; padding: 10px 12px; border-radius: 20px; font-size: 0.8em; cursor: pointer; white-space: nowrap; }
.mg-input-container { padding: 15px 20px; display: flex; gap: 12px; align-items: flex-start; background: var(--chat-bg); }
#mg-userInput { flex: 1; padding: 12px 20px; border: 1px solid #ddd; border-radius: 25px; resize: none; min-height: 22px; max-height: 120px; line-height: 1.4; font-size: 16px; }
#mg-send-btn { background: var(--primary); color: white; width: 48px; height: 48px; border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.mg-spinner { width: 24px; height: 24px; border: 3px solid rgba(0, 0, 0, 0.1); border-top-color: var(--primary); border-radius: 50%; animation: mg-spin 1s linear infinite; }
@keyframes mg-spin { to { transform: rotate(360deg); } }

.mg-message-content p { margin: 0 0 10px; }
.mg-message-content p:last-child { margin-bottom: 0; }
.mg-message-content ul, .mg-message-content ol { padding-left: 20px; margin-bottom: 10px; }
.mg-message-content table { width: 100%; border-collapse: collapse; margin: 15px 0; }
.mg-message-content td, .mg-message-content th { padding: 8px 12px; border: 1px solid #d1e7d2; text-align: left; }
.mg-message-content th { background-color: #e8f5e9; }
