<?php

$construction_hub_tp_theme_css = '';

//theme-color
$construction_hub_tp_color_option = get_theme_mod('construction_hub_tp_color_option');

// 1st color
$construction_hub_tp_color_option = get_theme_mod('construction_hub_tp_color_option', '#fda12b');
if ($construction_hub_tp_color_option) {
    $construction_hub_tp_theme_css .= ':root {';
    $construction_hub_tp_theme_css .= '--color-primary1: ' . esc_attr($construction_hub_tp_color_option) . ';';
    $construction_hub_tp_theme_css .= '}';
}

//hover color
$construction_hub_tp_color_option_link = get_theme_mod('construction_hub_tp_color_option_link');

if($construction_hub_tp_color_option_link != false){
$construction_hub_tp_theme_css .='.prev.page-numbers:focus, .prev.page-numbers:hover, .next.page-numbers:focus, .next.page-numbers:hover,#slider .carousel-control-prev-icon:hover, #slider .carousel-control-next-icon:hover,span.meta-nav:hover, #comments input[type="submit"]:hover,.woocommerce #respond input#submit:hover, .woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover, .woocommerce #respond input#submit.alt:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover, #footer button[type="submit"]:hover, #theme-sidebar button[type="submit"]:hover,.book-tkt-btn a.register-btn:hover,.more-btn a:hover,.book-tkt-btn a.bar-btn i:hover,.search-box i:hover,.page-numbers:hover,#projetcs-sec button.tablinks:hover,span.page-numbers.current, .page-numbers:hover,.woocommerce ul.products li.product .onsale,.woocommerce span.onsale{';
	$construction_hub_tp_theme_css .='background: '.esc_attr($construction_hub_tp_color_option_link).';';
$construction_hub_tp_theme_css .='}';
}
if($construction_hub_tp_color_option_link != false){
$construction_hub_tp_theme_css .='a:hover,#theme-sidebar a:hover,.media-links i:hover,.social-media i:hover, .readmore-btn a:hover ,.social-media i:hover,.logo h1 a, .logo p,.post_tag a:hover,#footer .tagcloud a:hover,#footer p.wp-block-tag-cloud a:hover,#footer li a:hover{';
	$construction_hub_tp_theme_css .='color: '.esc_attr($construction_hub_tp_color_option_link).';';
$construction_hub_tp_theme_css .='}';
}
if($construction_hub_tp_color_option_link != false){
$construction_hub_tp_theme_css .='#footer .tagcloud a:hover,#footer p.wp-block-tag-cloud a:hover, .readmore-btn a:hover,.post_tag a:hover,#theme-sidebar .widget_tag_cloud a:hover,#theme-sidebar .tagcloud a:hover{';
	$construction_hub_tp_theme_css .='border-color: '.esc_attr($construction_hub_tp_color_option_link).';';
$construction_hub_tp_theme_css .='}';
}

//Social icon Font size
$roofing_contractor_social_icon_fontsize = get_theme_mod('roofing_contractor_social_icon_fontsize');
$construction_hub_tp_theme_css .='.social-media a i{';
$construction_hub_tp_theme_css .='font-size: '.esc_attr($roofing_contractor_social_icon_fontsize).'px;';
$construction_hub_tp_theme_css .='}';

//======================= slider Content layout ===================== //

$roofing_contractor_slider_content_layout = get_theme_mod('roofing_contractor_slider_content_layout', 'LEFT-ALIGN'); 
$construction_hub_tp_theme_css .= '#slider .carousel-caption{';
switch ($roofing_contractor_slider_content_layout) {
    case 'LEFT-ALIGN':
        $construction_hub_tp_theme_css .= 'text-align:left; right: 40%; left: 15%';
        break;
    case 'CENTER-ALIGN':
        $construction_hub_tp_theme_css .= 'text-align:center; left: 20%; right: 20%';
        break;
    case 'RIGHT-ALIGN':
        $construction_hub_tp_theme_css .= 'text-align:right; left: 40%; right: 15%';
        break;
    default:
        $construction_hub_tp_theme_css .= 'text-align:left; right: 40%; left: 15%';
        break;
}
$construction_hub_tp_theme_css .= '}';

// logo tagline color
$construction_hub_site_title_color = get_theme_mod('construction_hub_site_title_color');

if($construction_hub_site_title_color != false){
$construction_hub_tp_theme_css .='.logo h1 a, .logo p.site-title a{';
$construction_hub_tp_theme_css .='color: '.esc_attr($construction_hub_site_title_color).';';
$construction_hub_tp_theme_css .='}';
}

$construction_hub_logo_tagline_color = get_theme_mod('construction_hub_logo_tagline_color');
if($construction_hub_logo_tagline_color != false){
$construction_hub_tp_theme_css .='p.site-description{';
$construction_hub_tp_theme_css .='color: '.esc_attr($construction_hub_logo_tagline_color).';';
$construction_hub_tp_theme_css .='}';
}

// menu color
$construction_hub_menu_color = get_theme_mod('construction_hub_menu_color');
if($construction_hub_menu_color != false){
$construction_hub_tp_theme_css .='.main-navigation a{';
$construction_hub_tp_theme_css .='color: '.esc_attr($construction_hub_menu_color).';';
$construction_hub_tp_theme_css .='}';
}

/*------------------ Slider CSS -------------------*/
    $construction_hub_slider_opacity_setting = get_theme_mod('construction_hub_slider_opacity_setting', true);
    $construction_hub_image_opacity_color    = get_theme_mod('construction_hub_image_opacity_color', '');
    $construction_hub_slider_opacity         = get_theme_mod('construction_hub_slider_opacity', '1');

    if ($construction_hub_slider_opacity_setting) {
        // Apply opacity value to slider image
        if ($construction_hub_slider_opacity !== '') {
            $construction_hub_tp_theme_css .= '#slider img {';
            $construction_hub_tp_theme_css .= 'opacity: ' . esc_attr($construction_hub_slider_opacity) . ';';
            $construction_hub_tp_theme_css .= '}';
        }

        // Apply background color to slider if defined
        if ($construction_hub_image_opacity_color !== '') {
            $construction_hub_tp_theme_css .= '#slider {';
            $construction_hub_tp_theme_css .= 'background-color: ' . esc_attr($construction_hub_image_opacity_color) . ';';
            $construction_hub_tp_theme_css .= '}';
        }
    } else {
        // If setting is disabled, force full opacity
        $construction_hub_tp_theme_css .= '#slider img {';
        $construction_hub_tp_theme_css .= 'opacity: 1;';
        $construction_hub_tp_theme_css .= '}';
    }

    /*---------------------------Slider Height ------------*/
    $construction_hub_slider_img_height       = get_theme_mod('construction_hub_slider_img_height');
    $construction_hub_slider_img_height_resp  = get_theme_mod('construction_hub_slider_img_height_responsive');

    if ( $construction_hub_slider_img_height ) {
        $construction_hub_tp_theme_css .= '#slider img {';
        $construction_hub_tp_theme_css .= 'height: ' . esc_attr( $construction_hub_slider_img_height ) . ';';
        $construction_hub_tp_theme_css .= '}';
    }

    if ( $construction_hub_slider_img_height_resp ) {
        $construction_hub_tp_theme_css .= '@media only screen and (max-width: 767px) {';
        $construction_hub_tp_theme_css .= '#slider img {';
        $construction_hub_tp_theme_css .= 'height: ' . esc_attr( $construction_hub_slider_img_height_resp ) . ';';
        $construction_hub_tp_theme_css .= '}';
        $construction_hub_tp_theme_css .= '}';
    }

    // About Section ANimation
    $roofing_contractor_project_sec_animation = get_theme_mod( 'roofing_contractor_project_sec_animation', true );
    if ( $roofing_contractor_project_sec_animation ) {
        $construction_hub_tp_theme_css .= '#projetcs-sec { animation: bounceInDown 3s; animation-fill-mode: both; }';
    }