/**
 * Chatbot Button Mobile Navbar Fix
 * Prevents chatbot button from overlapping mobile bottom navbar
 * 
 * CRITICAL: Uses high specificity selectors to override n8n default styles
 */

/* Fix chatbot button position on mobile to avoid navbar overlap */
@media (max-width: 991px) {

    /* High specificity selector for n8n chatbot bubble button */
    button.n8n-chat-ui-bot-bubble.fixed,
    button.n8n-chat-ui-bot-bubble,
    .n8n-chat-ui-bot-bubble.fixed,
    .n8n-chat-ui-bot-bubble,
    button[class*="n8n-chat"][class*="bubble"].fixed,
    button[class*="n8n-chat"][class*="bubble"] {
        bottom: 80px !important;
        z-index: 999 !important;
    }

    /* n8n chat window */
    .n8n-chat-ui-bot-container,
    div[class*="n8n-chat"][class*="container"] {
        bottom: 80px !important;
        max-height: calc(100vh - 160px) !important;
    }
}

/* Smaller screens - adjust further */
@media (max-width: 575px) {

    button.n8n-chat-ui-bot-bubble.fixed,
    button.n8n-chat-ui-bot-bubble,
    .n8n-chat-ui-bot-bubble.fixed,
    .n8n-chat-ui-bot-bubble,
    button[class*="n8n-chat"][class*="bubble"].fixed,
    button[class*="n8n-chat"][class*="bubble"] {
        bottom: 70px !important;
    }

    .n8n-chat-ui-bot-container,
    div[class*="n8n-chat"][class*="container"] {
        bottom: 70px !important;
        max-height: calc(100vh - 140px) !important;
    }
}

/* Very small screens */
@media (max-width: 360px) {

    button.n8n-chat-ui-bot-bubble.fixed,
    button.n8n-chat-ui-bot-bubble,
    .n8n-chat-ui-bot-bubble.fixed,
    .n8n-chat-ui-bot-bubble,
    button[class*="n8n-chat"][class*="bubble"].fixed,
    button[class*="n8n-chat"][class*="bubble"] {
        bottom: 65px !important;
    }

    .n8n-chat-ui-bot-container,
    div[class*="n8n-chat"][class*="container"] {
        bottom: 65px !important;
        max-height: calc(100vh - 130px) !important;
    }
}

/* Additional fallback with even higher specificity */
@media (max-width: 991px) {
    body button.n8n-chat-ui-bot-bubble[class*="fixed"] {
        bottom: 80px !important;
        z-index: 999 !important;
    }
}

@media (max-width: 575px) {
    body button.n8n-chat-ui-bot-bubble[class*="fixed"] {
        bottom: 70px !important;
    }
}

@media (max-width: 360px) {
    body button.n8n-chat-ui-bot-bubble[class*="fixed"] {
        bottom: 65px !important;
    }
}