<?php

    $ai_services_theme_css= "";

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

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

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

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

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

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

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

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

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

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

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

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

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

    $ai_services_first_color = get_theme_mod('ai_services_first_color');
    $ai_services_second_color = get_theme_mod('ai_services_second_color');

    if ($ai_services_first_color) {
        $ai_services_theme_css .= ':root {';
        $ai_services_theme_css .= '--first-color: ' . esc_attr($ai_services_first_color) . ' !important;';
        $ai_services_theme_css .= '} ';
    }
    
    if ($ai_services_second_color) {
        $ai_services_theme_css .= ':root {';
        $ai_services_theme_css .= '--second-color: ' . esc_attr($ai_services_second_color) . ' !important;';
        $ai_services_theme_css .= '} ';
    }

    

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

    $ai_services_heading_color = get_theme_mod('ai_services_heading_color');
    $ai_services_heading_font_family = get_theme_mod('ai_services_heading_font_family');
    $ai_services_heading_font_size = get_theme_mod('ai_services_heading_font_size');
    if($ai_services_heading_color != false || $ai_services_heading_font_family != false || $ai_services_heading_font_size != false){
        $ai_services_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,.featured h3.main-heading, .article-box h3.entry-title, .featured h4.main-heading, #colophon h5, .sidebar h5{';
            $ai_services_theme_css .='color: '.esc_attr($ai_services_heading_color).'!important; 
            font-family: '.esc_attr($ai_services_heading_font_family).'!important;
            font-size: '.esc_attr($ai_services_heading_font_size).'px !important;';
        $ai_services_theme_css .='}';
    }

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

    /*---------------- Logo CSS ----------------------*/
    $ai_services_logo_title_font_size = get_theme_mod( 'ai_services_logo_title_font_size');
    $ai_services_logo_tagline_font_size = get_theme_mod( 'ai_services_logo_tagline_font_size');
    if( $ai_services_logo_title_font_size != '') {
        $ai_services_theme_css .='#masthead .navbar-brand a{';
            $ai_services_theme_css .='font-size: '. absint( $ai_services_logo_title_font_size ). 'px;';
        $ai_services_theme_css .='}';
    }
    if( $ai_services_logo_tagline_font_size != '') {
        $ai_services_theme_css .='#masthead .navbar-brand p{';
            $ai_services_theme_css .='font-size: '. absint( $ai_services_logo_tagline_font_size ). 'px;';
        $ai_services_theme_css .='}';
    }