<?php

/*----------------------------------------------------------------------------------*/

$elite_soccer_club_common_inline_css = '';

$elite_soccer_club_scroll_top_alignment = get_theme_mod('elite_soccer_club_scroll_top_alignment', 'Right');

$elite_soccer_club_alignment_styles = [
    'Left' => 'left: 20px;',
    'Center' => 'right: 50%; left: 50%;',
    'Right' => 'right: 20px;'
];

$alignment_style = $elite_soccer_club_alignment_styles[$elite_soccer_club_scroll_top_alignment] ?? $elite_soccer_club_alignment_styles['Right'];

$elite_soccer_club_common_inline_css .= "a.scrollup,button#scroll_2 { $alignment_style }";

/*----------------------------------------------------------------------------------*/


$elite_soccer_club_footer_background_color = get_theme_mod('elite_soccer_club_footer_background_color', '#151725');

if (!empty($elite_soccer_club_footer_background_color)) {
    $elite_soccer_club_common_inline_css .= ".footer-widgets { background: " . esc_attr($elite_soccer_club_footer_background_color) . "}";
}

/*----------------------------------------------------------------------------------*/

$elite_soccer_club_footer_background_image = get_theme_mod('elite_soccer_club_footer_background_image', '');

if (!empty($elite_soccer_club_footer_background_image)) {
    $elite_soccer_club_common_inline_css .= ".footer-widgets { background-image: url('" . esc_url($elite_soccer_club_footer_background_image) . "') !important; background-size: cover; background-repeat: no-repeat; }";
}

/*----------------------------------------------------------------------------------*/

$elite_soccer_club_copyright_alignment = get_theme_mod('elite_soccer_club_copyright_alignment', 'Center');

$elite_soccer_club_copyright_alignment_styles = [
    'Left' => 'text-align: left;',
    'Center' => 'text-align: center;',
    'Right' => 'text-align: right;'
];

$alignment_style = $elite_soccer_club_copyright_alignment_styles[$elite_soccer_club_copyright_alignment] ?? $elite_soccer_club_copyright_alignment_styles['Center'];

$elite_soccer_club_common_inline_css .= "#footer-copyright p { $alignment_style }";

/*----------------------------------------------------------------------------------*/   

$elite_soccer_club_container_width = get_theme_mod('elite_soccer_club_container_width');

if (!empty($elite_soccer_club_container_width)) {
    $elite_soccer_club_common_inline_css .= "@media (min-width: 1024px) { 
        body, #header.nav-stick.header-fixed,.admin-bar .header-fixed,.loading,.page-template-template-homepage #header { 
            width: " . esc_attr($elite_soccer_club_container_width) . "%; 
            margin: 0 auto; 
        } 
        .admin-bar .header-fixed { 
            margin-top: 32px !important; 
        } 
    }";
}

/*----------------------------------------------------------------------------------*/   

$elite_soccer_club_responsive_scroll_to_top_setting = get_theme_mod( 'elite_soccer_club_responsive_scroll_to_top_setting', true );

if ( $elite_soccer_club_responsive_scroll_to_top_setting == true && get_theme_mod( 'elite_soccer_club_scroll_to_top_setting', true ) != true ) {
    $elite_soccer_club_common_inline_css .= "a.scrollup,button#scroll_2 {
        display: none !important;
    }";
}

if ( $elite_soccer_club_responsive_scroll_to_top_setting == true ) {
    $elite_soccer_club_common_inline_css .= "@media screen and (max-width: 768px) {
        a.scrollup,button#scroll_2 {
            display: block !important;
        }
    }";
} elseif ( $elite_soccer_club_responsive_scroll_to_top_setting == false ) {
    $elite_soccer_club_common_inline_css .= "@media screen and (max-width: 768px) {
        a.scrollup,button#scroll_2 {
            display: none !important;
        }
    }";
}

/*----------------------------------------------------------------------------------*/ 

$elite_soccer_club_responsive_preloader_setting = get_theme_mod( 'elite_soccer_club_responsive_preloader_setting', false );

if ( $elite_soccer_club_responsive_preloader_setting == true && get_theme_mod( 'elite_soccer_club_preloader_setting', false ) == false ) {
    $elite_soccer_club_common_inline_css .= "@media screen and (min-width: 768px) {
        .loading {
            display: none !important;
        }
    }";
}

if ( $elite_soccer_club_responsive_preloader_setting == false ) {
    $elite_soccer_club_common_inline_css .= "@media screen and (max-width: 768px) {
        .loading {
            display: none !important;
        }
    }";
}

/*----------------------------------------------------------------------------------*/ 


/*---------------------------Global Color-------------------*/

$elite_soccer_club_theme_color_1 = get_theme_mod('elite_soccer_club_theme_color_1');
$elite_soccer_club_theme_color_2 = get_theme_mod('elite_soccer_club_theme_color_2');

/*--- First Global Color ---*/

if ($elite_soccer_club_theme_color_1) {
  $elite_soccer_club_common_inline_css .= ':root {';
  $elite_soccer_club_common_inline_css .= '--first-color: ' . esc_attr($elite_soccer_club_theme_color_1) . ' !important;';
  $elite_soccer_club_common_inline_css .= '} ';
}

/*--- Second Global Color ---*/

if ($elite_soccer_club_theme_color_2) {
  $elite_soccer_club_common_inline_css .= ':root {';
  $elite_soccer_club_common_inline_css .= '--second-color: ' . esc_attr($elite_soccer_club_theme_color_2) . ' !important;';
  $elite_soccer_club_common_inline_css .= '} ';
}