<?php
$siteIdentity = function_exists('get_site_identity') ? get_site_identity() : ['business_name' => APP_NAME, 'logo_url' => ''];
$siteName = $siteIdentity['business_name'] ?? APP_NAME;
$siteLogoUrl = $siteIdentity['logo_url'] ?? '';
?>
<footer class="footer border-t border-slate-900 bg-nftDark pt-16 pb-8">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 gap-8 mb-12">
                
                <div class="lg:col-span-2 space-y-4">
                    <div class="flex items-center space-x-2">
                        <?php if (!empty($siteLogoUrl)): ?>
                            <div class="w-10 h-10 rounded-lg bg-slate-950 border border-slate-800 overflow-hidden flex items-center justify-center">
                                <img src="<?php echo htmlspecialchars($siteLogoUrl, ENT_QUOTES, 'UTF-8'); ?>" alt="<?php echo htmlspecialchars($siteName, ENT_QUOTES, 'UTF-8'); ?> Logo" class="max-h-full max-w-full object-contain">
                            </div>
                        <?php else: ?>
                            <div class="w-9 h-9 bg-gradient-to-tr from-nftAccentCyan to-nftAccentPurple rounded-lg flex items-center justify-center font-bold text-lg tracking-wider">
                                <?php echo htmlspecialchars(strtoupper(substr($siteName, 0, 1)), ENT_QUOTES, 'UTF-8'); ?>
                            </div>
                        <?php endif; ?>
                        <span class="text-xl font-bold tracking-tight text-white"><?php echo htmlspecialchars($siteName, ENT_QUOTES, 'UTF-8'); ?></span>
                    </div>
                    <p class="text-nftTextGray text-sm max-w-sm leading-relaxed">
                        The definitive commercial multi-vendor marketplace core software deployment framework. Optimized explicitly for instant procurement vectors targeting AI applications, custom tooling architectures, and script systems.
                    </p>
                    <div class="flex space-x-4 pt-2">
                        <a href="#" class="w-9 h-9 rounded-full bg-slate-900 border border-slate-800 flex items-center justify-center text-sm text-nftTextGray hover:text-nftAccentCyan hover:border-nftAccentCyan transition-all"><i class="fa-brands fa-twitter"></i></a>
                        <a href="#" class="w-9 h-9 rounded-full bg-slate-900 border border-slate-800 flex items-center justify-center text-sm text-nftTextGray hover:text-nftAccentCyan hover:border-nftAccentCyan transition-all"><i class="fa-brands fa-discord"></i></a>
                        <a href="#" class="w-9 h-9 rounded-full bg-slate-900 border border-slate-800 flex items-center justify-center text-sm text-nftTextGray hover:text-nftAccentCyan hover:border-nftAccentCyan transition-all"><i class="fa-brands fa-instagram"></i></a>
                    </div>
                </div>

                <div>
                    <h4 class="text-sm font-bold uppercase tracking-wider text-white mb-4">Digital Product Verticals</h4>
                    <ul class="space-y-2.5 text-sm text-nftTextGray">
                        <li><a href="#" class="hover:text-white transition-colors">AI SaaS Boilerplates</a></li>
                        <li><a href="#" class="hover:text-white transition-colors">Autonomous Tools</a></li>
                        <li><a href="#" class="hover:text-white transition-colors">Automations & Webhooks</a></li>
                        <li><a href="#" class="hover:text-white transition-colors">ML Script Architectures</a></li>
                    </ul>
                </div>

                <div>
                    <h4 class="text-sm font-bold uppercase tracking-wider text-white mb-4">Ecosystem Modules</h4>
                    <ul class="space-y-2.5 text-sm text-nftTextGray">
                        <li><a href="#" class="hover:text-white transition-colors">Developer Help Center</a></li>
                        <li><a href="#" class="hover:text-white transition-colors">Author Compliance Terms</a></li>
                        <li><a href="#" class="hover:text-white transition-colors">Affiliate Revenue Portals</a></li>
                        <li><a href="#" class="hover:text-white transition-colors">Developer Core Rest API</a></li>
                    </ul>
                </div>

                <div>
                    <h4 class="text-sm font-bold uppercase tracking-wider text-white mb-4">Asset Drop Notifications</h4>
                    <p class="text-xs text-nftTextGray mb-3">Subscribe to monitor verified codebase additions and hyper-growth execution templates.</p>
                    <div class="relative">
                        <input type="email" placeholder="author@domain.com" class="w-full bg-slate-900 border border-slate-800 rounded-xl px-4 py-2.5 text-xs focus:outline-none focus:border-nftAccentPurple text-slate-200">
                        <button class="absolute right-1.5 top-1.5 bg-gradient-to-r from-nftAccentCyan to-nftAccentPurple w-7 h-7 rounded-lg flex items-center justify-center text-xs text-white">
                            <i class="fa-solid fa-paper-plane"></i>
                        </button>
                    </div>
                </div>

            </div>

            <div class="border-t border-slate-900 pt-8 flex flex-col sm:flex-row items-center justify-between text-xs text-nftTextGray space-y-4 sm:space-y-0">
                <p>&copy; <?php echo date('Y'); ?> <?php echo htmlspecialchars($siteName, ENT_QUOTES, 'UTF-8'); ?>. Built seamlessly using modern modular styling patterns.</p>
                <div class="flex space-x-6">
                    <a href="#" class="hover:text-white transition-colors">Privacy Infrastructure Policy</a>
                    <a href="#" class="hover:text-white transition-colors">Terms of Product Fulfillment</a>
                </div>
            </div>
        </div>
    </footer>

    <script>
        window.addEventListener('scroll', () => {
            const header = document.querySelector('.navbar');
            if (window.scrollY > 50) {
                header.classList.add('navbar-scrolled');
            } else {
                header.classList.remove('navbar-scrolled');
            }
        });
    </script>
</body>
</html>
