/* n8n Chatbot — Mobile Responsive */

@media (max-width: 480px) {
    /* Widget-Container: unsichtbar, aber overflow erlaubt für position:fixed Chat-Window */
    .n8n-chatbot-widget:not(.n8n-inline-mode) {
        position: static;
        width: 0;
        height: 0;
        overflow: visible;
    }

    /* Toggle-Ball: auf Mobile ausblenden — Chat wird über Menü-Button gestartet */
    .n8n-chatbot-toggle {
        display: none !important;
    }

    /* Chat-Window: Fullscreen-Overlay, dvh für Mobile-Tastatur */
    .n8n-chatbot-window {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: none !important;
        border-radius: 0;
        z-index: 100001;
    }

    .n8n-chatbot-window.n8n-form-active { height: 100% !important; }
    /* Toggle auf Mobile sichtbar lassen */
    .n8n-action-btn { padding: 10px 16px; font-size: 13px; }
    .n8n-consent-inner { max-width: 100%; }
    .n8n-consent-title { font-size: 16px; }
    .n8n-chatbot-fullscreen { display: none !important; }
    .n8n-contact-form { padding: 12px; gap: 10px; }
    .n8n-form-row { flex-direction: column; gap: 10px; }
    .n8n-form-actions { flex-direction: column; }
    .n8n-form-cancel { text-align: center; }

    .n8n-chatbot-window.n8n-fullscreen { transform: none; }

    .n8n-chatbot-window.n8n-fullscreen .n8n-chatbot-messages,
    .n8n-chatbot-window.n8n-fullscreen .n8n-chatbot-input-area,
    .n8n-chatbot-window.n8n-fullscreen .n8n-chatbot-header {
        padding-left: 16px;
        padding-right: 16px;
    }
}

@media (max-width: 360px) {
    .n8n-chatbot-header { padding: 12px 14px; font-size: 14px; }
    .n8n-chatbot-messages { padding: 12px; }
    .n8n-chatbot-input-area { padding: 10px; }
}

/* Mobile-FAB: "Chat fortsetzen" Button */
.n8n-mobile-fab {
    display: none;
}

@media (max-width: 480px) {
    .n8n-mobile-fab {
        display: none !important;  /* FAB auch ausblenden — Chat über Menü */
        align-items: center;
        gap: 8px;
        position: fixed;
        bottom: 16px;
        right: 16px;
        z-index: 99998;
        background: var(--n8n-primary, #CF081A);
        color: #fff;
        border: none;
        border-radius: 28px;
        padding: 12px 20px;
        font-family: var(--n8n-font-body, sans-serif);
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
    }

    .n8n-mobile-fab-visible {
        opacity: 1;
        transform: translateY(0);
    }

    .n8n-mobile-fab:active {
        background: var(--n8n-primary-hover, #ab0917);
        transform: scale(0.96);
    }

    .n8n-mobile-fab svg {
        flex-shrink: 0;
    }
}
