(function($) {
    function resetColorsToDefault() {
        // Define default values for your color settings
        const defaultColors = {
            'background_color': '#ffffff',
            'ppc_specialist_primary_color': '#e94d65',
            'ppc_specialist_heading_color': '#1b4962',
            'ppc_specialist_text_color': '#192225',
            'ppc_specialist_primary_fade': '#ffeff1',
            'ppc_specialist_footer_bg' :'#1b4962',
            'ppc_specialist_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);