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