<footer class="mt-auto py-3">
    <div class="container">
        <div class="row">
            <div class="col-md-6">
                <?php if (defined('USE_LOGO') && USE_LOGO && defined('LOGO_URL') && !empty(LOGO_URL)): ?>
                    <img src="<?php echo LOGO_URL; ?>" alt="<?php echo SITE_NAME; ?>" 
                        <?php echo (defined('FOOTER_LOGO_WIDTH') && FOOTER_LOGO_WIDTH) ? 'width="' . FOOTER_LOGO_WIDTH . '"' : ''; ?> 
                        class="mb-3">
                    <h5 class="visually-hidden"><?php echo SITE_NAME; ?></h5>
                <?php else: ?>
                    <h5><?php echo SITE_NAME; ?></h5>
                <?php endif; ?>
                <p><?php echo defined('SITE_TAGLINE') ? SITE_TAGLINE : ($lang_navigation['FOOTER_DEFAULT_TAGLINE'] ?? 'Your support portal for tickets and projects'); ?></p>
            </div>
            <div class="col-md-6">
                <h5><?php echo $lang_navigation['FOOTER_QUICK_LINKS'] ?? 'Quick Links'; ?></h5>
                <ul class="list-unstyled">
                    <li><a href="<?php echo getCleanUrl('tickets'); ?>"><?php echo $lang_navigation['FOOTER_LINK_SUPPORT_TICKETS'] ?? 'Support Tickets'; ?></a></li>
                    <?php if (isLoggedIn() && defined('ENABLE_PROJECTS') && ENABLE_PROJECTS): ?>
                    <li><a href="<?php echo getCleanUrl('projects'); ?>"><?php echo $lang_navigation['FOOTER_LINK_PROJECTS'] ?? 'Projects'; ?></a></li>
                    <?php endif; ?>
                    <?php if (isLoggedIn() && defined('ENABLE_PROJECTS') && ENABLE_PROJECTS && defined('ENABLE_FILES') && ENABLE_FILES): ?>
                    <li><a href="<?php echo getCleanUrl('project_files'); ?>"><?php echo $lang_navigation['FOOTER_LINK_FILES'] ?? 'Files'; ?></a></li>
                    <?php endif; ?>
                    <?php if (defined('ENABLE_FAQS') && ENABLE_FAQS): ?>
                    <li><a href="<?php echo getCleanUrl('faq'); ?>"><?php echo $lang_navigation['FOOTER_LINK_FAQS'] ?? 'FAQs'; ?></a></li>
                    <?php endif; ?>
                    <?php if (defined('ENABLE_NEWS') && ENABLE_NEWS): ?>
                    <li><a href="<?php echo getCleanUrl('news'); ?>"><?php echo $lang_navigation['FOOTER_LINK_NEWS'] ?? 'News'; ?></a></li>
                    <?php endif; ?>
                    <?php if (defined('ENABLE_CONTACT') && ENABLE_CONTACT): ?>
                    <li><a href="<?php echo getCleanUrl('contact'); ?>"><?php echo $lang_navigation['FOOTER_LINK_CONTACT_US'] ?? 'Contact Us'; ?></a></li>
                    <?php endif; ?>
                     <?php if (defined('ENABLE_STORE') && ENABLE_STORE): ?>
                    <li><a href="<?php echo getCleanUrl('store'); ?>"><?php echo $lang_navigation['NAV_STORE'] ?? 'Store'; ?></a></li>
                    <?php endif; ?>
                     <?php // Custom Header Link - Placed before Admin dropdown for general visibility
                if (defined('CUSTOM_HEADER') && CUSTOM_HEADER && defined('CUSTOM_HEADER_URL') && !empty(CUSTOM_HEADER_URL) && defined('CUSTOM_HEADER_NAME') && !empty(CUSTOM_HEADER_NAME)): ?>
                <li><a href="<?php echo htmlspecialchars(CUSTOM_HEADER_URL); ?>" target="_blank"><?php echo htmlspecialchars(CUSTOM_HEADER_NAME); ?></a></li>
                <?php endif; ?>
                </ul>
            </div>
        </div>
        <hr>
        <div class="text-center">
            <p class="mb-0">&copy; <?php echo date('Y'); ?> <?php echo SITE_NAME; ?>. <?php if (defined('PAGE_PRIVACY') && PAGE_PRIVACY): ?> <a href="<?php echo getCleanUrl('privacy'); ?>"><?php echo $lang_navigation['FOOTER_LINK_PRIVACY_POLICY'] ?? 'Privacy Policy'; ?></a> - <?php endif; ?> <?php if (defined('PAGE_TERMS') && PAGE_TERMS): ?> <a href="<?php echo getCleanUrl('terms'); ?>"><?php echo $lang_navigation['NAV_TERMS'] ?? 'Terms'; ?></a> - <?php endif; ?> <?php echo $lang_navigation['FOOTER_POWERED_BY'] ?? 'Powered by'; ?> <a href="https://supportengine.cloud" target="_blank"><?php echo $lang_navigation['FOOTER_SUPPORTENGINE_LINK_TEXT'] ?? 'SupportEngine'; ?></a></p>
        </div>
    </div>
</footer> 

