<?php

$online_learning_lms_custom_css = "";

	$online_learning_lms_theme_pagination_options_alignment = get_theme_mod('online_learning_lms_theme_pagination_options_alignment', 'Center');
	if ($online_learning_lms_theme_pagination_options_alignment == 'Center') {
		$online_learning_lms_custom_css .= '.navigation.pagination,.navigation.posts-navigation .nav-links{';
		$online_learning_lms_custom_css .= 'justify-content: center;margin: 0 auto;';
		$online_learning_lms_custom_css .= '}';
	} else if ($online_learning_lms_theme_pagination_options_alignment == 'Right') {
		$online_learning_lms_custom_css .= '.navigation.pagination,.navigation.posts-navigation .nav-links{';
		$online_learning_lms_custom_css .= 'justify-content: right;margin: 0 0 0 auto;';
		$online_learning_lms_custom_css .= '}';
	} else if ($online_learning_lms_theme_pagination_options_alignment == 'Left') {
		$online_learning_lms_custom_css .= '.navigation.pagination,.navigation.posts-navigation .nav-links{';
		$online_learning_lms_custom_css .= 'justify-content: left;margin: 0 auto 0 0;';
		$online_learning_lms_custom_css .= '}';
	}

	$online_learning_lms_theme_breadcrumb_enable = get_theme_mod('online_learning_lms_theme_breadcrumb_enable',true);
    if($online_learning_lms_theme_breadcrumb_enable != true){
        $online_learning_lms_custom_css .='nav.breadcrumb-trail.breadcrumbs,nav.woocommerce-breadcrumb{';
            $online_learning_lms_custom_css .='display: none;';
        $online_learning_lms_custom_css .='}';
    }

	$online_learning_lms_theme_breadcrumb_options_alignment = get_theme_mod('online_learning_lms_theme_breadcrumb_options_alignment', 'Left');
	if ($online_learning_lms_theme_breadcrumb_options_alignment == 'Center') {
	    $online_learning_lms_custom_css .= '.breadcrumbs ul,nav.woocommerce-breadcrumb{';
	    $online_learning_lms_custom_css .= 'text-align: center !important;';
	    $online_learning_lms_custom_css .= '}';
	} else if ($online_learning_lms_theme_breadcrumb_options_alignment == 'Right') {
	    $online_learning_lms_custom_css .= '.breadcrumbs ul,nav.woocommerce-breadcrumb{';
	    $online_learning_lms_custom_css .= 'text-align: Right !important;';
	    $online_learning_lms_custom_css .= '}';
	} else if ($online_learning_lms_theme_breadcrumb_options_alignment == 'Left') {
	    $online_learning_lms_custom_css .= '.breadcrumbs ul,nav.woocommerce-breadcrumb{';
	    $online_learning_lms_custom_css .= 'text-align: Left !important;';
	    $online_learning_lms_custom_css .= '}';
	}

	$online_learning_lms_single_page_content_alignment = get_theme_mod('online_learning_lms_single_page_content_alignment', 'left');
	if ($online_learning_lms_single_page_content_alignment == 'left') {
	    $online_learning_lms_custom_css .= '#single-page .type-page,section.theme-custom-block.theme-error-sectiontheme-error-section.error-block-middle,section.theme-custom-block.theme-error-section.error-block-heading .theme-area-header{';
	    $online_learning_lms_custom_css .= 'text-align: left !important;';
	    $online_learning_lms_custom_css .= '}';
	} else if ($online_learning_lms_single_page_content_alignment == 'center') {
	    $online_learning_lms_custom_css .= '#single-page .type-page,section.theme-custom-block.theme-error-sectiontheme-error-section.error-block-middle,section.theme-custom-block.theme-error-section.error-block-heading .theme-area-header{';
	    $online_learning_lms_custom_css .= 'text-align: center !important;';
	    $online_learning_lms_custom_css .= '}';
	} else if ($online_learning_lms_single_page_content_alignment == 'right') {
	    $online_learning_lms_custom_css .= '#single-page .type-page,section.theme-custom-block.theme-error-sectiontheme-error-section.error-block-middle,section.theme-custom-block.theme-error-section.error-block-heading .theme-area-header{';
	    $online_learning_lms_custom_css .= 'text-align: right !important;';
	    $online_learning_lms_custom_css .= '}';
	}

	$online_learning_lms_single_post_content_alignment = get_theme_mod('online_learning_lms_single_post_content_alignment', 'left');
	if ($online_learning_lms_single_post_content_alignment == 'left') {
	    $online_learning_lms_custom_css .= '#single-page .type-post,#single-page .type-post .entry-meta,#single-page .type-post .is-layout-flex{';
	    $online_learning_lms_custom_css .= 'text-align: left !important;justify-content: left;';
	    $online_learning_lms_custom_css .= '}';
	} else if ($online_learning_lms_single_post_content_alignment == 'center') {
	    $online_learning_lms_custom_css .= '#single-page .type-post,#single-page .type-post .entry-meta,#single-page .type-post .is-layout-flex{';
	    $online_learning_lms_custom_css .= 'text-align: center !important;justify-content: center;';
	    $online_learning_lms_custom_css .= '}';
	} else if ($online_learning_lms_single_post_content_alignment == 'right') {
	    $online_learning_lms_custom_css .= '#single-page .type-post,#single-page .type-post .entry-meta,#single-page .type-post .is-layout-flex{';
	    $online_learning_lms_custom_css .= 'text-align: right !important;justify-content: right;';
	    $online_learning_lms_custom_css .= '}';
	}

	$online_learning_lms_menu_text_transform = get_theme_mod('online_learning_lms_menu_text_transform', 'uppercase');
	if ($online_learning_lms_menu_text_transform == 'Capitalize') {
	    $online_learning_lms_custom_css .= '.site-navigation .primary-menu > li a{';
	    $online_learning_lms_custom_css .= 'text-transform: Capitalize !important;';
	    $online_learning_lms_custom_css .= '}';
	} else if ($online_learning_lms_menu_text_transform == 'uppercase') {
	    $online_learning_lms_custom_css .= '.site-navigation .primary-menu > li a{';
	    $online_learning_lms_custom_css .= 'text-transform: uppercase !important;';
	    $online_learning_lms_custom_css .= '}';
	} else if ($online_learning_lms_menu_text_transform == 'lowercase') {
	    $online_learning_lms_custom_css .= '.site-navigation .primary-menu > li a{';
	    $online_learning_lms_custom_css .= 'text-transform: lowercase !important;';
	    $online_learning_lms_custom_css .= '}';
	}

	$online_learning_lms_footer_widget_title_alignment = get_theme_mod('online_learning_lms_footer_widget_title_alignment', 'left');
	if ($online_learning_lms_footer_widget_title_alignment == 'left') {
	    $online_learning_lms_custom_css .= 'h2.widget-title{';
	    $online_learning_lms_custom_css .= 'text-align: left !important;';
	    $online_learning_lms_custom_css .= '}';
	} else if ($online_learning_lms_footer_widget_title_alignment == 'center') {
	    $online_learning_lms_custom_css .= 'h2.widget-title{';
	    $online_learning_lms_custom_css .= 'text-align: center !important;';
	    $online_learning_lms_custom_css .= '}';
	} else if ($online_learning_lms_footer_widget_title_alignment == 'right') {
	    $online_learning_lms_custom_css .= 'h2.widget-title{';
	    $online_learning_lms_custom_css .= 'text-align: right !important;';
	    $online_learning_lms_custom_css .= '}';
	}

    $online_learning_lms_show_hide_related_product = get_theme_mod('online_learning_lms_show_hide_related_product',true);
    if($online_learning_lms_show_hide_related_product != true){
        $online_learning_lms_custom_css .='.related.products{';
            $online_learning_lms_custom_css .='display: none;';
        $online_learning_lms_custom_css .='}';
    }

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

	$online_learning_lms_global_color = get_theme_mod('online_learning_lms_global_color', '#754FFE'); // Add a fallback if the color isn't set

	if ($online_learning_lms_global_color) {
		$online_learning_lms_custom_css .= ':root {';
		$online_learning_lms_custom_css .= '--global-color: ' . esc_attr($online_learning_lms_global_color) . ';';
		$online_learning_lms_custom_css .= '}';
	}

	/*-------------------- Second First Color -------------------*/

	$online_learning_lms_global_colorr = get_theme_mod('online_learning_lms_global_colorr', '#00224D'); // Add a fallback if the color isn't set

	if ($online_learning_lms_global_colorr) {
		$online_learning_lms_custom_css .= ':root {';
		$online_learning_lms_custom_css .= '--global-colorr: ' . esc_attr($online_learning_lms_global_colorr) . ';';
		$online_learning_lms_custom_css .= '}';
	}

	/*-------------------- Content Font -------------------*/

	$online_learning_lms_content_typography_font = get_theme_mod('online_learning_lms_content_typography_font', 'Poppins, sans-serif'); // Add a fallback if the color isn't set

	if ($online_learning_lms_content_typography_font) {
		$online_learning_lms_custom_css .= ':root {';
		$online_learning_lms_custom_css .= '--font-main: ' . esc_attr($online_learning_lms_content_typography_font) . ';';
		$online_learning_lms_custom_css .= '}';
	}

	/*-------------------- Heading Font -------------------*/

	$online_learning_lms_heading_typography_font = get_theme_mod('online_learning_lms_heading_typography_font', 'playfair-display'); // Add a fallback if the color isn't set

	if ($online_learning_lms_heading_typography_font) {
		$online_learning_lms_custom_css .= ':root {';
		$online_learning_lms_custom_css .= '--font-head: ' . esc_attr($online_learning_lms_heading_typography_font) . ';';
		$online_learning_lms_custom_css .= '}';
	}

	$online_learning_lms_columns = get_theme_mod('online_learning_lms_posts_per_columns', 3);
	$online_learning_lms_columns = absint($online_learning_lms_columns);
	if ( $online_learning_lms_columns < 1 || $online_learning_lms_columns > 6 ) {
		$online_learning_lms_columns = 3;
	}
	$online_learning_lms_custom_css .= "
		.site-content .article-wraper-archive {
			grid-template-columns: repeat({$online_learning_lms_columns}, 1fr);
		}
	";

	$online_learning_lms_copyright_alignment = get_theme_mod( 'online_learning_lms_copyright_alignment', 'Default' );
	if ( $online_learning_lms_copyright_alignment === 'Reverse' ) {
		$online_learning_lms_custom_css .= '.site-info .column-row { flex-direction: row-reverse; }';
		$online_learning_lms_custom_css .= '.footer-credits { justify-content: flex-end; }';
		$online_learning_lms_custom_css .= '.footer-copyright { text-align: right; }';
		$online_learning_lms_custom_css .= '.site-info .column.column-3 { text-align: left; }';
	} elseif ( $online_learning_lms_copyright_alignment === 'Center' ) {
		$online_learning_lms_custom_css .= '.site-info .column-row { flex-direction: column; align-items: center; gap: 15px; }';
		$online_learning_lms_custom_css .= '.footer-credits { justify-content: center; }';
		$online_learning_lms_custom_css .= '.footer-copyright { text-align: center; }';
		$online_learning_lms_custom_css .= '.site-info .column.column-3 { text-align: center; }';
	}

	$online_learning_lms_footer_widget_background_color = get_theme_mod('online_learning_lms_footer_widget_background_color');
	if ($online_learning_lms_footer_widget_background_color) {

		$online_learning_lms_custom_css .= "
			.footer-widgetarea {
				background-color: ". esc_attr($online_learning_lms_footer_widget_background_color) .";
			}
		";
	}

	$online_learning_lms_footer_widget_background_image = get_theme_mod('online_learning_lms_footer_widget_background_image');
	if ($online_learning_lms_footer_widget_background_image) {
		$online_learning_lms_custom_css .= "
			.footer-widgetarea {
				background-image: url(" . esc_url($online_learning_lms_footer_widget_background_image) . ");
			}
		";
	}

	$online_learning_lms_copyright_font_size = get_theme_mod('online_learning_lms_copyright_font_size');
	if ($online_learning_lms_copyright_font_size) {

		$online_learning_lms_custom_css .= "
			.footer-copyright {
				font-size: ". esc_attr($online_learning_lms_copyright_font_size) ."px;
			}
		";
	}

	/*-------------------- Menu Color CSS -------------------*/

	$online_learning_lms_header_menus_color = get_theme_mod('online_learning_lms_header_menus_color');
	if($online_learning_lms_header_menus_color != false){
		$online_learning_lms_custom_css .='.site-navigation .primary-menu a{';
			$online_learning_lms_custom_css .='color: '.esc_attr($online_learning_lms_header_menus_color).'!important;';
		$online_learning_lms_custom_css .='}';
	}

	$online_learning_lms_header_menus_hover_color = get_theme_mod('online_learning_lms_header_menus_hover_color');
	if($online_learning_lms_header_menus_hover_color != false){
		$online_learning_lms_custom_css .='.site-navigation .primary-menu a:hover{';
			$online_learning_lms_custom_css .='color: '.esc_attr($online_learning_lms_header_menus_hover_color).'!important;';
		$online_learning_lms_custom_css .='}';
	}

	$online_learning_lms_header_submenus_color = get_theme_mod('online_learning_lms_header_submenus_color');
	if($online_learning_lms_header_submenus_color != false){
		$online_learning_lms_custom_css .='.site-navigation .primary-menu li ul li a{';
			$online_learning_lms_custom_css .='color: '.esc_attr($online_learning_lms_header_submenus_color).'!important;';
		$online_learning_lms_custom_css .='}';
	}

	$online_learning_lms_header_submenus_hover_color = get_theme_mod('online_learning_lms_header_submenus_hover_color');
	if($online_learning_lms_header_submenus_hover_color != false){
		$online_learning_lms_custom_css .='.site-navigation .primary-menu li ul li a:hover{';
			$online_learning_lms_custom_css .='color: '.esc_attr($online_learning_lms_header_submenus_hover_color).'!important;';
		$online_learning_lms_custom_css .='}';
	}