jQuery(document).ready(function($) {
    // Initialize WPForms Badge
    $('.wpforms-form').each(function() {
        var formContainer = $(this);
        var formId = formContainer.attr('id') || 'wpforms_form_' + Math.random();
        
        // Check if this form is protected
        var isProtected = false;
        if (typeof formshieldWPFormsData !== 'undefined' && formshieldWPFormsData.protectedForms) {
            isProtected = formshieldWPFormsData.protectedForms.indexOf(formId) !== -1;
        }
        
        if (isProtected) {
            // Add badge after the form
            var badgeHtml = formshieldWPFormsData.badge;
            if (badgeHtml) {
                formContainer.after(badgeHtml);
            }
        }
    });
});
