<footer class="site-footer">
    <div class="aurora aurora-blue a2 drift-slow"></div>
    <div class="aurora aurora-gold a3 drift" style="opacity:.18"></div>
    <div class="grid-overlay"></div>

    <div class="wrap">
        <div class="footer-grid">

            <div>
                <div class="footer-brand">
                    <img src="<?php echo esc($company_logo); ?>" alt="<?php echo esc($company_name); ?>">
                    <span><?php echo esc($company_name); ?></span>
                </div>
                <p class="footer-about"><?php echo esc($lang->translate('footer_text', $footer_text)); ?></p>
                <div class="footer-social">
                    <a href="<?php echo esc($facebook_url); ?>" target="_blank" rel="noopener" aria-label="Facebook"><i class="fab fa-facebook-f"></i></a>
                    <a href="<?php echo esc($youtube_url); ?>" target="_blank" rel="noopener" aria-label="YouTube"><i class="fab fa-youtube"></i></a>
                    <a href="<?php echo esc($whatsapp_channel_url); ?>" target="_blank" rel="noopener" aria-label="WhatsApp"><i class="fab fa-whatsapp"></i></a>
                </div>
            </div>

            <div>
                <h3 class="footer-h"><?php echo esc($lang->translate('important_links', 'Important Links')); ?></h3>
                <div class="gold-line sm" style="margin-bottom:22px"></div>
                <ul class="footer-list">
                    <?php
                    $__base   = (isset($is_authed) && $is_authed) ? 'index.php?home=1' : 'index.php';
                    $__flinks = [];
                    if (isset($is_authed) && $is_authed && isset($header_dashboard_link)) {
                        $__flinks[] = [$header_dashboard_link, $lang->translate('dashboard', 'Dashboard')];
                    }
                    $__flinks[] = [$__base,             $lang->translate('home', 'Home')];
                    $__flinks[] = [$__base . '#about',  $lang->translate('about', 'About Us')];
                    $__flinks[] = [$__base . '#services',$lang->translate('services', 'Services')];
                    $__flinks[] = [$__base . '#team',   $lang->translate('team', 'Team')];
                    $__flinks[] = [$__base . '#contact',$lang->translate('contact', 'Contact')];
                    $__flinks[] = ['#',                 $lang->translate('privacy_policy', 'Privacy Policy')];
                    foreach ($__flinks as $fl):
                    ?>
                    <li>
                        <a href="<?php echo esc($fl[0]); ?>">
                            <i class="fas fa-chevron-right arw"></i><?php echo esc($fl[1]); ?>
                        </a>
                    </li>
                    <?php endforeach; ?>
                </ul>
            </div>

            <div>
                <h3 class="footer-h"><?php echo esc($lang->translate('contact_info', 'Contact Us')); ?></h3>
                <div class="gold-line sm" style="margin-bottom:22px"></div>
                <ul class="footer-list">
                    <li><span><i class="fas fa-location-dot"></i><?php echo esc($company_address); ?></span></li>
                    <li><a href="tel:<?php echo esc(preg_replace('/\s+/', '', $company_phone)); ?>"><i class="fas fa-phone"></i><?php echo esc($company_phone); ?></a></li>
                    <li><a href="mailto:<?php echo esc($company_email); ?>"><i class="fas fa-envelope"></i><?php echo esc($company_email); ?></a></li>
                    <li><span><i class="fas fa-clock"></i><?php echo esc($office_time); ?></span></li>
                </ul>
            </div>

            <div>
                <h3 class="footer-h"><?php echo esc($lang->translate('newsletter', 'Newsletter')); ?></h3>
                <div class="gold-line sm" style="margin-bottom:22px"></div>
                <p class="footer-note"><?php echo esc($lang->translate('newsletter_desc', 'Subscribe to get updates')); ?></p>
                <form class="news-form" id="newsletterForm" data-no-lock>
                    <input type="email" required placeholder="<?php echo esc($lang->translate('email_placeholder', 'Your email')); ?>">
                    <button type="submit" class="btn btn-gold" aria-label="Subscribe"><i class="fas fa-paper-plane"></i></button>
                </form>
                <p id="newsletterMsg" class="news-msg hidden"></p>

                <div class="footer-badge">
                    <i class="fas fa-lock"></i><?php echo esc($lang->translate('ssl_secured', 'SSL Secured Platform')); ?>
                </div>
            </div>
        </div>

        <div class="divider-gold"></div>

        <div class="footer-bottom">
            <p class="footer-copy"><?php echo esc($copyright_text); ?></p>
            <p class="footer-made"><?php echo esc($lang->translate('made_with', 'Crafted with')); ?><i class="fas fa-heart"></i><?php echo esc($lang->translate('in_india', 'in India')); ?></p>
        </div>
    </div>
</footer>

<a href="https://wa.me/<?php echo preg_replace('/[^0-9]/', '', $company_phone); ?>" target="_blank" rel="noopener" class="fab fab-wa" aria-label="WhatsApp">
    <i class="fab fa-whatsapp"></i>
</a>

<script src="<?php echo assetUrl('assets/js/main.js'); ?>"></script>
<script>
(function () {
    var f = document.getElementById('newsletterForm');
    if (!f) return;
    var msg = document.getElementById('newsletterMsg');
    var OK  = <?php echo json_encode($lang->translate('newsletter_success', 'Newsletter subscription successful!'), JSON_UNESCAPED_UNICODE); ?>;
    f.addEventListener('submit', function (e) {
        e.preventDefault();
        if (!f.checkValidity()) { f.reportValidity(); return; }
        msg.textContent = OK;
        msg.classList.remove('hidden');
        f.reset();
        setTimeout(function () { msg.classList.add('hidden'); }, 5000);
    });
})();
</script>
</body>
</html>
<?php ob_end_flush(); ?>
