<?php
/**
 * The template for displaying the footer
 *
 * Contains the closing of the #content div and all content after.
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package IS-Medify
 * 
 * @since 1.0.0
 * 
 */
?>

<style>
.w_footer {
    padding: 50px 0px 50px;
    background: #ecf0f1;
}

.widget-heading {
    padding: 30px 15px;
}
.widget-heading h1 {
    border-bottom: 2px solid #000;
    display: inline-block;
    font-size: 24px;
    padding: 5px 5px 5px 0;
}

#calendar_wrap {
    padding: 10px;
}

table.table, table {
    width: 100%;
    text-align: left;
    background-color: transparent;
}

#wp-calendar caption {
    padding: 10px;
    color: #fff;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    background-color: #005994;
}

.footer-widget #wp-calendar thead tr th, .footer-widget table td {
    color: #333;
}

#wp-calendar thead tr th, #wp-calendar tbody tr td  {
    text-align: center;
}

table th, table td {
    border: 1px solid #dddddd;
    padding: 6px;
    line-height: 20px;
    text-align: center;
    vertical-align: top;
}

.footer-widget ul {
    list-style: none;
    padding-left: 20px;
    margin: 0;
}

.footer-widget ul li {
    display: block;
}

.footer-widget ul li a {
    color: #333;
    font-size: 16px;
}
</style>

<?php 
$is_medify_footer_section_areas = get_theme_mod('is_medify_footer_section_areas', 'on');

if ($is_medify_footer_section_areas == 'on') : ?>
    <div class="container-fluid w_footer">
        <div class="container">
            <?php 
            if (is_active_sidebar('is_medify-footer')) :
                // If widgets are active in the sidebar, display them
                dynamic_sidebar('is_medify-footer');
            else :
                // If no widgets are active, display default widgets
                ?>
                <div class="row">
                    <div class="col-md-3">
                        <?php the_widget('WP_Widget_Calendar', array('title' => __('Calendar', 'is_medify'))); ?>
                    </div>
                    <div class="col-md-3">
                        <?php the_widget('WP_Widget_Recent_Posts'); ?>
                    </div>
                    <div class="col-md-3">
                        <?php the_widget('WP_Widget_Pages'); ?>
                    </div>
                    <div class="col-md-3">
                        <?php the_widget('WP_Widget_Archives'); ?>
                    </div>
                </div>
            <?php endif; ?>
        </div>
    </div>
<?php endif; ?>

<?php 
do_action('IS_Medify_Do_Function_Footer'); // Custom action hook for additional footer functions
?>

<?php wp_footer(); // Required for WordPress footer functionality ?>

</body>
</html>
