<?php

    $audio_player_theme_css= "";

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

    $audio_player_global_color = get_theme_mod('audio_player_global_color');

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

    /*--------------------------- Scroll to top positions -------------------*/

    $audio_player_scroll_position = get_theme_mod( 'audio_player_scroll_top_position','Right');
    if($audio_player_scroll_position == 'Right'){
        $audio_player_theme_css .='#button{';
            $audio_player_theme_css .='right: 20px;';
        $audio_player_theme_css .='}';
    }else if($audio_player_scroll_position == 'Left'){
        $audio_player_theme_css .='#button{';
            $audio_player_theme_css .='left: 20px;';
        $audio_player_theme_css .='}';
    }else if($audio_player_scroll_position == 'Center'){
        $audio_player_theme_css .='#button{';
            $audio_player_theme_css .='right: 50%;left: 50%;';
        $audio_player_theme_css .='}';
    }

    /*--------------------------- Scroll To Top Border Radius -------------------*/

    $audio_player_scroll_to_top_border_radius = get_theme_mod('audio_player_scroll_to_top_border_radius');
    $audio_player_scroll_bg_color = get_theme_mod('audio_player_scroll_bg_color');
    $audio_player_scroll_color = get_theme_mod('audio_player_scroll_color');
    $audio_player_scroll_font_size = get_theme_mod('audio_player_scroll_font_size');
    if($audio_player_scroll_to_top_border_radius != false || $audio_player_scroll_bg_color != false || $audio_player_scroll_color != false || $audio_player_scroll_font_size != false){
        $audio_player_theme_css .='#colophon a#button{';
            $audio_player_theme_css .='border-radius: '.esc_attr($audio_player_scroll_to_top_border_radius).'px; background-color: '.esc_attr($audio_player_scroll_bg_color).'; color: '.esc_attr($audio_player_scroll_color).' !important; font-size: '.esc_attr($audio_player_scroll_font_size).'px;';
        $audio_player_theme_css .='}';
    }

    /*--------------------------- Slider Opacity -------------------*/

    $audio_player_theme_lay = get_theme_mod( 'audio_player_slider_opacity_color','0.5');
    if($audio_player_theme_lay == '0'){
        $audio_player_theme_css .='.slider-box img{';
            $audio_player_theme_css .='opacity:0';
        $audio_player_theme_css .='}';
        }else if($audio_player_theme_lay == '0.1'){
        $audio_player_theme_css .='.slider-box img{';
            $audio_player_theme_css .='opacity:0.1';
        $audio_player_theme_css .='}';
        }else if($audio_player_theme_lay == '0.2'){
        $audio_player_theme_css .='.slider-box img{';
            $audio_player_theme_css .='opacity:0.2';
        $audio_player_theme_css .='}';
        }else if($audio_player_theme_lay == '0.3'){
        $audio_player_theme_css .='.slider-box img{';
            $audio_player_theme_css .='opacity:0.3';
        $audio_player_theme_css .='}';
        }else if($audio_player_theme_lay == '0.4'){
        $audio_player_theme_css .='.slider-box img{';
            $audio_player_theme_css .='opacity:0.4';
        $audio_player_theme_css .='}';
        }else if($audio_player_theme_lay == '0.5'){
        $audio_player_theme_css .='.slider-box img{';
            $audio_player_theme_css .='opacity:0.5';
        $audio_player_theme_css .='}';
        }else if($audio_player_theme_lay == '0.6'){
        $audio_player_theme_css .='.slider-box img{';
            $audio_player_theme_css .='opacity:0.6';
        $audio_player_theme_css .='}';
        }else if($audio_player_theme_lay == '0.7'){
        $audio_player_theme_css .='.slider-box img{';
            $audio_player_theme_css .='opacity:0.7';
        $audio_player_theme_css .='}';
        }else if($audio_player_theme_lay == '0.8'){
        $audio_player_theme_css .='.slider-box img{';
            $audio_player_theme_css .='opacity:0.8';
        $audio_player_theme_css .='}';
        }else if($audio_player_theme_lay == '0.9'){
        $audio_player_theme_css .='.slider-box img{';
            $audio_player_theme_css .='opacity:0.9';
        $audio_player_theme_css .='}';
        }

    /*---------------- Single post Settings ------------------*/

    $audio_player_single_post_navigation_show_hide = get_theme_mod('audio_player_single_post_navigation_show_hide',true);
    if($audio_player_single_post_navigation_show_hide != true){
        $audio_player_theme_css .='.nav-links{';
            $audio_player_theme_css .='display: none;';
        $audio_player_theme_css .='}';
    }

    /*---------------------------Slider Height ------------*/

    $audio_player_slider_img_height = get_theme_mod('audio_player_slider_img_height');
    if($audio_player_slider_img_height != false){
        $audio_player_theme_css .='#top-slider .owl-carousel .owl-item img{';
            $audio_player_theme_css .='height: '.esc_attr($audio_player_slider_img_height).';';
        $audio_player_theme_css .='}';
    }

     /*--------------------------- Woocommerce Product Sale Positions -------------------*/

    $audio_player_product_sale = get_theme_mod( 'audio_player_woocommerce_product_sale','Right');
    if($audio_player_product_sale == 'Right'){
        $audio_player_theme_css .='.woocommerce ul.products li.product .onsale{';
            $audio_player_theme_css .='left: auto; right: 15px;';
        $audio_player_theme_css .='}';
    }else if($audio_player_product_sale == 'Left'){
        $audio_player_theme_css .='.woocommerce ul.products li.product .onsale{';
            $audio_player_theme_css .='left: 15px; right: auto;';
        $audio_player_theme_css .='}';
    }else if($audio_player_product_sale == 'Center'){
        $audio_player_theme_css .='.woocommerce ul.products li.product .onsale{';
            $audio_player_theme_css .='right: 50%;left: 50%;';
        $audio_player_theme_css .='}';
    }

    /*--------------------------- Woocommerce Product Border Radius -------------------*/

    $audio_player_woo_product_border_radius = get_theme_mod('audio_player_woo_product_border_radius', 0);
    if($audio_player_woo_product_border_radius != false){
        $audio_player_theme_css .='.woocommerce ul.products li.product a img{';
            $audio_player_theme_css .='border-radius: '.esc_attr($audio_player_woo_product_border_radius).'px;';
        $audio_player_theme_css .='}';
    }

    /*--------------------------- Woocommerce Product Sale Border Radius -------------------*/

    $audio_player_woo_product_sale_border_radius = get_theme_mod('audio_player_woo_product_sale_border_radius');
    if($audio_player_woo_product_sale_border_radius != false){
        $audio_player_theme_css .='.woocommerce ul.products li.product .onsale{';
            $audio_player_theme_css .='border-radius: '.esc_attr($audio_player_woo_product_sale_border_radius).'px;';
        $audio_player_theme_css .='}';
    }

    /*--------------------------- Single Post Page Image Box Shadow -------------------*/

    $audio_player_single_post_page_image_box_shadow = get_theme_mod('audio_player_single_post_page_image_box_shadow',0);
    if($audio_player_single_post_page_image_box_shadow != false){
        $audio_player_theme_css .='.single-post .entry-header img{';
            $audio_player_theme_css .='box-shadow: '.esc_attr($audio_player_single_post_page_image_box_shadow).'px '.esc_attr($audio_player_single_post_page_image_box_shadow).'px '.esc_attr($audio_player_single_post_page_image_box_shadow).'px #cccccc;';
        $audio_player_theme_css .='}';
    }

     /*--------------------------- Single Post Page Image Border Radius -------------------*/

    $audio_player_single_post_page_image_border_radius = get_theme_mod('audio_player_single_post_page_image_border_radius', 0);
    if($audio_player_single_post_page_image_border_radius != false){
        $audio_player_theme_css .='.single-post .entry-header img{';
            $audio_player_theme_css .='border-radius: '.esc_attr($audio_player_single_post_page_image_border_radius).'px;';
        $audio_player_theme_css .='}';
    }

    /*--------------------------- Footer Background Image Position -------------------*/

    $audio_player_footer_bg_image_position = get_theme_mod( 'audio_player_footer_bg_image_position','scroll');
    if($audio_player_footer_bg_image_position == 'fixed'){
        $audio_player_theme_css .='#colophon{';
            $audio_player_theme_css .='background-attachment: fixed !important; background-position: center !important;';
        $audio_player_theme_css .='}';
    }elseif ($audio_player_footer_bg_image_position == 'scroll'){
        $audio_player_theme_css .='#colophon{';
            $audio_player_theme_css .='background-attachment: scroll !important; background-position: center !important;';
        $audio_player_theme_css .='}';
    }

    /*--------------------------- Footer Widget Heading Alignment -------------------*/

    $audio_player_footer_widget_heading_alignment = get_theme_mod( 'audio_player_footer_widget_heading_alignment','Left');
    if($audio_player_footer_widget_heading_alignment == 'Left'){
        $audio_player_theme_css .='#colophon h5, h5.footer-column-widget-title{';
        $audio_player_theme_css .='text-align: left;';
        $audio_player_theme_css .='}';
    }else if($audio_player_footer_widget_heading_alignment == 'Center'){
        $audio_player_theme_css .='#colophon h5, h5.footer-column-widget-title{';
            $audio_player_theme_css .='text-align: center;';
        $audio_player_theme_css .='}';
    }else if($audio_player_footer_widget_heading_alignment == 'Right'){
        $audio_player_theme_css .='#colophon h5, h5.footer-column-widget-title{';
            $audio_player_theme_css .='text-align: right;';
        $audio_player_theme_css .='}';
    }

    /*--------------------------- Footer background image -------------------*/

    $audio_player_footer_bg_image = get_theme_mod('audio_player_footer_bg_image');
    if($audio_player_footer_bg_image != false){
        $audio_player_theme_css .='#colophon{';
            $audio_player_theme_css .='background: url('.esc_attr($audio_player_footer_bg_image).');';
        $audio_player_theme_css .='}';
    }

    /*--------------------------- Copyright Background Color -------------------*/

    $audio_player_copyright_background_color = get_theme_mod('audio_player_copyright_background_color');
    if($audio_player_copyright_background_color != false){
        $audio_player_theme_css .='.footer_info{';
            $audio_player_theme_css .='background-color: '.esc_attr($audio_player_copyright_background_color).' !important;';
        $audio_player_theme_css .='}';
    } 

    /*--------------------------- Site Title And Tagline Color -------------------*/

    $audio_player_logo_title_color = get_theme_mod('audio_player_logo_title_color');
    if($audio_player_logo_title_color != false){
        $audio_player_theme_css .='p.site-title a, .navbar-brand a{';
            $audio_player_theme_css .='color: '.esc_attr($audio_player_logo_title_color).' !important;';
        $audio_player_theme_css .='}';
    }

    $audio_player_logo_tagline_color = get_theme_mod('audio_player_logo_tagline_color');
    if($audio_player_logo_tagline_color != false){
        $audio_player_theme_css .='.logo p.site-description, .navbar-brand p{';
            $audio_player_theme_css .='color: '.esc_attr($audio_player_logo_tagline_color).'  !important;';
        $audio_player_theme_css .='}';
    }

    /*--------------------------- Footer Widget Content Alignment -------------------*/

    $audio_player_footer_widget_content_alignment = get_theme_mod( 'audio_player_footer_widget_content_alignment','Left');
    if($audio_player_footer_widget_content_alignment == 'Left'){
        $audio_player_theme_css .='#colophon ul, #colophon p, .tagcloud, .widget{';
        $audio_player_theme_css .='text-align: left;';
        $audio_player_theme_css .='}';
    }else if($audio_player_footer_widget_content_alignment == 'Center'){
        $audio_player_theme_css .='#colophon ul, #colophon p, .tagcloud, .widget{';
            $audio_player_theme_css .='text-align: center;';
        $audio_player_theme_css .='}';
    }else if($audio_player_footer_widget_content_alignment == 'Right'){
        $audio_player_theme_css .='#colophon ul, #colophon p, .tagcloud, .widget{';
            $audio_player_theme_css .='text-align: right;';
        $audio_player_theme_css .='}';
    }

    /*--------------------------- Copyright Content Alignment -------------------*/

    $audio_player_copyright_content_alignment = get_theme_mod( 'audio_player_copyright_content_alignment','Center');
    if($audio_player_copyright_content_alignment == 'Left'){
        $audio_player_theme_css .='.footer-menu-left{';
        $audio_player_theme_css .='text-align: left;';
        $audio_player_theme_css .='}';
    }else if($audio_player_copyright_content_alignment == 'Center'){
        $audio_player_theme_css .='.footer-menu-left{';
            $audio_player_theme_css .='text-align: center;';
        $audio_player_theme_css .='}';
    }else if($audio_player_copyright_content_alignment == 'Right'){
        $audio_player_theme_css .='.footer-menu-left{';
            $audio_player_theme_css .='text-align: right;';
        $audio_player_theme_css .='}';
    }

    /*------------------ Nav Menus -------------------*/

    $audio_player_nav_menu = get_theme_mod( 'audio_player_nav_menu_text_transform','Uppercase');
    if($audio_player_nav_menu == 'Capitalize'){
        $audio_player_theme_css .='.main-navigation .menu > li > a{';
            $audio_player_theme_css .='text-transform:Capitalize;';
        $audio_player_theme_css .='}';
    }
    if($audio_player_nav_menu == 'Lowercase'){
        $audio_player_theme_css .='.main-navigation .menu > li > a{';
            $audio_player_theme_css .='text-transform:Lowercase;';
        $audio_player_theme_css .='}';
    }
    if($audio_player_nav_menu == 'Uppercase'){
        $audio_player_theme_css .='.main-navigation .menu > li > a{';
            $audio_player_theme_css .='text-transform:Uppercase;';
        $audio_player_theme_css .='}';
    }

    $audio_player_menu_font_size = get_theme_mod( 'audio_player_menu_font_size');
    if($audio_player_menu_font_size != ''){
        $audio_player_theme_css .='.main-navigation .menu > li > a{';
            $audio_player_theme_css .='font-size: '.esc_attr($audio_player_menu_font_size).'px;';
        $audio_player_theme_css .='}';
    }

    $audio_player_nav_menu_font_weight = get_theme_mod( 'audio_player_nav_menu_font_weight',400);
    if($audio_player_menu_font_size != ''){
        $audio_player_theme_css .='.main-navigation .menu > li > a{';
            $audio_player_theme_css .='font-weight: '.esc_attr($audio_player_nav_menu_font_weight).';';
        $audio_player_theme_css .='}';
    }

    /*------------------ Slider CSS -------------------*/

    $audio_player_slider_content_layout = get_theme_mod( 'audio_player_slider_content_layout','Left');
    if($audio_player_slider_content_layout == 'Left'){
        $audio_player_theme_css .='.slider-inner-box, #top-slider .slider-inner-box p{';
            $audio_player_theme_css .='text-align : left;';
        $audio_player_theme_css .='}';
    }
    if($audio_player_slider_content_layout == 'Center'){
        $audio_player_theme_css .='.slider-inner-box, #top-slider .slider-inner-box p{';
            $audio_player_theme_css .='text-align : center;';
        $audio_player_theme_css .='}';
        $audio_player_theme_css .='.slider-inner-box{';
            $audio_player_theme_css .='right : 30%; left: 30%';
        $audio_player_theme_css .='}';
    }
    if($audio_player_slider_content_layout == 'Right'){
        $audio_player_theme_css .='.slider-inner-box, #top-slider .slider-inner-box p{';
            $audio_player_theme_css .='text-align : right;';
        $audio_player_theme_css .='}';
        $audio_player_theme_css .='.slider-inner-box{';
            $audio_player_theme_css .='right : 15%; left: 32%';
        $audio_player_theme_css .='}';
    }

    /*------------------ Slider CSS -------------------*/
    $audio_player_slider_opacity_setting = get_theme_mod( 'audio_player_slider_opacity_setting',true);
    $audio_player_image_opacity_color = get_theme_mod( 'audio_player_image_opacity_color');
    $audio_player_slider_opacity = get_theme_mod( 'audio_player_slider_opacity');
    if( $audio_player_slider_opacity_setting != false) {
        $audio_player_theme_css .='#top-slider .slider-box img{';
            $audio_player_theme_css .='opacity: '. $audio_player_slider_opacity. ';';
        $audio_player_theme_css .='}';
        if( $audio_player_image_opacity_color != '') {
            $audio_player_theme_css .='#top-slider .slider-box {';
                $audio_player_theme_css .='background-color: '. $audio_player_image_opacity_color. ';';
            $audio_player_theme_css .='}';
        }
    } else {
        $audio_player_theme_css .='#top-slider .slider-box img{';
            $audio_player_theme_css .='opacity: 1;';
        $audio_player_theme_css .='}';
    }

    /*------------------ Footer CSS -------------------*/
    $audio_player_footer_bg_color = get_theme_mod( 'audio_player_footer_bg_color');
    if($audio_player_footer_bg_color != '' ){
        $audio_player_theme_css .='#colophon {';
            $audio_player_theme_css .='background-color: '.esc_attr($audio_player_footer_bg_color).'; ';
        $audio_player_theme_css .='}';
    }

    $audio_player_footer_content_color = get_theme_mod( 'audio_player_footer_content_color');
    if($audio_player_footer_content_color != ''){
        $audio_player_theme_css .='#colophon, #colophon a, #colophon h5, #colophon .widget #wp-calendar caption {';
            $audio_player_theme_css .='color: '.esc_attr($audio_player_footer_content_color).';';
        $audio_player_theme_css .='}';
    }

    /*------------------ Copyright CSS -------------------*/
    $audio_player_copyright_text_color = get_theme_mod( 'audio_player_copyright_text_color');
    if($audio_player_copyright_text_color != ''){
        $audio_player_theme_css .='#colophon .site-info a, #colophon .site-info span {';
            $audio_player_theme_css .='color: '.esc_attr($audio_player_copyright_text_color).';';
        $audio_player_theme_css .='}';
    }