<?php
function dancemaster_custom_header_setup() {
	add_theme_support( 'custom-header', apply_filters( 'dancemaster_custom_header_args', array(
		'default-image'          => '',
		'default-text-color'     => '646464',
		'width'                  => 2000, 
		'height'                 => 200,
		'flex-height'            => true,
		'wp-head-callback'       => 'dancemaster_header_style',
	) ) );
}
add_action( 'after_setup_theme', 'dancemaster_custom_header_setup' );

if ( ! function_exists( 'dancemaster_header_style' ) ) :

function dancemaster_header_style() {
		$header_text_color = get_header_textcolor();

		$topheader_sitetitlecol = esc_attr(get_theme_mod('topheader_sitetitlecol','#fff'));
		$topheader_sitebordercol = esc_attr(get_theme_mod('topheader_sitebordercol','#fd053f'));
		$topheader_taglinecol = esc_attr(get_theme_mod('topheader_taglinecol','#fff'));

		$topheader_menucol = esc_attr(get_theme_mod('topheader_menucol','#fff'));
		$topheader_menuiconcol = esc_attr(get_theme_mod('topheader_menuiconcol','#fff'));
		$topheader_menuhovercol = esc_attr(get_theme_mod('topheader_menuhovercol','#fff'));
		$topheader_submenucol = esc_attr(get_theme_mod('topheader_submenucol','#fff'));
		$topheader_submenuiconcol = esc_attr(get_theme_mod('topheader_submenuiconcol','#fd053f'));
		$topheader_submenuhrvcol = esc_attr(get_theme_mod('topheader_submenuhrvcol','#fff'));
		$topheader_submenubgcol = esc_attr(get_theme_mod('topheader_submenubgcol','#000'));
		$topheader_phonenoiconcol = esc_attr(get_theme_mod('topheader_phonenoiconcol','#fd053f'));
		$topheader_phonenotextcol = esc_attr(get_theme_mod('topheader_phonenotextcol','#fff'));


		$service_show_content = esc_attr(get_theme_mod('service_show_content','YES'));
		$feature_show_content = esc_attr(get_theme_mod('feature_show_content','YES'));

	?>
	<style type="text/css">

		<?php 
		
		?>

		h4.site-title {
			color: <?php echo apply_filters('dancemaster_topheader', $topheader_sitetitlecol); ?> !important;

		}

		a:not(.theme-button):not(.main-header .navbar .navbar-menu ul li a):not(.woocommerce-MyAccount-navigation ul li a):not(.woocommerce ul.products li.product a):not(.woocommerce nav.woocommerce-pagination ul.page-numbers li .page-numbers):not(.widget:not(.widget_social_widget):not(.widget_tag_cloud) li a) {
			color: <?php echo apply_filters('dancemaster_topheader', $topheader_sitebordercol); ?>;
		}

		p.site-description {
			color: <?php echo apply_filters('dancemaster_topheader', $topheader_taglinecol); ?>;

		}




		
		.main-header .navbar .navbar-menu ul li a {
			color: <?php echo apply_filters('dancemaster_topheader', $topheader_menucol); ?>;

		}

		.main-header .navbar .navbar-menu ul li.dropdown>a::after {
			color: <?php echo apply_filters('dancemaster_topheader', $topheader_menuiconcol); ?>;

		}

		.main-header .navbar .navbar-nav > li:hover a {
			color: <?php echo apply_filters('dancemaster_topheader', $topheader_menuhovercol); ?>;

		}

		.main-header .navbar .navbar-menu ul li.dropdown .sub-menu a:not(.remove) {
			color: <?php echo apply_filters('dancemaster_topheader', $topheader_submenucol); ?>;

		}

		.main-header .navbar .navbar-menu ul li.dropdown .sub-menu>.dropdown:after {
			color: <?php echo apply_filters('dancemaster_topheader', $topheader_submenuiconcol); ?>;

		}

		.main-header .navbar .navbar-menu ul li.dropdown .sub-menu a:not(.remove):hover {
			color: <?php echo apply_filters('dancemaster_topheader', $topheader_submenuhrvcol); ?>;

		}

		.main-header .navbar .navbar-menu ul li.dropdown .sub-menu a {
			border-bottom-color: <?php echo apply_filters('dancemaster_topheader', $topheader_submenucol); ?>;
		}

		.main-header .navbar .navbar-menu ul li.dropdown .sub-menu {
			background: <?php echo apply_filters('dancemaster_topheader', $topheader_submenubgcol); ?>;

		}

		header .dancemaster-phone-label i {
			color: <?php echo apply_filters('dancemaster_topheader', $topheader_phonenoiconcol); ?>;

		}

		header p.dancemaster-phone-label {
			color: <?php echo apply_filters('dancemaster_topheader', $topheader_phonenotextcol); ?>;

		}



		/* slider */
		.hero-style .slide-title h2 {
			color: <?php echo esc_attr(get_theme_mod('slider_titlecol')); ?>;
		}

		.hero-style .slide-text p {
			color: <?php echo esc_attr(get_theme_mod('slider_descriptioncol')); ?>;
		}

		.hero-style a.signup {
			color: <?php echo esc_attr(get_theme_mod('slider_btn1textcol')); ?> !important;
		}
		.hero-style a.signup:hover {
			color: <?php echo esc_attr(get_theme_mod('slider_btn1texthovrcol')); ?> !important;
			background: <?php echo esc_attr(get_theme_mod('slider_btn1bgHovercol')); ?>;
		}
		.hero-style a.signup {
			background: <?php echo esc_attr(get_theme_mod('slider_btn1bgcol')); ?>;
		}

		.hero-style a.ReadMore {
			color: <?php echo esc_attr(get_theme_mod('slider_btn2textcol')); ?> !important;
		}

		.hero-style a.ReadMore {
			background: <?php echo esc_attr(get_theme_mod('slider_btn2bgcol')); ?>;
		}


		/* feature section */

		#features .lhsbx h2 {
			color: <?php echo esc_attr(get_theme_mod('feature_headingcol')); ?>;
		}

		#features .lhsbx .fea-olay {
			background: <?php echo esc_attr(get_theme_mod('feature_headingbgcol')); ?>;
		}

		#features h5 {
			color: <?php echo esc_attr(get_theme_mod('feature_titlecol')); ?>;
		}

		#features .swiperfe-button-prevfe:before,#features .swiperfe-button-nextfe:before {
			color: <?php echo esc_attr(get_theme_mod('feature_arrowiconcol')); ?>;
		}

		#features .swiperfe-button-prevfe:before,#features .swiperfe-button-nextfe:before  {
			background: <?php echo esc_attr(get_theme_mod('feature_arrowiconbgcol')); ?>;
		}



		/* service */

		#service-section .header-section .title {
			color: <?php echo esc_attr(get_theme_mod('Service_headingcol')); ?>;
		}

		#service-section .single-service .part-2 h3.title {
			color: <?php echo esc_attr(get_theme_mod('Service_titlecol')); ?>;
		}

		#service-section .single-service .part-2 p {
			color: <?php echo esc_attr(get_theme_mod('Service_descriptioncol')); ?>;
		}

		#service-section .single-service .part-2 a {
			color: <?php echo esc_attr(get_theme_mod('Service_btntextcol')); ?>;
		}

		#service-section .single-service .part-2 a {
			background: <?php echo esc_attr(get_theme_mod('Service_btnbgcol')); ?>;
		}

		#service-section .single-service .part-2 a:hover {
			color: <?php echo esc_attr(get_theme_mod('Service_btntexthrvcol')); ?>;
		}

		#service-section .single-service .part-2 a:hover {
			background: <?php echo esc_attr(get_theme_mod('Service_btnbghrvcol')); ?>;
		}

		#service-section .class-olay {
			background-image: linear-gradient(15deg,<?php echo esc_attr(get_theme_mod('Service_bgcol')); ?> 50%,transparent 51%);
		}
		

		
		<?php  ?>


	<?php
        if ($feature_show_content == 1):
	?>
		#features {
			display: none;
		}
	<?php
		else :
	?>
		#features {
			display: block;
		}
	<?php endif; ?>

	<?php
        if ($service_show_content == 1):
	?>
		#service-section {
			display: none;
		}
	<?php
		else :
	?>
		#service-section {
			display: block;
		}
	<?php endif; ?>


	<?php
		if ( ! display_header_text() ) :
	?>
		.site-title,
		.site-description {
			position: absolute;
			clip: rect(1px, 1px, 1px, 1px);
		}
	<?php
		else :
	?>
		h4.site-title{
			color: #fff;
		}
	<?php endif; ?>
	</style>
	<?php
}
endif;
