jQuery(document).ready(function($) {
    // Add badges to Elementor Forms
    $('.elementor-form').each(function() {
        var formContainer = $(this);
        var formId = formContainer.attr('id') || 'elementor_form_' + Math.random();
        
        // Check if this form is protected
        var isProtected = false;
        if (typeof formshieldElementorData !== 'undefined' && formshieldElementorData.protectedForms) {
            isProtected = formshieldElementorData.protectedForms.indexOf(formId) !== -1;
        }
        
        if (isProtected) {
            // Add badge after the form
            var badgeHtml = formshieldElementorData.badge;
            if (badgeHtml) {
                formContainer.after(badgeHtml);
            }
        }
    });
});
