(function($) {
    function resetColorsToDefault() {
        // Define default values for your color settings
        const defaultColors = {
            'background_color': '#ffffff',
            'seo_digital_marketing_primary_color': '#c444fb',
            'seo_digital_marketing_second_color': '#8a63f2',
            'seo_digital_marketing_heading_color': '#192225',
            'seo_digital_marketing_text_color': '#63646d',
            'seo_digital_marketing_section_box_color' :'#f8ebfe',
            'seo_digital_marketing_primary_fade': '#f9ebff',
            'seo_digital_marketing_footer_bg': '#192225',
            'seo_digital_marketing_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);