<?php

    $academic_tutor_theme_css= "";

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

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

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

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

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

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

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

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

    /*---------------------------Width Layout -------------------*/

    $academic_tutor_width_option = get_theme_mod( 'academic_tutor_width_option','Full Width');
    if($academic_tutor_width_option == 'Boxed Width'){
        $academic_tutor_theme_css .='body{';
            $academic_tutor_theme_css .='max-width: 1140px; width: 100%; padding-right: 15px; padding-left: 15px; margin-right: auto; margin-left: auto;';
        $academic_tutor_theme_css .='}';
        $academic_tutor_theme_css .='.scrollup i{';
            $academic_tutor_theme_css .='right: 100px;';
        $academic_tutor_theme_css .='}';
        $academic_tutor_theme_css .='.page-template-custom-home-page .home-page-header{';
            $academic_tutor_theme_css .='padding: 0px 40px 0 10px;';
        $academic_tutor_theme_css .='}';
    }else if($academic_tutor_width_option == 'Wide Width'){
        $academic_tutor_theme_css .='body{';
            $academic_tutor_theme_css .='width: 100%;padding-right: 15px;padding-left: 15px;margin-right: auto;margin-left: auto;';
        $academic_tutor_theme_css .='}';
        $academic_tutor_theme_css .='.scrollup i{';
            $academic_tutor_theme_css .='right: 30px;';
        $academic_tutor_theme_css .='}';
    }else if($academic_tutor_width_option == 'Full Width'){
        $academic_tutor_theme_css .='body{';
            $academic_tutor_theme_css .='max-width: 100%;';
        $academic_tutor_theme_css .='}';
    }

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

    $academic_tutor_first_color = get_theme_mod('academic_tutor_first_color');
    $academic_tutor_second_color = get_theme_mod('academic_tutor_second_color');

    if ($academic_tutor_first_color) {
        $academic_tutor_theme_css .= ':root {';
        $academic_tutor_theme_css .= '--first-color: ' . esc_attr($academic_tutor_first_color) . ' !important;';
        $academic_tutor_theme_css .= '} ';
    }
    
    if ($academic_tutor_second_color) {
        $academic_tutor_theme_css .= ':root {';
        $academic_tutor_theme_css .= '--second-color: ' . esc_attr($academic_tutor_second_color) . ' !important;';
        $academic_tutor_theme_css .= '} ';
    }


    /*-------------------- Heading typography -------------------*/

    $academic_tutor_heading_color = get_theme_mod('academic_tutor_heading_color');
    $academic_tutor_heading_font_family = get_theme_mod('academic_tutor_heading_font_family');
    $academic_tutor_heading_font_size = get_theme_mod('academic_tutor_heading_font_size');
    if($academic_tutor_heading_color != false || $academic_tutor_heading_font_family != false || $academic_tutor_heading_font_size != false){
        $academic_tutor_theme_css .='h1, h2, h3, h4, h5, h6, .navbar-brand h1.site-title, h2.entry-title, h1.entry-title, h2.page-title, #latest_post h2, h2.woocommerce-loop-product__title, #top-slider .slider-inner-box h3, .featured h3.main-heading, .article-box h3.entry-title, .featured h4.main-heading, #colophon h5, .sidebar h5{';
            $academic_tutor_theme_css .='color: '.esc_attr($academic_tutor_heading_color).'!important; 
            font-family: '.esc_attr($academic_tutor_heading_font_family).'!important;
            font-size: '.esc_attr($academic_tutor_heading_font_size).'px !important;';
        $academic_tutor_theme_css .='}';
    }

    $academic_tutor_paragraph_color = get_theme_mod('academic_tutor_paragraph_color');
    $academic_tutor_paragraph_font_family = get_theme_mod('academic_tutor_paragraph_font_family');
    $academic_tutor_paragraph_font_size = get_theme_mod('academic_tutor_paragraph_font_size');
    if($academic_tutor_paragraph_color != false || $academic_tutor_paragraph_font_family != false || $academic_tutor_paragraph_font_size != false){
        $academic_tutor_theme_css .='p, p.site-title, span, .article-box p, ul, li{';
            $academic_tutor_theme_css .='color: '.esc_attr($academic_tutor_paragraph_color).'!important; 
            font-family: '.esc_attr($academic_tutor_paragraph_font_family).'!important;
            font-size: '.esc_attr($academic_tutor_paragraph_font_size).'px !important;';
        $academic_tutor_theme_css .='}';
    }

    /*---------------- Logo CSS ----------------------*/
    $academic_tutor_logo_title_font_size = get_theme_mod( 'academic_tutor_logo_title_font_size');
    $academic_tutor_logo_tagline_font_size = get_theme_mod( 'academic_tutor_logo_tagline_font_size');
    if( $academic_tutor_logo_title_font_size != '') {
        $academic_tutor_theme_css .='#masthead .navbar-brand a{';
            $academic_tutor_theme_css .='font-size: '. $academic_tutor_logo_title_font_size. 'px;';
        $academic_tutor_theme_css .='}';
    }
    if( $academic_tutor_logo_tagline_font_size != '') {
        $academic_tutor_theme_css .='#masthead .navbar-brand p{';
            $academic_tutor_theme_css .='font-size: '. $academic_tutor_logo_tagline_font_size. 'px;';
        $academic_tutor_theme_css .='}';
    }

    /*---------------- Header CSS ----------------------*/
    $academic_tutor_banner_section_setting = get_theme_mod( 'academic_tutor_banner_section_setting',false);
    if( $academic_tutor_banner_section_setting != true) {
        $academic_tutor_theme_css .='.page-template-home-template .socialmedia{';
            $academic_tutor_theme_css .='background:linear-gradient(180deg, var(--first-color) 0%, var(--second-color) 100%); position:static;';
        $academic_tutor_theme_css .='}';
    }

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

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


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

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

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

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


    /*--------------------------- Featured Image Border Radius -------------------*/

    $academic_tutor_post_page_image_border_radius = get_theme_mod('academic_tutor_post_page_image_border_radius', 0);
    if($academic_tutor_post_page_image_border_radius != false){
        $academic_tutor_theme_css .='.article-box img{';
            $academic_tutor_theme_css .='border-radius: '.esc_attr($academic_tutor_post_page_image_border_radius).'px;';
        $academic_tutor_theme_css .='}';
    }

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

    $academic_tutor_post_page_image_box_shadow = get_theme_mod('academic_tutor_post_page_image_box_shadow',0);
    if($academic_tutor_post_page_image_box_shadow != false){
        $academic_tutor_theme_css .='.article-box img{';
            $academic_tutor_theme_css .='box-shadow: '.esc_attr($academic_tutor_post_page_image_box_shadow).'px '.esc_attr($academic_tutor_post_page_image_box_shadow).'px '.esc_attr($academic_tutor_post_page_image_box_shadow).'px #cccccc;';
        $academic_tutor_theme_css .='}';
    }

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

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

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

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

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

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

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

    $academic_tutor_nav_menu = get_theme_mod( 'academic_tutor_nav_menu_text_transform','Capitalize');
    if($academic_tutor_nav_menu == 'Capitalize'){
        $academic_tutor_theme_css .='.site-navigation .primary-menu > li > a{';
            $academic_tutor_theme_css .='text-transform:Capitalize;';
        $academic_tutor_theme_css .='}';
    }
    if($academic_tutor_nav_menu == 'Lowercase'){
        $academic_tutor_theme_css .='.site-navigation .primary-menu > li > a{';
            $academic_tutor_theme_css .='text-transform:Lowercase;';
        $academic_tutor_theme_css .='}';
    }
    if($academic_tutor_nav_menu == 'Uppercase'){
        $academic_tutor_theme_css .='.site-navigation .primary-menu > li > a{';
            $academic_tutor_theme_css .='text-transform:Uppercase;';
        $academic_tutor_theme_css .='}';
    }

    $academic_tutor_menu_font_size = get_theme_mod( 'academic_tutor_menu_font_size');
    if($academic_tutor_menu_font_size != ''){
        $academic_tutor_theme_css .='.site-navigation .primary-menu > li > a{';
            $academic_tutor_theme_css .='font-size: '.esc_attr($academic_tutor_menu_font_size).'px;';
        $academic_tutor_theme_css .='}';
    }

    $academic_tutor_nav_menu_font_weight = get_theme_mod( 'academic_tutor_nav_menu_font_weight',600);
    if($academic_tutor_menu_font_size != ''){
        $academic_tutor_theme_css .='.site-navigation .primary-menu > li > a{';
            $academic_tutor_theme_css .='font-weight: '.esc_attr($academic_tutor_nav_menu_font_weight).';';
        $academic_tutor_theme_css .='}';
    }

    /*--------------------------- Product Image Box Shadow -------------------*/

    $academic_tutor_woo_product_image_box_shadow = get_theme_mod('academic_tutor_woo_product_image_box_shadow',0);
    if($academic_tutor_woo_product_image_box_shadow != false){
        $academic_tutor_theme_css .='.woocommerce ul.products li.product a img{';
            $academic_tutor_theme_css .='box-shadow: '.esc_attr($academic_tutor_woo_product_image_box_shadow).'px '.esc_attr($academic_tutor_woo_product_image_box_shadow).'px '.esc_attr($academic_tutor_woo_product_image_box_shadow).'px #cccccc;';
        $academic_tutor_theme_css .='}';
    }