(function($) {
    function resetColorsToDefault() {
        // Define default values for your color settings
        const defaultColors = {
            'background_color': '#ffffff',
            'education_insight_primary_color': '#e9a502',
            'education_insight_heading_color': '#2c2c2c',
            'education_insight_text_color': '#666c6e',
            'education_insight_primary_fade': '#fff8e7',
            'education_insight_primary_light' :'#ffbd0a',
            'education_insight_secondary_color': '#ef5921',
            'education_insight_third_color': '#91b707',
            'education_insight_fourth_color': '#2ec7c3',
            'education_insight_service_bg': '#271706',
            'education_insight_footer_bg': '#2c2c2c',
            'education_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);