<?php
/**
 * Home Construction: Customizer
 *
 * @subpackage Home Construction
 * @since 1.0
 */

use WPTRT\Customize\Section\Home_Construction_Button;

add_action( 'customize_register', function( $manager ) {

	$manager->register_section_type( Home_Construction_Button::class );

	$manager->add_section(
		new Home_Construction_Button( $manager, 'home_construction_pro', [
			'title'      => __( 'Home Construction Pro', 'home-construction' ),
			'priority'    => 0,
			'button_text' => __( 'Go Pro', 'home-construction' ),
			'button_url'  => esc_url( 'https://www.luzuk.com/products/wordpress-construction-theme/', 'home-construction')
		] )
	);

} );

// Load the JS and CSS.
add_action( 'customize_controls_enqueue_scripts', function() {

	$version = wp_get_theme()->get( 'Version' );

	wp_enqueue_script(
		'home-construction-customize-section-button',
		get_theme_file_uri( 'vendor/wptrt/customize-section-button/public/js/customize-controls.js' ),
		[ 'customize-controls' ],
		$version,
		true
	);

	wp_enqueue_style(
		'home-construction-customize-section-button',
		get_theme_file_uri( 'vendor/wptrt/customize-section-button/public/css/customize-controls.css' ),
		[ 'customize-controls' ],
 		$version
	);

} );

function home_construction_customize_register( $wp_customize ) {

	$wp_customize->add_setting('home_construction_logo_size',array(
		'default' => '',
		'sanitize_callback'	=> 'home_construction_sanitize_float'
	));
	$wp_customize->add_control('home_construction_logo_size',array(
		'type' => 'range',
		'description' => __('Logo Size (0-100%)','home-construction'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('home_construction_logo_padding',array(
      'sanitize_callback'	=> 'esc_html'
	));
	$wp_customize->add_control('home_construction_logo_padding',array(
		'label' => __('Logo Padding','home-construction'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('home_construction_logo_top_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'home_construction_sanitize_float'
	));
	$wp_customize->add_control('home_construction_logo_top_padding',array(
		'type' => 'number',
		'description' => __('Top','home-construction'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('home_construction_logo_bottom_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'home_construction_sanitize_float'
	));
	$wp_customize->add_control('home_construction_logo_bottom_padding',array(
		'type' => 'number',
		'description' => __('Bottom','home-construction'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('home_construction_logo_left_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'home_construction_sanitize_float'
	));
	$wp_customize->add_control('home_construction_logo_left_padding',array(
		'type' => 'number',
		'description' => __('Left','home-construction'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('home_construction_logo_right_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'home_construction_sanitize_float'
	));
	$wp_customize->add_control('home_construction_logo_right_padding',array(
		'type' => 'number',
		'description' => __('Right','home-construction'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('home_construction_show_site_title',array(
		'default' => true,
		'sanitize_callback'	=> 'home_construction_sanitize_checkbox'
	));
	$wp_customize->add_control('home_construction_show_site_title',array(
		'type' => 'checkbox',
		'label' => __('Show / Hide Site Title','home-construction'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('home_construction_site_title_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'home_construction_sanitize_float'
	));
	$wp_customize->add_control('home_construction_site_title_font_size',array(
		'type' => 'number',
		'label' => __('Site Title Font Size','home-construction'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('home_construction_show_tagline',array(
		'default' => true,
		'sanitize_callback' => 'home_construction_sanitize_checkbox'
	));
	$wp_customize->add_control('home_construction_show_tagline',array(
		'type' => 'checkbox',
		'label' => __('Show / Hide Site Tagline','home-construction'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('home_construction_site_tagline_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'home_construction_sanitize_float'
	));
	$wp_customize->add_control('home_construction_site_tagline_font_size',array(
		'type' => 'number',
		'label' => __('Site Tagline Font Size','home-construction'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_panel( 'home_construction_panel_id', array(
		'priority' => 10,
		'capability' => 'edit_theme_options',
		'theme_supports' => '',
		'title' => __( 'Theme Settings', 'home-construction' ),
		'description' => __( 'Description of what this panel does.', 'home-construction' ),
	) );

	$wp_customize->add_section( 'home_construction_theme_options_section', array(
    	'title'      => __( 'General Settings', 'home-construction' ),
		'priority'   => 30,
		'panel' => 'home_construction_panel_id'
	) );

	$wp_customize->add_setting('home_construction_global_color', array(
	   'sanitize_callback' => 'wp_kses_post',
	));
	$wp_customize->add_control(new Home_Construction_Tab_Control($wp_customize, 'home_construction_global_color', array(
	   'section' => 'home_construction_theme_options_section',
	   'priority' => 1,
	   'buttons' => array(
	      array(
	         'name' => esc_html__('General Settings', 'home-construction'),
            'fields' => array(
               'home_construction_theme_options',
               'home_construction_single_post_sidebar',
               'home_construction_page_sidebar',
               'home_construction_archive_page_sidebar'
            ),
            'active' => true,
         ),
	      array(
            'name' => esc_html__('Color Settings', 'home-construction'),
            'fields' => array(
               'home_construction_first_global_color',
               'home_construction_second_global_color'
            ),
         )
    	),
	)));

	$wp_customize->add_setting('home_construction_theme_options',array(
		'default' => 'Right Sidebar',
		'sanitize_callback' => 'home_construction_sanitize_choices'
	));
	$wp_customize->add_control('home_construction_theme_options',array(
      'type' => 'select',
      'label' => __('Blog Page Sidebar Layout','home-construction'),
      'section' => 'home_construction_theme_options_section',
      'choices' => array(
         'Left Sidebar' => __('Left Sidebar','home-construction'),
         'Right Sidebar' => __('Right Sidebar','home-construction'),
         'One Column' => __('One Column','home-construction'),
         'Three Columns' => __('Three Columns','home-construction'),
         'Four Columns' => __('Four Columns','home-construction'),
         'Grid Layout' => __('Grid Layout','home-construction')
      ),
	));

	$wp_customize->add_setting('home_construction_single_post_sidebar',array(
		'default' => 'Right Sidebar',
		'sanitize_callback' => 'home_construction_sanitize_choices'
	));
	$wp_customize->add_control('home_construction_single_post_sidebar',array(
		'type' => 'select',
		'label' => __('Single Post Sidebar Layout','home-construction'),
		'section' => 'home_construction_theme_options_section',
		'choices' => array(
		   'Left Sidebar' => __('Left Sidebar','home-construction'),
		   'Right Sidebar' => __('Right Sidebar','home-construction'),
		   'One Column' => __('One Column','home-construction')
		),
	));

	$wp_customize->add_setting('home_construction_page_sidebar',array(
		'default' => 'One Column',
		'sanitize_callback' => 'home_construction_sanitize_choices'
	));
	$wp_customize->add_control('home_construction_page_sidebar',array(
		'type' => 'select',
		'label' => __('Page Sidebar Layout','home-construction'),
		'section' => 'home_construction_theme_options_section',
		'choices' => array(
		   'Left Sidebar' => __('Left Sidebar','home-construction'),
		   'Right Sidebar' => __('Right Sidebar','home-construction'),
		   'One Column' => __('One Column','home-construction')
		),
	));

	$wp_customize->add_setting('home_construction_archive_page_sidebar',array(
		'default' => 'Right Sidebar',
		'sanitize_callback' => 'home_construction_sanitize_choices'
	));
	$wp_customize->add_control('home_construction_archive_page_sidebar',array(
		'type' => 'select',
		'label' => __('Archive & Search Page Sidebar Layout','home-construction'),
		'section' => 'home_construction_theme_options_section',
		'choices' => array(
		   'Left Sidebar' => __('Left Sidebar','home-construction'),
		   'Right Sidebar' => __('Right Sidebar','home-construction'),
		   'One Column' => __('One Column','home-construction'),
         'Three Columns' => __('Three Columns','home-construction'),
         'Four Columns' => __('Four Columns','home-construction'),
		   'Grid Layout' => __('Grid Layout','home-construction')
		),
	));

	$wp_customize->add_setting( 'home_construction_boxfull_width', array(
		'default'           => '',
		'sanitize_callback' => 'home_construction_sanitize_choices'
	));
	
	$wp_customize->add_control( 'home_construction_boxfull_width', array(
		'label'    => __( 'Section Width', 'home-construction' ),
		'section'  => 'home_construction_theme_options_section',
		'type'     => 'select',
		'choices'  => array(
			'container'  => __('Box Width', 'home-construction'),
			'container-fluid' => __('Full Width', 'home-construction'),
			'none' => __('None', 'home-construction')
		),
	));

	$wp_customize->add_setting( 'home_construction_dropdown_anim', array(
		'default'           => 'None',
		'sanitize_callback' => 'home_construction_sanitize_choices'
	));
	$wp_customize->add_control( 'home_construction_dropdown_anim', array(
		'label'    => __( 'Menu Dropdown Animations', 'home-construction' ),
		'section'  => 'home_construction_theme_options_section',
		'type'     => 'select',
		'choices'  => array(
			'bounceInUp'  => __('bounceInUp', 'home-construction'),
			'fadeInUp' => __('fadeInUp', 'home-construction'),
			'zoomIn'    => __('zoomIn', 'home-construction'),
			'None'    => __('None', 'home-construction')
		),
	));

	$wp_customize->add_setting( 'home_construction_first_global_color', array(
	   'default' => '#030749',
	   'sanitize_callback' => 'sanitize_hex_color'
  	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'home_construction_first_global_color', array(
  		'label' => __('Primary Color', 'home-construction' ),
	   'section' => 'home_construction_theme_options_section',
  	)));

	$wp_customize->add_setting( 'home_construction_second_global_color', array(
	   'default' => '#f9b721',
	   'sanitize_callback' => 'sanitize_hex_color'
  	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'home_construction_second_global_color', array(
  		'label' => __('Secondary Color', 'home-construction' ),
	   'section' => 'home_construction_theme_options_section',
  	)));

	//Social Icons
	$wp_customize->add_section( 'home_construction_header_section' , array(
    	'title'    => __( 'Header Section', 'home-construction' ),
		'priority' => null,
		'panel' => 'home_construction_panel_id'
	) );
	
	$wp_customize->add_setting( 'home_construction_menu_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'home_construction_menu_color', array(
		'label' => __('Menu Color','home-construction'),
		'section' => 'home_construction_header_section',
	)));

	$wp_customize->add_setting( 'home_construction_menuhvr_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'home_construction_menuhvr_color', array(
		'label' => __('Menu Hover Color','home-construction'),
		'section' => 'home_construction_header_section',
	)));

	$wp_customize->add_setting( 'home_construction_submenu_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'home_construction_submenu_color', array(
		'label' => __('Submenu Color','home-construction'),
		'section' => 'home_construction_header_section',
	)));

	$wp_customize->add_setting( 'home_construction_submenubg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'home_construction_submenubg_color', array(
		'label' => __('Submenu bg Color','home-construction'),
		'section' => 'home_construction_header_section',
	)));

	//Social Icons
	$wp_customize->add_section( 'home_construction_social_icons' , array(
    	'title'    => __( 'Social Icons', 'home-construction' ),
		'priority' => null,
		'panel' => 'home_construction_panel_id'
	) );

	$wp_customize->add_setting('home_construction_topheader_facebook_url',array(
    	'default' => '',
    	'sanitize_callback'	=> 'esc_url_raw'
	));
	$wp_customize->add_control('home_construction_topheader_facebook_url',array(
   	'type' => 'url',
   	'label' => __('Add Facebook URL','home-construction'),
   	'section' => 'home_construction_social_icons',
	));

	$wp_customize->add_setting('home_construction_topheader_twitter_url',array(
    	'default' => '',
    	'sanitize_callback'	=> 'esc_url_raw'
	));
	$wp_customize->add_control('home_construction_topheader_twitter_url',array(
   	'type' => 'url',
   	'label' => __('Add Twitter URL','home-construction'),
   	'section' => 'home_construction_social_icons',
	));

	$wp_customize->add_setting('home_construction_topheader_instagram_url',array(
    	'default' => '',
    	'sanitize_callback'	=> 'esc_url_raw'
	));
	$wp_customize->add_control('home_construction_topheader_instagram_url',array(
   	'type' => 'url',
   	'label' => __('Add Instagram URL','home-construction'),
   	'section' => 'home_construction_social_icons',
	));

	$wp_customize->add_setting('home_construction_topheader_linkedin_url',array(
    	'default' => '',
    	'sanitize_callback'	=> 'esc_url_raw'
	));
	$wp_customize->add_control('home_construction_topheader_linkedin_url',array(
   	'type' => 'url',
   	'label' => __('Add Linkedin URL','home-construction'),
   	'section' => 'home_construction_social_icons',
	));

	$wp_customize->add_setting('home_construction_social_icon_font_size',array(
    	'default' => '',
    	'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('home_construction_social_icon_font_size',array(
   	'type' => 'number',
   	'label' => __('Social Icons Font Size','home-construction'),
   	'section' => 'home_construction_social_icons',
	));

	$wp_customize->add_setting( 'home_construction_social_icons_color', array(
	   'default' => '',
	   'sanitize_callback' => 'sanitize_hex_color'
  	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'home_construction_social_icons_color', array(
  		'label' => __('Social Icons Color','home-construction'),
	   'section' => 'home_construction_social_icons',
  	)));

	$wp_customize->add_setting( 'home_construction_social_icons_hover_color', array(
	   'default' => '',
	   'sanitize_callback' => 'sanitize_hex_color'
  	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'home_construction_social_icons_hover_color', array(
  		'label' => __('Social Icons Hover Color','home-construction'),
	   'section' => 'home_construction_social_icons',
  	)));
	
	//home page slider
	$wp_customize->add_section( 'home_construction_slider_section' , array(
    	'title'    => __( 'Slider Settings', 'home-construction' ),
		'priority' => null,
		'panel' => 'home_construction_panel_id'
	) );

	$wp_customize->add_setting('home_construction_slider_hide_show',array(
    	'default' => false,
    	'sanitize_callback' => 'home_construction_sanitize_checkbox'
	));
	$wp_customize->add_control('home_construction_slider_hide_show',array(
		'type' => 'checkbox',
		'label' => __('Show / Hide Slider','home-construction'),
		'section' => 'home_construction_slider_section',
	));

	$wp_customize->add_setting( 'home_construction_slider_effect', array(
		'default'           => '',
		'sanitize_callback' => 'home_construction_sanitize_choices'
	));
	$wp_customize->add_control( 'home_construction_slider_effect', array(
		'label'    => __( 'Onload Transactions Effects', 'home-construction' ),
		'section'  => 'home_construction_slider_section',
		'type'     => 'select',
		'choices'  => array(
			'bounceInLeft'  => __('bounceInLeft', 'home-construction'),
			'bounceInRight' => __('bounceInRight', 'home-construction'),
			'bounceInUp'    => __('bounceInUp', 'home-construction'),
			'bounceInDown'    => __('bounceInDown', 'home-construction'),
			'zoomIn'  => __('zoomIn', 'home-construction'),
			'zoomOut' => __('zoomOut', 'home-construction'),
			'fadeInDown'    => __('fadeInDown', 'home-construction'),
			'fadeInUp'    => __('fadeInUp', 'home-construction'),
			'fadeInLeft'  => __('fadeInLeft', 'home-construction'),
			'fadeInRight' => __('fadeInRight', 'home-construction'),
			'flip-up'    => __('flip-up', 'home-construction'),
			'none'    => __('none', 'home-construction')
		),
	));

	for ( $count = 1; $count <= 4; $count++ ) {
		$wp_customize->add_setting( 'home_construction_slider' . $count, array(
			'default'           => '',
			'sanitize_callback' => 'home_construction_sanitize_dropdown_pages'
		));
		$wp_customize->add_control( 'home_construction_slider' . $count, array(
			'label' => __('Select Slider Image Page', 'home-construction' ),
			'description' => __('Image Size (1600px x 600px)', 'home-construction' ),
			'section' => 'home_construction_slider_section',
			'type' => 'dropdown-pages'
		));
	}

	$wp_customize->add_setting('home_construction_slider_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'home_construction_sanitize_float'
	));
	$wp_customize->add_control('home_construction_slider_font_size',array(
		'type' => 'number',
		'label' => __('Title Font Size','home-construction'),
		'section' => 'home_construction_slider_section',
	));

	$wp_customize->add_setting('home_construction_slider_opacity',array(
		'default' => '',
		'sanitize_callback'	=> 'home_construction_sanitize_float'
	));
	$wp_customize->add_control('home_construction_slider_opacity',array(
		'type' => 'range',
		'label' => __('Image Opacity','home-construction'),
		'section' => 'home_construction_slider_section',
		'input_attrs' => array(
			'min'  => 0,
			'max'  => 1,
			'step' => 0.1,
		),
	));

	$wp_customize->add_setting( 'home_construction_slider_heading_color', array(
	   'default' => '',
	   'sanitize_callback' => 'sanitize_hex_color'
  	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'home_construction_slider_heading_color', array(
  		'label' => 'Slider Heading Color',
	   'section' => 'home_construction_slider_section',
  	)));

	$wp_customize->add_setting( 'home_construction_slider_buttonbg_color', array(
	   'default' => '',
	   'sanitize_callback' => 'sanitize_hex_color'
  	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'home_construction_slider_buttonbg_color', array(
  		'label' => 'Slider Button BG Color',
	   'section' => 'home_construction_slider_section',
  	)));

	$wp_customize->add_setting( 'home_construction_slider_button_hover_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'home_construction_slider_button_hover_color', array(
		'label' => 'Slider Button Text Hover Color',
		'section' => 'home_construction_slider_section',
	)));

	$wp_customize->add_setting( 'home_construction_slider_buttonbg_hover_color', array(
	   'default' => '',
	   'sanitize_callback' => 'sanitize_hex_color'
  	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'home_construction_slider_buttonbg_hover_color', array(
  		'label' => 'Slider Button BG Hover Color',
	   'section' => 'home_construction_slider_section',
  	)));

	//About Section
	$wp_customize->add_section('home_construction_service_section',array(
		'title'	=> __('Service Section','home-construction'),
		'description'=> __('Note : This section will appear below the slider.','home-construction'),
		'panel' => 'home_construction_panel_id',
	));

	$wp_customize->add_setting('home_construction_service_small_title',array(
    	'default' => '',
    	'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('home_construction_service_small_title',array(
   	'type' => 'text',
   	'label' => __('Add Small Title','home-construction'),
   	'section' => 'home_construction_service_section',
	));

	$wp_customize->add_setting('home_construction_service_section_title',array(
    	'default' => '',
    	'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('home_construction_service_section_title',array(
   	'type' => 'text',
   	'label' => __('Add Section Title','home-construction'),
   	'section' => 'home_construction_service_section',
	));

	$categories = get_categories();
	$cats = array();
	$i = 0;
	$cat_pst[]= 'select';
	foreach($categories as $category){
		if($i==0){
			$default = $category->slug;
			$i++;
		}
		$cat_pst[$category->slug] = $category->name;
	}

	$wp_customize->add_setting('home_construction_service_category',array(
		'default' => 'select',
		'sanitize_callback' => 'home_construction_sanitize_choices',
	));
	$wp_customize->add_control('home_construction_service_category',array(
		'type'    => 'select',
		'choices' => $cat_pst,
		'label' => __('Select Category To Display Post','home-construction'),
		'section' => 'home_construction_service_section',
	));

	$wp_customize->add_setting('home_construction_service_number',array(
		'default'	=> '3',
		'sanitize_callback'	=> 'sanitize_text_field',
	));
	$wp_customize->add_control('home_construction_service_number',array(
		'label'	=> __('Number Of Posts To Show In A Category','home-construction'),
		'section' => 'home_construction_service_section',
		'type'	  => 'number'
	));

	$home_construction_service_number = get_theme_mod('home_construction_service_number', 3);
	for ($i=1; $i <= $home_construction_service_number; $i++) { 
	   $wp_customize->add_setting('home_construction_service_icon' . $i, array(
	      'default' => 'fas fa-pencil-alt',
	      'sanitize_callback' => 'sanitize_text_field'
	   ));
	   $wp_customize->add_control(new Home_Construction_Fontawesome_Icon_Chooser($wp_customize, 'home_construction_service_icon' . $i, array(
	      'section' => 'home_construction_service_section',
	      'type' => 'icon',
	      'label' => esc_html__('Service Icon ', 'home-construction') . $i
	  	)));
	}

	$wp_customize->add_setting('home_construction_service_img_size',array(
		'default' => '',
		'sanitize_callback'	=> 'home_construction_sanitize_float'
	));
	$wp_customize->add_control('home_construction_service_img_size',array(
		'type' => 'number',
		'label' => __('Image Size','home-construction'),
		'section' => 'home_construction_service_section',
	));

	$wp_customize->add_setting( 'home_construction_service_small_title_color', array(
	   'default' => '',
	   'sanitize_callback' => 'sanitize_hex_color'
  	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'home_construction_service_small_title_color', array(
  		'label' => __('Small Title Color', 'home-construction'),
	   'section' => 'home_construction_service_section',
  	)));

	$wp_customize->add_setting( 'home_construction_section_title_color', array(
	   'default' => '',
	   'sanitize_callback' => 'sanitize_hex_color'
  	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'home_construction_section_title_color', array(
  		'label' => __('Section Title Color', 'home-construction'),
	   'section' => 'home_construction_service_section',
  	)));

	$wp_customize->add_setting( 'home_construction_service_title_color', array(
	   'default' => '',
	   'sanitize_callback' => 'sanitize_hex_color'
  	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'home_construction_service_title_color', array(
  		'label' => __('Service Title Color', 'home-construction'),
	   'section' => 'home_construction_service_section',
  	)));

	$wp_customize->add_setting( 'home_construction_service_icon_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'home_construction_service_icon_color', array(
		'label' => __('Service Icon Color', 'home-construction'),
		'section' => 'home_construction_service_section',
	)));

	$wp_customize->add_setting( 'home_construction_service_iconbg_color1', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'home_construction_service_iconbg_color1', array(
		'label' => __('Service Icon Bg Color1', 'home-construction'),
		'section' => 'home_construction_service_section',
	)));

	$wp_customize->add_setting( 'home_construction_service_iconbg_color2', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'home_construction_service_iconbg_color2', array(
		'label' => __('Service Icon Bg Color2', 'home-construction'),
		'section' => 'home_construction_service_section',
	)));

	//Footer
    $wp_customize->add_section( 'home_construction_footer', array(
    	'title'  => __( 'Footer Setting', 'home-construction' ),
		'priority' => null,
		'panel' => 'home_construction_panel_id'
	) );

	$wp_customize->add_setting('home_construction_show_back_totop',array(
      'default' => true,
      'sanitize_callback' => 'home_construction_sanitize_checkbox'
   ));
   $wp_customize->add_control('home_construction_show_back_totop',array(
      'type' => 'checkbox',
      'label' => __('Show / Hide Back to Top','home-construction'),
      'section' => 'home_construction_footer'
   ));

	$wp_customize->add_setting('home_construction_copyright_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'home_construction_sanitize_float'
	));
	$wp_customize->add_control('home_construction_copyright_padding',array(
		'type' => 'number',
		'label' => __('Copyright Top Bottom Padding','home-construction'),
		'section' => 'home_construction_footer',
	));

   $wp_customize->add_setting('home_construction_footer_copy',array(
		'default' => '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('home_construction_footer_copy',array(
		'label'	=> __('Copyright Text','home-construction'),
		'section' => 'home_construction_footer',
		'setting' => 'home_construction_footer_copy',
		'type' => 'text'
	));

	$wp_customize->add_setting( 'home_construction_copyright_bg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'home_construction_copyright_bg_color', array(
		'label' => __('Copyright Background Color','home-construction'),
		'section' => 'home_construction_footer',
	)));

	$wp_customize->add_setting( 'home_construction_footer_title_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'home_construction_footer_title_color', array(
		'label' => __('Footer Title Color','home-construction'),
		'section' => 'home_construction_footer',
	)));

	$wp_customize->add_setting( 'home_construction_footer_text_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'home_construction_footer_text_color', array(
		'label' => __('Footer Text Color','home-construction'),
		'section' => 'home_construction_footer',
	)));

	$wp_customize->add_setting( 'home_construction_footer_bg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'home_construction_footer_bg_color', array(
		'label' => __('Footer BG Color','home-construction'),
		'section' => 'home_construction_footer',
	)));

	$wp_customize->add_setting( 'home_construction_footer_bdr_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'home_construction_footer_bdr_color', array(
		'label' => __('Footer Border Color','home-construction'),
		'section' => 'home_construction_footer',
	)));

	$wp_customize->add_setting( 'home_construction_back_totop_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'home_construction_back_totop_color', array(
		'label' => __('Back to Top Text Color','home-construction'),
		'section' => 'home_construction_footer',
	)));

	$wp_customize->add_setting( 'home_construction_back_totop_bg_color', array(
	   'default' => '',
	   'sanitize_callback' => 'sanitize_hex_color'
  	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'home_construction_back_totop_bg_color', array(
  		'label' => __('Back to Top Background Color','home-construction'),
	   'section' => 'home_construction_footer',
  	)));

	$wp_customize->add_setting( 'home_construction_back_totop_bg_hover_color', array(
	   'default' => '',
	   'sanitize_callback' => 'sanitize_hex_color'
  	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'home_construction_back_totop_bg_hover_color', array(
  		'label' => __('Back to Top Background Hover Color','home-construction'),
	   'section' => 'home_construction_footer',
  	)));

	$wp_customize->register_section_type( Home_Construction_Button::class );

	$wp_customize->add_section(
		new Home_Construction_Button( $wp_customize, 'home_construction_pro_link', [
			'title'      => __( 'Home Construction Pro', 'home-construction' ),
			'priority'    => 0,
			'button_text' => __( 'Go Pro', 'home-construction' ),
			'button_url'  => esc_url( 'https://www.luzuk.com/products/wordpress-construction-theme/', 'home-construction'),
			'panel' => 'home_construction_panel_id'
		] )
	);

	$wp_customize->get_setting( 'blogname' )->transport          = 'postMessage';
	$wp_customize->get_setting( 'blogdescription' )->transport   = 'postMessage';
	$wp_customize->get_setting( 'header_textcolor' )->transport  = 'postMessage';

	$wp_customize->selective_refresh->add_partial( 'blogname', array(
		'selector' => '.site-title a',
		'render_callback' => 'home_construction_customize_partial_blogname',
	) );
	$wp_customize->selective_refresh->add_partial( 'blogdescription', array(
		'selector' => '.site-description',
		'render_callback' => 'home_construction_customize_partial_blogdescription',
	) );
	
   $wp_customize->register_control_type('Home_Construction_Tab_Control');
}
add_action( 'customize_register', 'home_construction_customize_register' );

function home_construction_customize_partial_blogname() {
	bloginfo( 'name' );
}

function home_construction_customize_partial_blogdescription() {
	bloginfo( 'description' );
}

function home_construction_is_static_front_page() {
	return ( is_front_page() && ! is_home() );
}

function home_construction_is_view_with_layout_option() {
	// This option is available on all pages. It's also available on archives when there isn't a sidebar.
	return ( is_page() || ( is_archive() && ! is_active_sidebar( 'sidebar-1' ) ) );
}

if (class_exists('WP_Customize_Control')) {

   class Home_Construction_Fontawesome_Icon_Chooser extends WP_Customize_Control {

      public $type = 'icon';

      public function render_content() { ?>
         <label>
            <span class="customize-control-title">
               <?php echo esc_html($this->label); ?>
            </span>

            <?php if ($this->description) { ?>
               <span class="description customize-control-description">
                  <?php echo wp_kses_post($this->description); ?>
               </span>
            <?php } ?>

            <div class="home-construction-selected-icon">
               <i class="fa <?php echo esc_attr($this->value()); ?>"></i>
               <span><i class="fa fa-angle-down"></i></span>
            </div>

            <ul class="home-construction-icon-list clearfix">
               <?php
               $home_construction_font_awesome_icon_array = home_construction_font_awesome_icon_array();
               foreach ($home_construction_font_awesome_icon_array as $home_construction_font_awesome_icon) {
                  $icon_class = $this->value() == $home_construction_font_awesome_icon ? 'icon-active' : '';
                  echo '<li class=' . esc_attr($icon_class) . '><i class="' . esc_attr($home_construction_font_awesome_icon) . '"></i></li>';
               }
               ?>
            </ul>
            <input type="hidden" value="<?php $this->value(); ?>" <?php $this->link(); ?> />
         </label>
         <?php
      }
   }
}
function home_construction_customizer_script() {
   wp_enqueue_style( 'font-awesome-1', esc_url(get_template_directory_uri()).'/assets/css/fontawesome-all.css');
}
add_action( 'customize_controls_enqueue_scripts', 'home_construction_customizer_script' );