<?php

$window_blinds_repair_tp_theme_css = '';

//preloader

$window_blinds_repair_tp_preloader_color1_option = get_theme_mod('window_blinds_repair_tp_preloader_color1_option');
$window_blinds_repair_tp_preloader_color2_option = get_theme_mod('window_blinds_repair_tp_preloader_color2_option');
$window_blinds_repair_tp_preloader_bg_color_option = get_theme_mod('window_blinds_repair_tp_preloader_bg_color_option');

if($window_blinds_repair_tp_preloader_color1_option != false){
$window_blinds_repair_tp_theme_css .='.center1{';
	$window_blinds_repair_tp_theme_css .='border-color: '.esc_attr($window_blinds_repair_tp_preloader_color1_option).' !important;';
$window_blinds_repair_tp_theme_css .='}';
}
if($window_blinds_repair_tp_preloader_color1_option != false){
$window_blinds_repair_tp_theme_css .='.center1 .ring::before{';
	$window_blinds_repair_tp_theme_css .='background: '.esc_attr($window_blinds_repair_tp_preloader_color1_option).' !important;';
$window_blinds_repair_tp_theme_css .='}';
}
if($window_blinds_repair_tp_preloader_color2_option != false){
$window_blinds_repair_tp_theme_css .='.center2{';
	$window_blinds_repair_tp_theme_css .='border-color: '.esc_attr($window_blinds_repair_tp_preloader_color2_option).' !important;';
$window_blinds_repair_tp_theme_css .='}';
}
if($window_blinds_repair_tp_preloader_color2_option != false){
$window_blinds_repair_tp_theme_css .='.center2 .ring::before{';
	$window_blinds_repair_tp_theme_css .='background: '.esc_attr($window_blinds_repair_tp_preloader_color2_option).' !important;';
$window_blinds_repair_tp_theme_css .='}';
}
if($window_blinds_repair_tp_preloader_bg_color_option != false){
$window_blinds_repair_tp_theme_css .='.loader{';
	$window_blinds_repair_tp_theme_css .='background: '.esc_attr($window_blinds_repair_tp_preloader_bg_color_option).';';
$window_blinds_repair_tp_theme_css .='}';
}

// footer-bg-color
$window_blinds_repair_tp_footer_bg_color_option = get_theme_mod('window_blinds_repair_tp_footer_bg_color_option');

if($window_blinds_repair_tp_footer_bg_color_option != false){
$window_blinds_repair_tp_theme_css .='#footer{';
	$window_blinds_repair_tp_theme_css .='background: '.esc_attr($window_blinds_repair_tp_footer_bg_color_option).' !important;';
$window_blinds_repair_tp_theme_css .='}';
}

// global color
$window_blinds_repair_tp_theme_css = '';

$window_blinds_repair_tp_color_option = get_theme_mod('window_blinds_repair_tp_color_option');
$window_blinds_repair_tp_color_option_second = get_theme_mod('window_blinds_repair_tp_color_option_second');

// 1st color
$window_blinds_repair_tp_color_option = get_theme_mod('window_blinds_repair_tp_color_option', '#f8c91e');
if ($window_blinds_repair_tp_color_option) {
    $window_blinds_repair_tp_theme_css .= ':root {';
    $window_blinds_repair_tp_theme_css .= '--color-primary1: ' . esc_attr($window_blinds_repair_tp_color_option) . ';';
    $window_blinds_repair_tp_theme_css .= '}';
}

$window_blinds_repair_tp_color_option_second = get_theme_mod('window_blinds_repair_tp_color_option_second', '#fad961');
if ($window_blinds_repair_tp_color_option_second) {
    $window_blinds_repair_tp_theme_css .= ':root {';
    $window_blinds_repair_tp_theme_css .= '--color-primary2: ' . esc_attr($window_blinds_repair_tp_color_option_second) . ';';
    $window_blinds_repair_tp_theme_css .= '}';
}

// linear gradient
// Open the media query
$window_blinds_repair_tp_theme_css .= '@media screen and (max-width: 1000px) {';

// Check if either color option is set and apply CSS
if ($window_blinds_repair_tp_color_option !== false || $window_blinds_repair_tp_color_option_second !== false) {
    $window_blinds_repair_tp_theme_css .= '.menu-content {
        background-image: linear-gradient(to right, ' .
        esc_attr($window_blinds_repair_tp_color_option) . ' 50%, ' .
        esc_attr($window_blinds_repair_tp_color_option_second) . ' 50%) !important;
    }';
}

// Close the media query
$window_blinds_repair_tp_theme_css .= '}';

// Check again if either color option is set and apply CSS outside media query
if ($window_blinds_repair_tp_color_option !== false || $window_blinds_repair_tp_color_option_second !== false) {
    $window_blinds_repair_tp_theme_css .= '.menu-content {
        background-image: linear-gradient(to right, ' .
        esc_attr($window_blinds_repair_tp_color_option) . ' 91%, ' .
        esc_attr($window_blinds_repair_tp_color_option_second) . ' 7%);
    } ';
}

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

if($window_blinds_repair_site_tagline_color != false){
$window_blinds_repair_tp_theme_css .='.logo h1 a, .logo p a{';
$window_blinds_repair_tp_theme_css .='color: '.esc_attr($window_blinds_repair_site_tagline_color).';';
$window_blinds_repair_tp_theme_css .='}';
}

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

// footer widget title color
$window_blinds_repair_footer_widget_title_color = get_theme_mod('window_blinds_repair_footer_widget_title_color');
if($window_blinds_repair_footer_widget_title_color != false){
$window_blinds_repair_tp_theme_css .='#footer h3, #footer h2.wp-block-heading{';
$window_blinds_repair_tp_theme_css .='color: '.esc_attr($window_blinds_repair_footer_widget_title_color).';';
$window_blinds_repair_tp_theme_css .='}';
}

// copyright text color
$window_blinds_repair_footer_copyright_text_color = get_theme_mod('window_blinds_repair_footer_copyright_text_color');
if($window_blinds_repair_footer_copyright_text_color != false){
$window_blinds_repair_tp_theme_css .='#footer .site-info p, #footer .site-info a {';
$window_blinds_repair_tp_theme_css .='color: '.esc_attr($window_blinds_repair_footer_copyright_text_color).';';
$window_blinds_repair_tp_theme_css .='}';
}

// header image title color
$window_blinds_repair_header_image_title_text_color = get_theme_mod('window_blinds_repair_header_image_title_text_color');
if($window_blinds_repair_header_image_title_text_color != false){
$window_blinds_repair_tp_theme_css .='.box-text h2{';
$window_blinds_repair_tp_theme_css .='color: '.esc_attr($window_blinds_repair_header_image_title_text_color).';';
$window_blinds_repair_tp_theme_css .='}';
}

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