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