<?php
/**
 * The template for displaying the footer.
 *
 * Contains the closing of the #content div and all content after
 *
 * @package Forest Jungle Safari 
 */
?>

    <footer role="contentinfo">
        <?php if (get_theme_mod('forest_jungle_safari_footer_hide_show', true)){ ?>
            <aside id="footer" class="copyright-wrapper" role="complementary" aria-label="<?php esc_attr_e( 'Footer', 'forest-jungle-safari' ); ?>">
                <div class="container">
                    <?php
                        $forest_jungle_safari_count = 0;
                        
                        if ( is_active_sidebar( 'footer-1' ) ) {
                            $forest_jungle_safari_count++;
                        }
                        if ( is_active_sidebar( 'footer-2' ) ) {
                            $forest_jungle_safari_count++;
                        }
                        if ( is_active_sidebar( 'footer-3' ) ) {
                            $forest_jungle_safari_count++;
                        }
                        if ( is_active_sidebar( 'footer-4' ) ) {
                            $forest_jungle_safari_count++;
                        }
                        // $forest_jungle_safari_count == 0 none
                        if ( $forest_jungle_safari_count == 1 ) {
                            $forest_jungle_safari_colmd = 'col-md-12 col-sm-12';
                        } elseif ( $forest_jungle_safari_count == 2 ) {
                            $forest_jungle_safari_colmd = 'col-md-6 col-sm-6';
                        } elseif ( $forest_jungle_safari_count == 3 ) {
                            $forest_jungle_safari_colmd = 'col-md-4 col-sm-4';
                        } else {
                            $forest_jungle_safari_colmd = 'col-lg-3 col-md-6 col-sm-6';
                        }
                    ?>
                    <div class="row wow bounceInUp center delay-1000" data-wow-duration="2s">
                        <div class="<?php echo !is_active_sidebar('footer-1') ? 'footer_hide' : esc_attr($forest_jungle_safari_colmd); ?> col-lg-3 col-xs-12 col-md-6 footer-block">
                            <?php if (is_active_sidebar('footer-1')) : ?>
                                <?php dynamic_sidebar('footer-1'); ?>
                            <?php else : ?>
                                <aside id="search" class="widget py-3" role="complementary" aria-label="firstsidebar">
                                    <h3 class="widget-title"><?php esc_html_e( 'Search', 'forest-jungle-safari' ); ?></h3>
                                    <?php get_search_form(); ?>
                                </aside>
                            <?php endif; ?>
                        </div>                       
                        <div class="<?php echo !is_active_sidebar('footer-2') ? 'footer_hide' : esc_attr($forest_jungle_safari_colmd); ?> col-lg-3 col-xs-12 col-md-6 footer-block">
                            <?php if (is_active_sidebar('footer-2')) : ?>
                                <?php dynamic_sidebar('footer-2'); ?>
                            <?php else : ?>
                                <aside id="archives" class="widget py-3" role="complementary" >
                                    <h3 class="widget-title"><?php esc_html_e( 'Archives', 'forest-jungle-safari' ); ?></h3>
                                    <ul>
                                        <?php wp_get_archives( array( 'type' => 'monthly' ) ); ?>
                                    </ul>
                                </aside>
                            <?php endif; ?>
                        </div>
                        <div class="<?php echo !is_active_sidebar('footer-3') ? 'footer_hide' : esc_attr($forest_jungle_safari_colmd); ?> col-lg-3 col-xs-12 col-md-6 footer-block">
                            <?php if (is_active_sidebar('footer-3')) : ?>
                                <?php dynamic_sidebar('footer-3'); ?>
                            <?php else : ?>
                                <aside id="meta" class="widget py-3" role="complementary" >
                                    <h3 class="widget-title"><?php esc_html_e( 'Meta', 'forest-jungle-safari' ); ?></h3>
                                    <ul>
                                        <?php wp_register(); ?>
                                        <li><?php wp_loginout(); ?></li>
                                        <?php wp_meta(); ?>
                                    </ul>
                                </aside>
                            <?php endif; ?>
                        </div>               
                        <div class="<?php echo !is_active_sidebar('footer-4') ? 'footer_hide' : esc_attr($forest_jungle_safari_colmd); ?> col-lg-3 col-xs-12 col-md-6 footer-block">
                            <?php if (is_active_sidebar('footer-4')) : ?>
                                <?php dynamic_sidebar('footer-4'); ?>
                            <?php else : ?>
                                <aside id="categories" class="widget py-3" role="complementary"> 
                                    <h3 class="widget-title"><?php esc_html_e( 'Categories', 'forest-jungle-safari' ); ?></h3>          
                                    <ul>
                                        <?php wp_list_categories('title_li=');  ?>
                                    </ul>
                                </aside>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>
            </aside>
        <?php }?>
        <div class="footer <?php if( get_theme_mod( 'forest_jungle_safari_copyright_sticky', false) == 1) { ?> copyright-sticky"<?php } else { ?>close-sticky <?php } ?>">
            <?php if (get_theme_mod('forest_jungle_safari_copyright_hide_show', true)) {?>
                <div id="footer-2" class="pt-3 pb-3 text-center">
                  	<div class="copyright container">
                        <div class="row">
                            <div class="col-xl-7 col-lg-6 col-md-12 col-12 copyright-text text-lg-start text-md-center text-center">
                                <p class="mb-0"><?php forest_jungle_safari_credit(); ?> <?php echo esc_html(get_theme_mod('forest_jungle_safari_footer_text',__('By VWThemes','forest-jungle-safari'))); ?></p>
                                
                            </div>
                            <div class="col-xl-5 col-lg-6 col-md-12 col-12 copyright-menus-box align-self-center text-md-center text-center pe-lg-3 pt-lg-0 pt-md-4 pt-2">
                                <?php if(get_theme_mod('forest_jungle_safari_footer_contact_us') != ''){ ?>
                                 <p class="contact-text1 mb-0">
                                 <a href="<?php echo esc_url(get_theme_mod('forest_jungle_safari_footer_contact_us_link',false));?>"><?php echo esc_html(get_theme_mod('forest_jungle_safari_footer_contact_us'));?><span class="screen-reader-text"><?php esc_html_e( 'Contact Us','forest-jungle-safari');?></span>
                                    </a></p>
                                <?php }?>

                                <?php if(get_theme_mod('forest_jungle_safari_footer_support') != ''){ ?>
                                 <p class="contact-text2 mb-0">
                                 <a href="<?php echo esc_url(get_theme_mod('forest_jungle_safari_footer_support_link',false));?>"><?php echo esc_html(get_theme_mod('forest_jungle_safari_footer_support'));?><span class="screen-reader-text"><?php esc_html_e( 'Support','forest-jungle-safari');?></span>
                                    </a></p>
                                <?php }?>

                                <?php if(get_theme_mod('forest_jungle_safari_footer_privacy_policy') != ''){ ?>
                                 <p class="contact-text3 mb-0">
                                 <a href="<?php echo esc_url(get_theme_mod('forest_jungle_safari_footer_privacy_policy_link',false));?>"><?php echo esc_html(get_theme_mod('forest_jungle_safari_footer_privacy_policy'));?><span class="screen-reader-text"><?php esc_html_e( 'Privacy Policy','forest-jungle-safari');?></span>
                                  </a></p>
                                <?php }?>

                                <?php if(get_theme_mod('forest_jungle_safari_footer_term_condition') != ''){ ?>
                                 <p class="contact-text4 mb-0">
                                 <a href="<?php echo esc_url(get_theme_mod('forest_jungle_safari_term_condition_link',false));?>"><?php echo esc_html(get_theme_mod('forest_jungle_safari_footer_term_condition'));?><span class="screen-reader-text"><?php esc_html_e( 'Term & Condition','forest-jungle-safari');?></span>
                                  </a></p>
                                <?php }?>
                            </div>
                        </div>
                        <?php if(get_theme_mod('forest_jungle_safari_footer_icon',false) != false) {?>
                            <?php dynamic_sidebar('footer-icon'); ?>
                        <?php }?>
                        <?php if( get_theme_mod( 'forest_jungle_safari_hide_show_scroll',true) == 1 || get_theme_mod( 'forest_jungle_safari_resp_scroll_top_hide_show',true) == 1) { ?>
                            <?php $forest_jungle_safari_theme_lay = get_theme_mod( 'forest_jungle_safari_scroll_top_alignment','Right');
                            if($forest_jungle_safari_theme_lay == 'Left'){ ?>
                                <a href="#" class="scrollup left"><i class="<?php echo esc_attr(get_theme_mod('forest_jungle_safari_scroll_top_icon','fas fa-long-arrow-alt-up')); ?>"></i><span class="screen-reader-text"><?php esc_html_e( 'Scroll Up', 'forest-jungle-safari' ); ?></span></a>
                            <?php }else if($forest_jungle_safari_theme_lay == 'Center'){ ?>
                                <a href="#" class="scrollup center"><i class="<?php echo esc_attr(get_theme_mod('forest_jungle_safari_scroll_top_icon','fas fa-long-arrow-alt-up')); ?>"></i><span class="screen-reader-text"><?php esc_html_e( 'Scroll Up', 'forest-jungle-safari' ); ?></span></a>
                            <?php }else{ ?>
                                <a href="#" class="scrollup"><i class="<?php echo esc_attr(get_theme_mod('forest_jungle_safari_scroll_top_icon','fas fa-long-arrow-alt-up')); ?>"></i><span class="screen-reader-text"><?php esc_html_e( 'Scroll Up', 'forest-jungle-safari' ); ?></span></a>
                            <?php }?>
                        <?php }?>
                  	</div>
                  	<div class="clear"></div>
                </div>
            <?php }?>
        </div>    
    </footer>
    <?php if ( get_theme_mod( 'forest_jungle_safari_progress_bar', 0 ) ) : ?>
         <div id="forest_jungle_safari_elemento_progress_bar"></div>
    <?php endif; ?>
        <?php wp_footer(); ?>
    </body>
</html>