<?php

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

$film_celebrity_common_inline_css = '';

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

$film_celebrity_alignment_styles = [
    'Left' => 'left: 20px;',
    'Center' => 'right: 0; left: 0; margin: 0 auto;',
    'Right' => 'right: 20px;'
];

$alignment_style = $film_celebrity_alignment_styles[$film_celebrity_scroll_top_alignment] ?? $film_celebrity_alignment_styles['Right'];

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

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

$film_celebrity_footer_background_color = get_theme_mod('film_celebrity_footer_background_color', '#333233');

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

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

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

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

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

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

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

$alignment_style = $film_celebrity_copyright_alignment_styles[$film_celebrity_copyright_alignment] ?? $film_celebrity_copyright_alignment_styles['Center'];

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

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

$film_celebrity_container_width = get_theme_mod('film_celebrity_container_width');

if (!empty($film_celebrity_container_width)) {
    $film_celebrity_common_inline_css .= "@media (min-width: 1024px) { 
        body, .navbar-area.header-fixed, .admin-bar .header-fixed,.loading { 
            width: " . esc_attr($film_celebrity_container_width) . "%; 
            margin: 0 auto; 
        } 
        .admin-bar .header-fixed { 
            margin-top: 32px; 
        } 
    }";
}

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

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

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

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

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

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

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

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

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

$film_celebrity_theme_color_1 = get_theme_mod('film_celebrity_theme_color_1');
$film_celebrity_theme_color_2 = get_theme_mod('film_celebrity_theme_color_2');
$film_celebrity_theme_color_3 = get_theme_mod('film_celebrity_theme_color_3');
$film_celebrity_theme_color_4 = get_theme_mod('film_celebrity_theme_color_4');

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

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

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

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

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

if ($film_celebrity_theme_color_2) {
  $film_celebrity_common_inline_css .= ':root {';
  $film_celebrity_common_inline_css .= '--third-color: ' . esc_attr($film_celebrity_theme_color_3) . ' !important;';
  $film_celebrity_common_inline_css .= '} ';
}

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

if ($film_celebrity_theme_color_2) {
  $film_celebrity_common_inline_css .= ':root {';
  $film_celebrity_common_inline_css .= '--fourth-color: ' . esc_attr($film_celebrity_theme_color_4) . ' !important;';
  $film_celebrity_common_inline_css .= '} ';
}