(function($) {
    function resetColorsToDefault() {
        // Define default values for your color settings
        const defaultColors = {
            'background_color': '#ffffff',
            'fitness_life_coach_primary_color': '#fc3c2a',
            'fitness_life_coach_second_color': '#fd7669',
            'fitness_life_coach_heading_color': '#000',
            'fitness_life_coach_text_color' :'#8a8a8a',
            'fitness_life_coach_primary_fade': '#ffe7e5',
            'fitness_life_coach_footer_bg': '#000',
            'fitness_insight_post_bg': '#ffffff',
        };

        // Iterate over each setting and set it to its default value
        for (let settingId in defaultColors) {
            wp.customize(settingId).set(defaultColors[settingId]);
        }

        // Optionally refresh the preview
        wp.customize.previewer.refresh();
    }

    // Attach reset function to global scope
    window.resetColorsToDefault = resetColorsToDefault;

    $(document).ready(function() {
        $('.color-reset-btn').val('RESET'); // This adds the 'RESET' text inside the button
    });
})(jQuery);