<?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', '#f6ad21');
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 .= '}';
}


// Get the 2nd and 3rd color options
$construction_hub_tp_color_option_sec = get_theme_mod('construction_hub_tp_color_option_sec', '#38615d'); // Default color: #38615d
$construction_hub_tp_color_option_third = get_theme_mod('construction_hub_tp_color_option_third', '#34b3a3'); // Default color: #34b3a3

// Fallback if custom colors are not set
if (empty($construction_hub_tp_color_option_sec)) {
    $construction_hub_tp_color_option_sec = '#38615d'; // Default color
}
if (empty($construction_hub_tp_color_option_third)) {
    $construction_hub_tp_color_option_third = '#34b3a3'; // Default color
}

// Generate inline CSS for the linear gradient
$construction_hub_tp_theme_css .= '.woocommerce-shop .header-main,.woocommerce-page .header-main, .blog .header-main,  #theme-sidebar button[type="submit"]:hover,.wc-block-cart__submit-container a:hover, #comments input[type="submit"]:hover, span.meta-nav:hover,.search-box i:hover, #theme-sidebar button[type="submit"]:hover,.wc-block-cart__submit-container a:hover, #comments input[type="submit"]:hover, span.meta-nav:hover, .search-box i:hover, .header-main,.site-info, .single-post .header-main , .page-template-default .header-main, .woocommerce-cart .header-main,.page-template-front-page .header-main, .page-box .readmore-btn a:hover, .wc-block-cart__submit-container a: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, .search-outer .inner_searchbox button[type="submit"]:hover{';

// Apply the gradient using custom or default colors
$construction_hub_tp_inline_css = 'background-image: linear-gradient(to right, ' 
    . esc_attr($construction_hub_tp_color_option_sec) . ', ' 
    . esc_attr($construction_hub_tp_color_option_third) . ') !important;';

// Add the inline CSS to the theme CSS
$construction_hub_tp_theme_css .= $construction_hub_tp_inline_css;
$construction_hub_tp_theme_css .= '}'; // Close the CSS block

// Output the generated CSS (if necessary)
echo '<style>' . $construction_hub_tp_theme_css . '</style>';



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

$property_builder_slider_content_layout = get_theme_mod('property_builder_slider_content_layout', 'RIGHT-ALIGN'); 
$construction_hub_tp_theme_css .= '#slider .carousel-caption{';
switch ($property_builder_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 .= '}';

//menu font size
$construction_hub_menu_font_size = get_theme_mod('construction_hub_menu_font_size', 15);{
$construction_hub_tp_theme_css .='.main-navigation a, .main-navigation li.page_item_has_children:after,.main-navigation li.menu-item-has-children:after{';
    $construction_hub_tp_theme_css .='font-size: '.esc_attr($construction_hub_menu_font_size).'px;';
$construction_hub_tp_theme_css .='}';
}

// header
$construction_hub_slider_arrow = get_theme_mod('construction_hub_slider_arrow', false);
if ($construction_hub_slider_arrow == false) {
$construction_hub_tp_theme_css .= '.headerbox {';
    $construction_hub_tp_theme_css .= 'margin-top:0;';
}
$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 .='}';
}

