/* ==========================================
   MPT - AGO AI CHATBOT
   Complete Custom CSS
========================================== */


/* ==========================================
   1. FLOATING ENGINEER BUTTON - DESKTOP
========================================== */

#ago-ai-widget .ago-ai-toggle {
    position: fixed !important;

    right: 25px !important;
    bottom: 25px !important;
    left: auto !important;
    top: auto !important;

    width: 120px !important;
    height: 145px !important;

    min-width: 120px !important;
    min-height: 145px !important;

    padding: 0 !important;
    margin: 0 !important;

    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;

    box-shadow: none !important;
    overflow: visible !important;

    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;

    cursor: pointer !important;
    z-index: 999999 !important;

    transition: transform 0.3s ease !important;
}


/* ==========================================
   2. REMOVE ORIGINAL CIRCLE
========================================== */

#ago-ai-widget .ago-ai-toggle::before,
#ago-ai-widget .ago-ai-toggle::after {
    content: none !important;
    display: none !important;
}


/* ==========================================
   3. ENGINEER IMAGE WITH MPT OUTLINE
========================================== */

#ago-ai-widget .ago-ai-toggle .mpt-chatbot-icon {
    width: 100% !important;
    height: 100% !important;

    max-width: none !important;
    max-height: none !important;

    object-fit: contain !important;
    object-position: center bottom !important;

    border: none !important;
    border-radius: 0 !important;

    background: transparent !important;
    box-shadow: none !important;

    /*filter:*/
    /*    drop-shadow(2px 0 0 #005C8B)*/
    /*    drop-shadow(-2px 0 0 #005C8B)*/
    /*    drop-shadow(0 2px 0 white)*/
    /*    drop-shadow(0 -2px 0 white)*/
    /*    drop-shadow(0 5px 8px rgba(0, 92, 139, 0.3))*/
    /*    !important;*/

    pointer-events: none !important;
    display: block !important;
}


/* ==========================================
   4. HOVER EFFECT
========================================== */

@media (hover: hover) {
    #ago-ai-widget .ago-ai-toggle:hover {
        transform: translateY(-5px) !important;
    }
}


/* ==========================================
   5. MOBILE - ENGINEER BUTTON
========================================== */

@media (max-width: 768px) {

    #ago-ai-widget .ago-ai-toggle {
        position: fixed !important;

        right: 15px !important;
        bottom: 20px !important;

        left: auto !important;
        top: auto !important;

        width: 95px !important;
        height: 115px !important;

        min-width: 95px !important;
        min-height: 115px !important;

        z-index: 999999 !important;
    }

}


/* ==========================================
   6. MOBILE - CHAT WINDOW FIX
========================================== */

@media (max-width: 768px) {

    #ago-ai-widget .ago-ai-window.ago-offset-1 {
        position: fixed !important;

        /* Position above the engineer */
        bottom: 145px !important;
        top: auto !important;

        /* Keep window inside the screen */
        max-height: calc(100vh - 165px) !important;
        max-height: calc(100dvh - 165px) !important;

        /* Restrict maximum window height */
        height: min(480px, calc(100vh - 165px)) !important;
        height: min(480px, calc(100dvh - 165px)) !important;

        /* Responsive width */
        width: min(370px, calc(100vw - 20px)) !important;
        max-width: calc(100vw - 20px) !important;

        right: 10px !important;
        left: auto !important;

        overflow: hidden !important;

        /* Do not force display here.
           The plugin controls open/close. */
    }


    /* ======================================
       7. CHAT MESSAGES - SCROLLABLE
    ====================================== */

    #ago-ai-widget .ago-ai-messages {
        flex: 1 1 auto !important;

        min-height: 0 !important;

        overflow-y: auto !important;
        overflow-x: hidden !important;

        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }


    /* ======================================
       8. KEEP HEADER VISIBLE
    ====================================== */

    #ago-ai-widget .ago-ai-header {
        flex-shrink: 0 !important;
    }


    /* ======================================
       9. KEEP INPUT VISIBLE
    ====================================== */

    #ago-ai-widget .ago-ai-input-area {
        flex-shrink: 0 !important;
    }

}


/* ==========================================
   10. SMALL MOBILE SCREENS
========================================== */

@media (max-width: 390px) {

    #ago-ai-widget .ago-ai-toggle {
        right: 10px !important;
        bottom: 15px !important;

        width: 85px !important;
        height: 105px !important;

        min-width: 85px !important;
        min-height: 105px !important;
    }

    #ago-ai-widget .ago-ai-window.ago-offset-1 {
        bottom: 130px !important;

        height: min(
            450px,
            calc(100dvh - 150px)
        ) !important;

        max-height: calc(
            100dvh - 150px
        ) !important;
    }

}