<?php
/**
 * Frontend Footer - Premium Version
 * Digital Product Store
 */
?>
    <!-- Footer -->
    <footer class="footer mt-auto" style="background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); color: rgba(255,255,255,0.8); padding: 60px 0 30px;">
        <div class="container">
            <div class="row">
                <!-- About -->
                <div class="col-lg-4 col-md-6 mb-4">
                    <h5 class="text-white mb-3">
                        <i class="fas fa-store me-2"></i><?php echo get_setting('site_name', 'Digital Store'); ?>
                    </h5>
                    <p class="mb-3"><?php echo get_setting('site_description', 'Your trusted source for premium digital products. Instant downloads, secure payments, and 24/7 support.'); ?></p>
                    <div class="social-links">
                        <?php if ($facebook = get_setting('facebook_url')): ?>
                        <a href="<?php echo htmlspecialchars($facebook); ?>" target="_blank" class="me-3 text-white-50 hover-white" style="font-size: 1.25rem;"><i class="fab fa-facebook"></i></a>
                        <?php endif; ?>
                        <?php if ($twitter = get_setting('twitter_url')): ?>
                        <a href="<?php echo htmlspecialchars($twitter); ?>" target="_blank" class="me-3 text-white-50 hover-white" style="font-size: 1.25rem;"><i class="fab fa-twitter"></i></a>
                        <?php endif; ?>
                        <?php if ($instagram = get_setting('instagram_url')): ?>
                        <a href="<?php echo htmlspecialchars($instagram); ?>" target="_blank" class="me-3 text-white-50 hover-white" style="font-size: 1.25rem;"><i class="fab fa-instagram"></i></a>
                        <?php endif; ?>
                        <?php if ($youtube = get_setting('youtube_url')): ?>
                        <a href="<?php echo htmlspecialchars($youtube); ?>" target="_blank" class="me-3 text-white-50 hover-white" style="font-size: 1.25rem;"><i class="fab fa-youtube"></i></a>
                        <?php endif; ?>
                    </div>
                </div>
                
                <!-- Quick Links -->
                <div class="col-lg-2 col-md-6 mb-4">
                    <h5 class="text-white mb-3">Quick Links</h5>
                    <ul class="list-unstyled">
                        <li class="mb-2"><a href="<?php echo BASE_URL; ?>/index.php" class="text-white-50 text-decoration-none hover-white">Home</a></li>
                        <li class="mb-2"><a href="<?php echo BASE_URL; ?>/products.php" class="text-white-50 text-decoration-none hover-white">Products</a></li>
                        <li class="mb-2"><a href="<?php echo BASE_URL; ?>/page.php?slug=about-us" class="text-white-50 text-decoration-none hover-white">About Us</a></li>
                        <li class="mb-2"><a href="<?php echo BASE_URL; ?>/page.php?slug=contact-us" class="text-white-50 text-decoration-none hover-white">Contact</a></li>
                    </ul>
                </div>
                
                <!-- Support -->
                <div class="col-lg-2 col-md-6 mb-4">
                    <h5 class="text-white mb-3">Support</h5>
                    <ul class="list-unstyled">
                        <li class="mb-2"><a href="<?php echo BASE_URL; ?>/faqs.php" class="text-white-50 text-decoration-none hover-white">FAQs</a></li>
                        <li class="mb-2"><a href="<?php echo BASE_URL; ?>/page.php?slug=terms-of-service" class="text-white-50 text-decoration-none hover-white">Terms of Service</a></li>
                        <li class="mb-2"><a href="<?php echo BASE_URL; ?>/page.php?slug=privacy-policy" class="text-white-50 text-decoration-none hover-white">Privacy Policy</a></li>
                        <li class="mb-2"><a href="<?php echo BASE_URL; ?>/page.php?slug=refund-policy" class="text-white-50 text-decoration-none hover-white">Refund Policy</a></li>
                    </ul>
                </div>
                
                <!-- Contact -->
                <div class="col-lg-4 col-md-6 mb-4">
                    <h5 class="text-white mb-3">Contact Us</h5>
                    <ul class="list-unstyled">
                        <?php if ($email = get_setting('site_email')): ?>
                        <li class="mb-2"><i class="fas fa-envelope me-2 text-primary"></i><?php echo htmlspecialchars($email); ?></li>
                        <?php endif; ?>
                        <?php if ($phone = get_setting('site_phone')): ?>
                        <li class="mb-2"><i class="fas fa-phone me-2 text-primary"></i><?php echo htmlspecialchars($phone); ?></li>
                        <?php endif; ?>
                        <?php if ($address = get_setting('site_address')): ?>
                        <li class="mb-2"><i class="fas fa-map-marker-alt me-2 text-primary"></i><?php echo htmlspecialchars($address); ?></li>
                        <?php endif; ?>
                    </ul>
                </div>
            </div>
            
            <hr class="border-secondary my-4">
            
            <div class="row align-items-center">
    <div class="col-12 text-center text-md-start">
        <p class="mb-0">
            &copy; <?php echo date('Y'); ?> 
            <?php echo get_setting('site_name', 'Digital Store'); ?>. 
            All rights reserved.
        </p>
    </div>
</div>
        </div>
    </footer>
    
    <!-- Bootstrap JS -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    
    <!-- Custom Scripts -->
    <script>
    // Auto-dismiss alerts after 5 seconds
    document.addEventListener('DOMContentLoaded', function() {
        setTimeout(function() {
            var alerts = document.querySelectorAll('.alert-dismissible');
            alerts.forEach(function(alert) {
                var bsAlert = new bootstrap.Alert(alert);
                bsAlert.close();
            });
        }, 5000);
    });
    
    // Hover effect for footer links
    document.querySelectorAll('.hover-white').forEach(function(el) {
        el.addEventListener('mouseenter', function() {
            this.style.color = '#fff';
        });
        el.addEventListener('mouseleave', function() {
            this.style.color = 'rgba(255,255,255,0.5)';
        });
    });
    </script>
</body>
</html>
