/* assets/css/components/chatbot.css */
#mmi-chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Montserrat', 'Segoe UI', Tahoma, sans-serif;
}

#mmi-chatbot-toggle {
    width: 60px;
    height: 60px;
    background: #1D589C;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#mmi-chatbot-toggle:hover {
    transform: scale(1.1);
    background: #16467c;
}

#mmi-chatbot-toggle i {
    color: white;
    font-size: 28px;
}

#mmi-chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    display: none;
    /* Hidden by default */
    flex-direction: column;
    /* Strict Column Layout */
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
    border: 1px solid #e0e0e0;
}

#mmi-chatbot-window.is-open {
    display: flex !important;
    /* Force flex to maintain footer layout */
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-header {
    flex: 0 0 auto;
    /* Fixed header */
    background: #1D589C;
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header h4 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
}

.chatbot-close {
    cursor: pointer;
    font-size: 1.2em;
    opacity: 0.8;
}

.chatbot-close:hover {
    opacity: 1;
}

.chatbot-messages {
    flex: 1 1 auto;
    min-height: 0;
    padding: 15px;
    overflow-y: auto !important;
    /* Force native auto scroll */
    background: #f9f9f9;
    /* Use block display for reliable scrolling */
    display: block;
    position: relative;
    scrollbar-width: thin;
    /* Firefox thin scrollbar if supported */
}

.message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.9em;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
    margin-bottom: 15px;
    /* Replaces gap */
    clear: both;
    /* Ensure stacking */
}

.message.bot {
    float: left;
    /* Align left */
    background: #fff;
    border: 1px solid #eee;
    color: #444;
    border-bottom-left-radius: 2px;
}

.message.user {
    float: right;
    /* Align right */
    background: #1D589C;
    color: white;
    border-bottom-right-radius: 2px;
    text-align: right;
}

/* Footer Section (Quick Actions + Input) */
.chatbot-footer {
    flex: 0 0 auto;
    /* Fixed bottom */
    background: #fff;
    border-top: 1px solid #eee;
    z-index: 10;
}

.chatbot-quick-actions {
    padding: 10px 15px 5px 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.action-btn {
    background: #f0f7ff;
    border: 1px solid transparent;
    color: #1D589C;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.action-btn:hover {
    background: #1D589C;
    color: #fff;
    transform: translateY(-1px);
}

.action-btn i {
    margin-right: 5px;
}

.chatbot-input-area {
    padding: 10px 15px 15px 15px;
    display: flex;
    gap: 10px;
}

.chatbot-input-area input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 15px;
    outline: none;
    transition: border 0.2s;
    font-size: 0.9em;
}

.chatbot-input-area input:focus {
    border-color: #1D589C;
}

.chatbot-send {
    background: #1D589C;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.chatbot-send:hover {
    background: #16467c;
}

.chatbot-mic {
    background: #fff;
    color: #555;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chatbot-mic:hover {
    background: #f5f5f5;
    color: #333;
}

.chatbot-mic.pulsing {
    background: #ffebee;
    color: #F44336 !important;
    border-color: #F44336;
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.4);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(244, 67, 54, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0);
    }
}


.chatbot-context-indicator {
    font-size: 0.75em;
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 4px;
    display: inline-block;
}