        </div>
    </main>

    <!-- Footer -->
    <footer class="bg-gray-900 text-white">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
            <div class="grid grid-cols-1 md:grid-cols-4 gap-8">
                <!-- Company Info -->
                <div class="col-span-1 md:col-span-2">
                    <div class="flex items-center space-x-3 mb-4">
                        <div class="w-10 h-10 bg-gradient-to-r from-purple-600 to-blue-600 rounded-lg flex items-center justify-center">
                            <i class="fas fa-chart-line text-white text-xl"></i>
                        </div>
                        <span class="text-xl font-bold"><?php echo SITE_NAME; ?></span>
                    </div>
                    <p class="text-gray-400 mb-4 max-w-md">
                        Your trusted partner in investment and wealth management. We provide secure, reliable, and profitable investment opportunities for everyone.
                    </p>
                    <div class="flex space-x-4">
                        <a href="#" class="text-gray-400 hover:text-white transition-colors">
                            <i class="fab fa-facebook-f text-xl"></i>
                        </a>
                        <a href="#" class="text-gray-400 hover:text-white transition-colors">
                            <i class="fab fa-twitter text-xl"></i>
                        </a>
                        <a href="#" class="text-gray-400 hover:text-white transition-colors">
                            <i class="fab fa-linkedin-in text-xl"></i>
                        </a>
                        <a href="#" class="text-gray-400 hover:text-white transition-colors">
                            <i class="fab fa-instagram text-xl"></i>
                        </a>
                        <a href="#" class="text-gray-400 hover:text-white transition-colors">
                            <i class="fab fa-telegram-plane text-xl"></i>
                        </a>
                    </div>
                </div>

                <!-- Quick Links -->
                <div>
                    <h3 class="text-lg font-semibold mb-4">Quick Links</h3>
                    <ul class="space-y-2">
                        <li><a href="<?php echo SITE_URL; ?>/index" class="text-gray-400 hover:text-white transition-colors">Home</a></li>
                        <li><a href="<?php echo SITE_URL; ?>/index.php#plans" class="text-gray-400 hover:text-white transition-colors">Investment Plans</a></li>
                        <li><a href="<?php echo SITE_URL; ?>/index.php#about" class="text-gray-400 hover:text-white transition-colors">About Us</a></li>
                        <li><a href="<?php echo SITE_URL; ?>/index.php#contact" class="text-gray-400 hover:text-white transition-colors">Contact</a></li>
                        <?php if ($auth->isLoggedIn()): ?>
                            <li><a href="<?php echo SITE_URL; ?>/user/dashboard" class="text-gray-400 hover:text-white transition-colors">Dashboard</a></li>
                        <?php else: ?>
                            <li><a href="<?php echo SITE_URL; ?>/login" class="text-gray-400 hover:text-white transition-colors">Login</a></li>
                        <?php endif; ?>
                    </ul>
                </div>

                <!-- Services -->
                <div>
                    <h3 class="text-lg font-semibold mb-4">Services</h3>
                    <ul class="space-y-2">
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">Investment Plans</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">Portfolio Management</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">Financial Advisory</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">24/7 Support</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">Referral Program</a></li>
                    </ul>
                </div>
            </div>

            <!-- Contact Info -->
            <div class="border-t border-gray-800 mt-8 pt-8">
                <div class="grid grid-cols-1 md:grid-cols-3 gap-6">
                    <div class="flex items-center space-x-3">
                        <div class="w-10 h-10 bg-purple-600 rounded-full flex items-center justify-center">
                            <i class="fas fa-envelope text-white"></i>
                        </div>
                        <div>
                            <p class="text-sm text-gray-400">Email Support</p>
                            <p class="text-white"><?php echo SITE_EMAIL; ?></p>
                        </div>
                    </div>

                    <div class="flex items-center space-x-3">
                        <div class="w-10 h-10 bg-green-600 rounded-full flex items-center justify-center">
                            <i class="fas fa-phone text-white"></i>
                        </div>
                        <div>
                            <p class="text-sm text-gray-400">Phone Support</p>
                            <p class="text-white">+1 (555) 123-4567</p>
                        </div>
                    </div>

                    <div class="flex items-center space-x-3">
                        <div class="w-10 h-10 bg-blue-600 rounded-full flex items-center justify-center">
                            <i class="fas fa-clock text-white"></i>
                        </div>
                        <div>
                            <p class="text-sm text-gray-400">Support Hours</p>
                            <p class="text-white">24/7 Available</p>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Bottom Bar -->
            <div class="border-t border-gray-800 mt-8 pt-8 flex flex-col md:flex-row justify-between items-center">
                <div class="text-gray-400 text-sm mb-4 md:mb-0">
                    &copy; <?php echo date('Y'); ?> <?php echo SITE_NAME; ?>. All rights reserved.
                </div>

                <div class="flex space-x-6 text-sm">
                    <a href="#" class="text-gray-400 hover:text-white transition-colors">Privacy Policy</a>
                    <a href="#" class="text-gray-400 hover:text-white transition-colors">Terms of Service</a>
                    <a href="#" class="text-gray-400 hover:text-white transition-colors">Cookie Policy</a>
                    <a href="#" class="text-gray-400 hover:text-white transition-colors">Disclaimer</a>
                </div>
            </div>
        </div>
    </footer>

    <!-- Back to Top Button -->
    <button id="back-to-top" class="fixed bottom-6 right-6 bg-purple-600 hover:bg-purple-700 text-white p-3 rounded-full shadow-lg transition-all duration-300 transform opacity-0 translate-y-4" style="display: none;">
        <i class="fas fa-arrow-up"></i>
    </button>

    <!-- Notification Container -->
    <div id="notification-container" class="fixed top-4 right-4 z-50 space-y-2"></div>

    <!-- Mobile Menu Script -->
    <script>
        function toggleMobileMenu() {
            const menu = document.getElementById('mobile-menu');
            menu.classList.toggle('hidden');
        }

        // Close mobile menu when clicking outside
        document.addEventListener('click', function(event) {
            const menu = document.getElementById('mobile-menu');
            const button = event.target.closest('button');

            if (!menu.contains(event.target) && !button?.onclick) {
                menu.classList.add('hidden');
            }
        });

        // Back to top functionality
        window.addEventListener('scroll', function() {
            const backToTop = document.getElementById('back-to-top');
            if (window.pageYOffset > 300) {
                backToTop.style.display = 'block';
                setTimeout(() => {
                    backToTop.classList.remove('opacity-0', 'translate-y-4');
                    backToTop.classList.add('opacity-100', 'translate-y-0');
                }, 10);
            } else {
                backToTop.classList.remove('opacity-100', 'translate-y-0');
                backToTop.classList.add('opacity-0', 'translate-y-4');
                setTimeout(() => {
                    backToTop.style.display = 'none';
                }, 300);
            }
        });

        document.getElementById('back-to-top').addEventListener('click', function() {
            window.scrollTo({ top: 0, behavior: 'smooth' });
        });

        // Notification system
        function showNotification(message, type = 'info', duration = 5000) {
            const container = document.getElementById('notification-container');
            const notification = document.createElement('div');
            notification.className = `notification ${type}`;
            notification.innerHTML = `
                <div class="flex items-center">
                    <i class="fas ${getNotificationIcon(type)} mr-2"></i>
                    <span>${message}</span>
                    <button onclick="this.parentElement.parentElement.remove()" class="ml-auto">
                        <i class="fas fa-times"></i>
                    </button>
                </div>
            `;

            container.appendChild(notification);

            setTimeout(() => {
                notification.classList.add('show');
            }, 10);

            if (duration > 0) {
                setTimeout(() => {
                    notification.classList.remove('show');
                    setTimeout(() => {
                        notification.remove();
                    }, 300);
                }, duration);
            }
        }

        function getNotificationIcon(type) {
            const icons = {
                success: 'fa-check-circle',
                error: 'fa-exclamation-circle',
                warning: 'fa-exclamation-triangle',
                info: 'fa-info-circle'
            };
            return icons[type] || 'fa-info-circle';
        }

        // Auto-hide alerts after 5 seconds
        setTimeout(() => {
            const alerts = document.querySelectorAll('.alert');
            alerts.forEach(alert => {
                alert.style.transition = 'opacity 0.5s';
                alert.style.opacity = '0';
                setTimeout(() => alert.remove(), 500);
            });
        }, 5000);

        // CSRF token setup for AJAX requests
        $.ajaxSetup({
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            }
        });

        // Global loading state
        let loadingCount = 0;

        function showLoading() {
            loadingCount++;
            if (loadingCount === 1) {
                $('body').append('<div id="loading-overlay" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50"><div class="spinner"></div></div>');
            }
        }

        function hideLoading() {
            loadingCount--;
            if (loadingCount <= 0) {
                loadingCount = 0;
                $('#loading-overlay').remove();
            }
        }

        // Form validation helpers
        function validateEmail(email) {
            const re = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
            return re.test(email);
        }

        function validatePassword(password) {
            return password.length >= 6;
        }

        function formatCurrency(amount) {
            return new Intl.NumberFormat('en-US', {
                style: 'currency',
                currency: 'USD'
            }).format(amount);
        }

        // Auto-submit forms with data-auto-submit attribute
        document.addEventListener('DOMContentLoaded', function() {
            const autoSubmitForms = document.querySelectorAll('form[data-auto-submit]');
            autoSubmitForms.forEach(form => {
                const inputs = form.querySelectorAll('input, select, textarea');
                inputs.forEach(input => {
                    input.addEventListener('change', function() {
                        form.submit();
                    });
                });
            });
        });

        // Initialize tooltips
        $(document).ready(function() {
            $('[data-tooltip]').each(function() {
                const tooltip = $(this).data('tooltip');
                $(this).attr('title', tooltip);
            });
        });
    </script>

    <!-- Alpine.js for reactive components -->
    <script src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js" defer></script>
</body>
</html>
