<?php
/**
 * nataraj-dance-studio: Customizer
 *
 * @subpackage nataraj-dance-studio
 * @since 1.0
 */

function nataraj_dance_studio_customize_register( $wp_customize ) {

	$wp_customize->add_setting('nataraj_dance_studio_logo_size',array(
		'default' => '',
		'sanitize_callback'	=> 'nataraj_dance_studio_sanitize_float'
	));
	$wp_customize->add_control('nataraj_dance_studio_logo_size',array(
		'type' => 'range',
		'description' => __('Logo Size (0-100%)','nataraj-dance-studio'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('nataraj_dance_studio_logo_padding',array(
		'sanitize_callback'	=> 'esc_html'
	));
	$wp_customize->add_control('nataraj_dance_studio_logo_padding',array(
		'label' => __('Logo Padding','nataraj-dance-studio'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('nataraj_dance_studio_logo_top_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'nataraj_dance_studio_sanitize_float'
	));
	$wp_customize->add_control('nataraj_dance_studio_logo_top_padding',array(
		'type' => 'number',
		'description' => __('Top','nataraj-dance-studio'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('nataraj_dance_studio_logo_bottom_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'nataraj_dance_studio_sanitize_float'
	));
	$wp_customize->add_control('nataraj_dance_studio_logo_bottom_padding',array(
		'type' => 'number',
		'description' => __('Bottom','nataraj-dance-studio'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('nataraj_dance_studio_logo_left_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'nataraj_dance_studio_sanitize_float'
	));
	$wp_customize->add_control('nataraj_dance_studio_logo_left_padding',array(
		'type' => 'number',
		'description' => __('Left','nataraj-dance-studio'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('nataraj_dance_studio_logo_right_padding',array(
		'default' => '',
		'sanitize_callback' => 'nataraj_dance_studio_sanitize_float'
	));
	$wp_customize->add_control('nataraj_dance_studio_logo_right_padding',array(
		'type' => 'number',
		'description' => __('Right','nataraj-dance-studio'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('nataraj_dance_studio_show_site_title',array(
		'default' => true,
		'sanitize_callback' => 'nataraj_dance_studio_sanitize_checkbox'
	));
	$wp_customize->add_control('nataraj_dance_studio_show_site_title',array(
		'type' => 'checkbox',
		'label' => __('Show / Hide Site Title','nataraj-dance-studio'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('nataraj_dance_studio_site_title_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'nataraj_dance_studio_sanitize_float'
	));
	$wp_customize->add_control('nataraj_dance_studio_site_title_font_size',array(
		'type' => 'number',
		'label' => __('Site Title Font Size','nataraj-dance-studio'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting( 'nataraj_dance_studio_site_title_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nataraj_dance_studio_site_title_color', array(
		'label' => 'Title Color',
		'section' => 'title_tagline',
	)));

	$wp_customize->add_setting('nataraj_dance_studio_show_tagline',array(
		'default' => true,
		'sanitize_callback' => 'nataraj_dance_studio_sanitize_checkbox'
	));
	$wp_customize->add_control('nataraj_dance_studio_show_tagline',array(
		'type' => 'checkbox',
		'label' => __('Show / Hide Site Tagline','nataraj-dance-studio'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('nataraj_dance_studio_site_tagline_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'nataraj_dance_studio_sanitize_float'
	));
	$wp_customize->add_control('nataraj_dance_studio_site_tagline_font_size',array(
		'type' => 'number',
		'label' => __('Site Tagline Font Size','nataraj-dance-studio'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting( 'nataraj_dance_studio_site_tagline_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nataraj_dance_studio_site_tagline_color', array(
		'label' => 'Tagline Color',
		'section' => 'title_tagline',
	)));

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

	$wp_customize->add_section( 'nataraj_dance_studio_theme_options_section', array(
    	'title'      => __( 'General Settings', 'nataraj-dance-studio' ),
		'priority'   => 30,
		'panel' => 'nataraj_dance_studio_panel_id'
	) );

	$wp_customize->add_setting('nataraj_dance_studio_theme_color', array(
		'default' => '#d44687',
		'sanitize_callback' => 'sanitize_hex_color',
	));
	$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'nataraj_dance_studio_theme_color', array(
		'label' => __('Theme Primary Color', 'nataraj-dance-studio'),
		'section' => 'nataraj_dance_studio_theme_options_section',
	)));

	// Add Settings and Controls for Layout
	$wp_customize->add_setting('nataraj_dance_studio_theme_options',array(
		'default' => 'Right Sidebar',
		'sanitize_callback' => 'nataraj_dance_studio_sanitize_choices'	        
	));
	$wp_customize->add_control('nataraj_dance_studio_theme_options',array(
		'type' => 'radio',
		'label' => __('Sidebar Settings','nataraj-dance-studio'),
		'section' => 'nataraj_dance_studio_theme_options_section',
		'choices' => array(
		   'Left Sidebar' => __('Left Sidebar','nataraj-dance-studio'),
		   'Right Sidebar' => __('Right Sidebar','nataraj-dance-studio'),
		   'One Column' => __('One Column','nataraj-dance-studio'),
		   'Three Columns' => __('Three Columns','nataraj-dance-studio'),
		   'Four Columns' => __('Four Columns','nataraj-dance-studio'),
		   'Grid Layout' => __('Grid Layout','nataraj-dance-studio')
		),
	));

	$wp_customize->add_setting( 'nataraj_dance_studio_boxfull_width', array(
		'default'           => '',
		'sanitize_callback' => 'nataraj_dance_studio_sanitize_choices'
	));
	
	$wp_customize->add_control( 'nataraj_dance_studio_boxfull_width', array(
		'label'    => __( 'Section Width', 'nataraj-dance-studio' ),
		'section'  => 'nataraj_dance_studio_theme_options_section',
		'type'     => 'select',
		'choices'  => array(
			'container'  => __('Box Width', 'nataraj-dance-studio'),
			'container-fluid' => __('Full Width', 'nataraj-dance-studio'),
			'none' => __('None', 'nataraj-dance-studio')
		),
	));

	$wp_customize->add_setting( 'nataraj_dance_studio_dropdown_anim', array(
		'default'           => 'None',
		'sanitize_callback' => 'nataraj_dance_studio_sanitize_choices'
	));
	$wp_customize->add_control( 'nataraj_dance_studio_dropdown_anim', array(
		'label'    => __( 'Menu Dropdown Animations', 'nataraj-dance-studio' ),
		'section'  => 'nataraj_dance_studio_theme_options_section',
		'type'     => 'select',
		'choices'  => array(
			'bounceInUp'  => __('bounceInUp', 'nataraj-dance-studio'),
			'fadeInUp' => __('fadeInUp', 'nataraj-dance-studio'),
			'zoomIn'    => __('zoomIn', 'nataraj-dance-studio'),
			'None'    => __('None', 'nataraj-dance-studio')
		),
	));

	// Contact Details
	$wp_customize->add_section( 'nataraj_dance_studio_contact_details', array(
    	'title'      => __( 'Header Contact Details', 'nataraj-dance-studio' ),
		'priority'   => null,
		'panel' => 'nataraj_dance_studio_panel_id'
	) );

	$wp_customize->add_setting('nataraj_dance_studio_hide_show_topbar',array(
    	'default' => false,
    	'sanitize_callback'	=> 'nataraj_dance_studio_sanitize_checkbox'
	));
	$wp_customize->add_control('nataraj_dance_studio_hide_show_topbar',array(
   	'type' => 'checkbox',
   	'label' => __('Show / Hide Topbar','nataraj-dance-studio'),
   	'section' => 'nataraj_dance_studio_contact_details',
	));

	$wp_customize->add_setting('nataraj_dance_studio_call',array(
		'default'=> '',
		'sanitize_callback'	=> 'nataraj_dance_studio_sanitize_phone_number'
	));	
	$wp_customize->add_control('nataraj_dance_studio_call',array(
		'label'	=> __('Contact Number','nataraj-dance-studio'),
		'section'=> 'nataraj_dance_studio_contact_details',
		'setting'=> 'nataraj_dance_studio_call',
		'type'=> 'text'
	));

	$wp_customize->add_setting('nataraj_dance_studio_mail',array(
		'default'=> '',
		'sanitize_callback'	=> 'sanitize_email'
	));	
	$wp_customize->add_control('nataraj_dance_studio_mail',array(
		'label'	=> __('Email Address','nataraj-dance-studio'),
		'section'=> 'nataraj_dance_studio_contact_details',
		'setting'=> 'nataraj_dance_studio_mail',
		'type'=> 'text'
	));	

	$wp_customize->add_setting('nataraj_dance_studio_time',array(
		'default'=> '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('nataraj_dance_studio_time',array(
		'label'	=> __('Timing','nataraj-dance-studio'),
		'section'=> 'nataraj_dance_studio_contact_details',
		'setting'=> 'nataraj_dance_studio_time',
		'type'=> 'text'
	));	

	$wp_customize->add_setting( 'nataraj_dance_studio_topicon_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nataraj_dance_studio_topicon_color', array(
		'label' => 'Icon Color',
		'section' => 'nataraj_dance_studio_contact_details',
	)));

	$wp_customize->add_setting( 'nataraj_dance_studio_toptext_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nataraj_dance_studio_toptext_color', array(
		'label' => 'Text Color',
		'section' => 'nataraj_dance_studio_contact_details',
	)));

	$wp_customize->add_setting( 'nataraj_dance_studio_menu_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nataraj_dance_studio_menu_color', array(
		'label' => 'Menu Color',
		'section' => 'nataraj_dance_studio_contact_details',
	)));

	$wp_customize->add_setting( 'nataraj_dance_studio_menuhvr_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nataraj_dance_studio_menuhvr_color', array(
		'label' => 'Menu Hover Color',
		'section' => 'nataraj_dance_studio_contact_details',
	)));

	$wp_customize->add_setting( 'nataraj_dance_studio_menubg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nataraj_dance_studio_menubg_color', array(
		'label' => 'Menu Bg Color',
		'section' => 'nataraj_dance_studio_contact_details',
	)));

	//social icons
	$wp_customize->add_section('nataraj_dance_studio_topbar_header',array(
		'title'	=> __('Social Icons','nataraj-dance-studio'),
		'description'	=> __('<b>Note :</b> Add Header Content here','nataraj-dance-studio'),
		'priority'	=> null,
		'panel' => 'nataraj_dance_studio_panel_id',
	));

	$wp_customize->add_setting('nataraj_dance_studio_facebook_url',array(
		'default'	=> '',
		'sanitize_callback'	=> 'esc_url_raw'
	));	
	$wp_customize->add_control('nataraj_dance_studio_facebook_url',array(
		'label'	=> __('Add Facebook link','nataraj-dance-studio'),
		'section'	=> 'nataraj_dance_studio_topbar_header',
		'setting'	=> 'nataraj_dance_studio_facebook_url',
		'type'	=> 'url'
	));

	$wp_customize->add_setting('nataraj_dance_studio_twitter_url',array(
		'default'	=> '',
		'sanitize_callback'	=> 'esc_url_raw'
	));	
	$wp_customize->add_control('nataraj_dance_studio_twitter_url',array(
		'label'	=> __('Add Twitter link','nataraj-dance-studio'),
		'section'	=> 'nataraj_dance_studio_topbar_header',
		'setting'	=> 'nataraj_dance_studio_twitter_url',
		'type'	=> 'url'
	));

	$wp_customize->add_setting('nataraj_dance_studio_linkedin_url',array(
		'default'	=> '',
		'sanitize_callback'	=> 'esc_url_raw'
	));
	$wp_customize->add_control('nataraj_dance_studio_linkedin_url',array(
		'label'	=> __('Add Linkedin link','nataraj-dance-studio'),
		'section'	=> 'nataraj_dance_studio_topbar_header',
		'setting'	=> 'nataraj_dance_studio_linkedin_url',
		'type'	=> 'url'
	));

	$wp_customize->add_setting('nataraj_dance_studio_insta_url',array(
		'default'	=> '',
		'sanitize_callback'	=> 'esc_url_raw'
	));	
	$wp_customize->add_control('nataraj_dance_studio_insta_url',array(
		'label'	=> __('Add Instagram link','nataraj-dance-studio'),
		'section'	=> 'nataraj_dance_studio_topbar_header',
		'setting'	=> 'nataraj_dance_studio_insta_url',
		'type'	=> 'url'
	));

	$wp_customize->add_setting( 'nataraj_dance_studio_social_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nataraj_dance_studio_social_color', array(
		'label' => 'Social Icon Color',
		'section' => 'nataraj_dance_studio_topbar_header',
	)));

	//home page slider
	$wp_customize->add_section( 'nataraj_dance_studio_slider_section' , array(
    	'title' => __( 'Slider Settings', 'nataraj-dance-studio' ),
		'priority' => null,
		'panel' => 'nataraj_dance_studio_panel_id'
	) );

	$wp_customize->add_setting('nataraj_dance_studio_slider_hide_show',array(
    	'default' => false,
    	'sanitize_callback'	=> 'nataraj_dance_studio_sanitize_checkbox'
	));
	$wp_customize->add_control('nataraj_dance_studio_slider_hide_show',array(
   	'type' => 'checkbox',
   	'label' => __('Show / Hide slider','nataraj-dance-studio'),
   	'section' => 'nataraj_dance_studio_slider_section',
	));

	$wp_customize->add_setting( 'nataraj_dance_studio_slider_effect', array(
		'default'           => '',
		'sanitize_callback' => 'nataraj_dance_studio_sanitize_choices'
	));
	$wp_customize->add_control( 'nataraj_dance_studio_slider_effect', array(
		'label'    => __( 'Onload Transactions Effects', 'nataraj-dance-studio' ),
		'section'  => 'nataraj_dance_studio_slider_section',
		'type'     => 'select',
		'choices'  => array(
			'bounceInLeft'  => __('bounceInLeft', 'nataraj-dance-studio'),
			'bounceInRight' => __('bounceInRight', 'nataraj-dance-studio'),
			'bounceInUp'    => __('bounceInUp', 'nataraj-dance-studio'),
			'bounceInDown'    => __('bounceInDown', 'nataraj-dance-studio'),
			'zoomIn'  => __('zoomIn', 'nataraj-dance-studio'),
			'zoomOut' => __('zoomOut', 'nataraj-dance-studio'),
			'fadeInDown'    => __('fadeInDown', 'nataraj-dance-studio'),
			'fadeInUp'    => __('fadeInUp', 'nataraj-dance-studio'),
			'fadeInLeft'  => __('fadeInLeft', 'nataraj-dance-studio'),
			'fadeInRight' => __('fadeInRight', 'nataraj-dance-studio'),
			'flip-up'    => __('flip-up', 'nataraj-dance-studio'),
			'none'    => __('none', 'nataraj-dance-studio')
		),
	));

	for ( $count = 1; $count <= 4; $count++ ) {
		$wp_customize->add_setting( 'nataraj_dance_studio_slider' . $count, array(
			'default'           => '',
			'sanitize_callback' => 'nataraj_dance_studio_sanitize_dropdown_pages'
		) );
		$wp_customize->add_control( 'nataraj_dance_studio_slider' . $count, array(
			'label'    => __( 'Select Slide Image Page', 'nataraj-dance-studio' ),
			'section'  => 'nataraj_dance_studio_slider_section',
			'type'     => 'dropdown-pages'
		) );
	}

	$wp_customize->add_setting('nataraj_dance_studio_slider_excerpt_length',array(
		'default' => '25',
		'sanitize_callback'	=> 'nataraj_dance_studio_sanitize_float'
	));
	$wp_customize->add_control('nataraj_dance_studio_slider_excerpt_length',array(
		'type' => 'number',
		'label' => __('Slider Excerpt Length','nataraj-dance-studio'),
		'section' => 'nataraj_dance_studio_slider_section',
	));

	$wp_customize->add_setting('nataraj_dance_studio_slider_title_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'nataraj_dance_studio_sanitize_float'
	));
	$wp_customize->add_control('nataraj_dance_studio_slider_title_font_size',array(
		'type' => 'number',
		'label' => __('Title Font Size','nataraj-dance-studio'),
		'section' => 'nataraj_dance_studio_slider_section',
	));

	$wp_customize->add_setting('nataraj_dance_studio_slider_text_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'nataraj_dance_studio_sanitize_float'
	));
	$wp_customize->add_control('nataraj_dance_studio_slider_text_font_size',array(
		'type' => 'number',
		'label' => __('Text Font Size','nataraj-dance-studio'),
		'section' => 'nataraj_dance_studio_slider_section',
	));

	$wp_customize->add_setting('nataraj_dance_studio_slider_opacity',array(
		'default' => '',
		'sanitize_callback'	=> 'nataraj_dance_studio_sanitize_float'
	));
	$wp_customize->add_control('nataraj_dance_studio_slider_opacity',array(
		'type' => 'range',
		'label' => __('Image Opacity','nataraj-dance-studio'),
		'section' => 'nataraj_dance_studio_slider_section',
		'input_attrs' => array(
			'min' => 0,
			'max' => 1,
			'step' => 0.1,
		),
	));

	$wp_customize->add_setting( 'nataraj_dance_studio_slider_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nataraj_dance_studio_slider_color', array(
		'label' => 'Title Color',
		'section' => 'nataraj_dance_studio_slider_section',
	)));

	$wp_customize->add_setting( 'nataraj_dance_studio_slider_text_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nataraj_dance_studio_slider_text_color', array(
		'label' => 'Text Color',
		'section' => 'nataraj_dance_studio_slider_section',
	)));

	$wp_customize->add_setting( 'nataraj_dance_studio_slider_np_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nataraj_dance_studio_slider_np_color', array(
		'label' => 'Next/Pre Arrow Color',
		'section' => 'nataraj_dance_studio_slider_section',
	)));

	//	Terms and Condition
	$wp_customize->add_section('nataraj_dance_studio_service',array(
		'title'	=> __('Our Features','nataraj-dance-studio'),
		'description'=> __('<b>Note :</b> This section will appear below the slider.','nataraj-dance-studio'),
		'panel' => 'nataraj_dance_studio_panel_id',
	));

	$wp_customize->add_setting('nataraj_dance_studio_our_services_title',array(
		'default'	=> '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('nataraj_dance_studio_our_services_title',array(
		'label'	=> __('Section Title','nataraj-dance-studio'),
		'section'	=> 'nataraj_dance_studio_service',
		'setting'	=> 'nataraj_dance_studio_our_services_title',
		'type'		=> 'text'
	));

	$wp_customize->add_setting('nataraj_dance_studio_services_title_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'nataraj_dance_studio_sanitize_float'
	));
	$wp_customize->add_control('nataraj_dance_studio_services_title_font_size',array(
		'type' => 'number',
		'label' => __('Section Title Font Size','nataraj-dance-studio'),
		'section' => 'nataraj_dance_studio_service',
	));

	$wp_customize->add_setting( 'nataraj_dance_studio_our_services_title_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nataraj_dance_studio_our_services_title_color', array(
		'label' => 'Color',
		'section' => 'nataraj_dance_studio_service',
	)));

	$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('nataraj_dance_studio_category_setting',array(
		'default'	=> 'select',
		'sanitize_callback' => 'nataraj_dance_studio_sanitize_choices',
	));
	$wp_customize->add_control('nataraj_dance_studio_category_setting',array(
		'type'    => 'select',
		'choices' => $cat_pst,
		'label' => __('Select Category To Display Post','nataraj-dance-studio'),
		'section' => 'nataraj_dance_studio_service',
	));

	$wp_customize->add_setting('nataraj_dance_studio_services_post_title_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'nataraj_dance_studio_sanitize_float'
	));
	$wp_customize->add_control('nataraj_dance_studio_services_post_title_font_size',array(
		'type' => 'number',
		'label' => __('Title Font Size','nataraj-dance-studio'),
		'section' => 'nataraj_dance_studio_service',
	));

	$wp_customize->add_setting('nataraj_dance_studio_services_post_text_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'nataraj_dance_studio_sanitize_float'
	));
	$wp_customize->add_control('nataraj_dance_studio_services_post_text_font_size',array(
		'type' => 'number',
		'label' => __('Text Font Size','nataraj-dance-studio'),
		'section' => 'nataraj_dance_studio_service',
	));

	$wp_customize->add_setting('nataraj_dance_studio_services_section_padding',array(
       'default' => '',
       'sanitize_callback'	=> 'nataraj_dance_studio_sanitize_float'
    ));
    $wp_customize->add_control('nataraj_dance_studio_services_section_padding',array(
       'type' => 'number',
       'label' => __('Section Top Bottom Padding','nataraj-dance-studio'),
       'section' => 'nataraj_dance_studio_service',
    ));

	$wp_customize->add_setting('nataraj_dance_studio_img_hight',array(
		'default' => '',
		'sanitize_callback'	=> 'nataraj_dance_studio_sanitize_float'
	));
	$wp_customize->add_control('nataraj_dance_studio_img_hight',array(
		'type' => 'number',
		'label' => __('Image Hight','nataraj-dance-studio'),
		'section' => 'nataraj_dance_studio_service',
	));

	$wp_customize->add_setting( 'nataraj_dance_studio_feature_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nataraj_dance_studio_feature_color', array(
		'label' => 'Title Color',
		'section' => 'nataraj_dance_studio_service',
	)));

	$wp_customize->add_setting( 'nataraj_dance_studio_feature_text_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nataraj_dance_studio_feature_text_color', array(
		'label' => 'Text Color',
		'section' => 'nataraj_dance_studio_service',
	)));

	//Footer
 	$wp_customize->add_section( 'nataraj_dance_studio_footer', array(
    	'title'      => __( 'Footer Settings', 'nataraj-dance-studio' ),
		'priority'   => null,
		'panel' => 'nataraj_dance_studio_panel_id'
	) );

	$wp_customize->add_setting('nataraj_dance_studio_show_back_totop',array(
 		'default' => true,
   	'sanitize_callback'	=> 'nataraj_dance_studio_sanitize_checkbox'
	));
	$wp_customize->add_control('nataraj_dance_studio_show_back_totop',array(
   	'type' => 'checkbox',
   	'label' => __('Show / Hide Back to Top','nataraj-dance-studio'),
   	'section' => 'nataraj_dance_studio_footer'
	));

 	$wp_customize->add_setting('nataraj_dance_studio_footer_copy',array(
		'default'	=> 'Dancing Studio WordPress Theme By Luzuk',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('nataraj_dance_studio_footer_copy',array(
		'label'	=> __('Copyright Text','nataraj-dance-studio'),
		'section'	=> 'nataraj_dance_studio_footer',
		'setting'	=> 'nataraj_dance_studio_footer_copy',
		'type'		=> 'text'
	));
 
	$wp_customize->add_setting('nataraj_dance_studio_footer_copylink',array(
		'default'	=> 'https://www.luzuk.com/themes/free-dance-wordpress-theme/',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('nataraj_dance_studio_footer_copylink',array(
		'label'	=> __('Copyright Link','nataraj-dance-studio'),
		'section'	=> 'nataraj_dance_studio_footer',
		'setting'	=> 'nataraj_dance_studio_footer_copylink',
		'type'		=> 'text'
	));

	$wp_customize->add_setting('nataraj_dance_studio_footer_copy_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'nataraj_dance_studio_sanitize_float'
	));
	$wp_customize->add_control('nataraj_dance_studio_footer_copy_font_size',array(
		'type' => 'number',
		'label' => __('Text Font Size','nataraj-dance-studio'),
		'section' => 'nataraj_dance_studio_footer',
	));

	$wp_customize->add_setting('nataraj_dance_studio_copyright_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'nataraj_dance_studio_sanitize_float'
 	));
 	$wp_customize->add_control('nataraj_dance_studio_copyright_padding',array(
		'type' => 'number',
		'label' => __('Copyright Top Bottom Padding','nataraj-dance-studio'),
		'section' => 'nataraj_dance_studio_footer',
	));

	$wp_customize->add_setting( 'nataraj_dance_studio_footer_title_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nataraj_dance_studio_footer_title_color', array(
		'label' => 'Footer Title Color',
		'section' => 'nataraj_dance_studio_footer',
	)));

	$wp_customize->add_setting( 'nataraj_dance_studio_footer_menu_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nataraj_dance_studio_footer_menu_color', array(
		'label' => 'Footer Menu Color',
		'section' => 'nataraj_dance_studio_footer',
	)));

	$wp_customize->add_setting( 'nataraj_dance_studio_copyright_text_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nataraj_dance_studio_copyright_text_color', array(
		'label' => 'Copyright Text Color',
		'section' => 'nataraj_dance_studio_footer',
	)));

	$wp_customize->add_setting( 'nataraj_dance_studio_copyright_border_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nataraj_dance_studio_copyright_border_color', array(
		'label' => 'Copyright Border Color',
		'section' => 'nataraj_dance_studio_footer',
	)));

	$wp_customize->add_setting( 'nataraj_dance_studio_copyright_bg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nataraj_dance_studio_copyright_bg_color', array(
		'label' => 'Footer Background Color',
		'section' => 'nataraj_dance_studio_footer',
	)));

	$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' => 'nataraj_dance_studio_customize_partial_blogname',
	) );
	$wp_customize->selective_refresh->add_partial( 'blogdescription', array(
		'selector' => '.site-description',
		'render_callback' => 'nataraj_dance_studio_customize_partial_blogdescription',
	) );
}
add_action( 'customize_register', 'nataraj_dance_studio_customize_register' );

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

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

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

function nataraj_dance_studio_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' ) ) );
}

/**
 * Singleton class for handling the theme's customizer integration.
 *
 * @since  1.0.0
 * @access public
 */
final class Nataraj_Dance_Studio_Customize {

	/**
	 * Returns the instance.
	 *
	 * @since  1.0.0
	 * @access public
	 * @return object
	 */
	public static function get_instance() {

		static $instance = null;

		if ( is_null( $instance ) ) {
			$instance = new self;
			$instance->setup_actions();
		}

		return $instance;
	}

	/**
	 * Constructor method.
	 *
	 * @since  1.0.0
	 * @access private
	 * @return void
	 */
	private function __construct() {}

	/**
	 * Sets up initial actions.
	 *
	 * @since  1.0.0
	 * @access private
	 * @return void
	 */
	private function setup_actions() {

		// Register panels, sections, settings, controls, and partials.
		add_action( 'customize_register', array( $this, 'sections' ) );

		// Register scripts and styles for the controls.
		add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_control_scripts' ), 0 );
	}

	/**
	 * Sets up the customizer sections.
	 *
	 * @since  1.0.0
	 * @access public
	 * @param  object  $manager
	 * @return void
	 */
	public function sections( $manager ) {

		// Load custom sections.
		load_template( trailingslashit( get_template_directory() ) . '/inc/section-pro.php' );

		// Register custom section types.
		$manager->register_section_type( 'Nataraj_Dance_Studio_Customize_Section_Pro' );

		// Register sections.
		$manager->add_section(
			new Nataraj_Dance_Studio_Customize_Section_Pro(
				$manager,
				'nataraj_dance_studio_example_1',
				array(
					'priority' => 9,
					'title'    => esc_html__( 'Dancing Pro Theme', 'nataraj-dance-studio' ),
					'pro_text' => esc_html__( 'Go Pro','nataraj-dance-studio' ),
					'pro_url'  => esc_url( 'https://www.luzuk.com/product/dance-studio-wordpress-theme/' ),
				)
			)
		);
	}

	/**
	 * Loads theme customizer CSS.
	 *
	 * @since  1.0.0
	 * @access public
	 * @return void
	 */
	public function enqueue_control_scripts() {

		wp_enqueue_script( 'nataraj-dance-studio-customize-controls', trailingslashit( esc_url(get_template_directory_uri()) ) . '/assets/js/customize-controls.js', array( 'customize-controls' ) );

		wp_enqueue_style( 'nataraj-dance-studio-customize-controls', trailingslashit( esc_url(get_template_directory_uri()) ) . '/assets/css/customize-controls.css' );
	}
}

// Doing this customizer thang!
Nataraj_Dance_Studio_Customize::get_instance();