<?php
// footer.php - Professional Footer with Policy Links
// File location: /bidwheels.net/includes/footer.php
?>
    </main>
    
    <!-- Footer Section -->
    <footer class="main-footer">
        <div class="footer-container">
            <!-- Footer Top Section -->
            <div class="footer-top">
                <div class="footer-grid">
                    <!-- Column 1: Logo & About -->
                    <div class="footer-col">
                        <div class="footer-logo">
                            <img src="<?php echo SITE_URL . SITE_LOGO; ?>" alt="<?php echo SITE_NAME; ?>">
                            <h3><?php echo SITE_NAME; ?></h3>
                        </div>
                        <p class="footer-about">
                            Your trusted platform for bidding on luxury vehicles, motorcycles, yachts and more. 
                            Join thousands of satisfied bidders and find your dream vehicle today.
                        </p>
                        <div class="footer-social">
                            <a href="#" aria-label="Facebook"><i class="fab fa-facebook-f"></i></a>
                            <a href="#" aria-label="Twitter"><i class="fab fa-twitter"></i></a>
                            <a href="#" aria-label="Instagram"><i class="fab fa-instagram"></i></a>
                            <a href="#" aria-label="LinkedIn"><i class="fab fa-linkedin-in"></i></a>
                            <a href="#" aria-label="YouTube"><i class="fab fa-youtube"></i></a>
                        </div>
                    </div>
                    
                    <!-- Column 2: Quick Links -->
                    <div class="footer-col">
                        <h4>Quick Links</h4>
                        <ul class="footer-links">
                            <li><a href="<?php echo SITE_URL; ?>/index.php"><i class="fas fa-chevron-right"></i> Home</a></li>
                            <li><a href="<?php echo SITE_URL; ?>/about.php"><i class="fas fa-chevron-right"></i> About Us</a></li>
                            <li><a href="<?php echo SITE_URL; ?>/contact.php"><i class="fas fa-chevron-right"></i> Contact</a></li>
                            <li><a href="<?php echo SITE_URL; ?>/blog/index.php"><i class="fas fa-chevron-right"></i> Blog</a></li>
                            <li><a href="<?php echo SITE_URL; ?>/product/index.php"><i class="fas fa-chevron-right"></i> All Vehicles</a></li>
                        </ul>
                    </div>
                    
                    <!-- Column 3: Categories -->
                    <div class="footer-col">
                        <h4>Categories</h4>
                        <ul class="footer-links">
                            <li><a href="<?php echo SITE_URL; ?>/product/category.php?id=1"><i class="fas fa-chevron-right"></i> Luxury Cars</a></li>
                            <li><a href="<?php echo SITE_URL; ?>/product/category.php?id=5"><i class="fas fa-chevron-right"></i> Motorcycles</a></li>
                            <li><a href="<?php echo SITE_URL; ?>/product/category.php?id=7"><i class="fas fa-chevron-right"></i> Yachts & Ships</a></li>
                            <li><a href="<?php echo SITE_URL; ?>/product/category.php?id=3"><i class="fas fa-chevron-right"></i> SUVs</a></li>
                            <li><a href="<?php echo SITE_URL; ?>/product/category.php?id=4"><i class="fas fa-chevron-right"></i> Electric Cars</a></li>
                        </ul>
                    </div>
                    
                    <!-- Column 4: Policies -->
                    <div class="footer-col">
                        <h4>Legal</h4>
                        <ul class="footer-links">
                            <li><a href="<?php echo SITE_URL; ?>/privacy.php"><i class="fas fa-chevron-right"></i> Privacy Policy</a></li>
                            <li><a href="<?php echo SITE_URL; ?>/terms.php"><i class="fas fa-chevron-right"></i> Terms of Service</a></li>
                            <li><a href="<?php echo SITE_URL; ?>/refund.php"><i class="fas fa-chevron-right"></i> Refund Policy</a></li>
                            <li><a href="<?php echo SITE_URL; ?>/auction-policies.php"><i class="fas fa-chevron-right"></i> Auction Policies</a></li>
                        </ul>
                    </div>
                    
                    <!-- Column 5: Contact Info -->
                    <div class="footer-col">
                        <h4>Contact Info</h4>
                        <ul class="footer-contact">
                            <li>
                                <i class="fas fa-map-marker-alt"></i>
                                <span>123 Auction Avenue, New York, NY 10001</span>
                            </li>
                            <li>
                                <i class="fas fa-phone"></i>
                                <span>+1 (555) 123-4567</span>
                            </li>
                            <li>
                                <i class="fas fa-envelope"></i>
                                <a href="mailto:<?php echo SUPPORT_EMAIL; ?>"><?php echo SUPPORT_EMAIL; ?></a>
                            </li>
                            <li>
                                <i class="fas fa-clock"></i>
                                <span>Mon-Fri: 9AM - 6PM EST</span>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
            
            <!-- Footer Middle Section - Newsletter -->
            <div class="footer-middle">
                <div class="footer-newsletter">
                    <h4>Subscribe to Our Newsletter</h4>
                    <p>Get the latest updates on new vehicles, special offers, and auction tips.</p>
                    <form class="newsletter-form" id="newsletterForm" method="POST">
                        <div class="newsletter-group">
                            <input type="email" name="newsletter_email" placeholder="Enter your email address" required>
                            <button type="submit"><i class="fas fa-paper-plane"></i> Subscribe</button>
                        </div>
                    </form>
                </div>
            </div>
            
            <!-- Footer Bottom Section -->
            <div class="footer-bottom">
                <div class="footer-bottom-content">
                    <p>&copy; <?php echo date('Y'); ?> <?php echo SITE_NAME; ?>. All rights reserved.</p>
                    <div class="footer-bottom-links">
                        <a href="<?php echo SITE_URL; ?>/privacy.php">Privacy Policy</a>
                        <a href="<?php echo SITE_URL; ?>/terms.php">Terms of Service</a>
                        <a href="<?php echo SITE_URL; ?>/refund.php">Refund Policy</a>
                        <a href="<?php echo SITE_URL; ?>/auction-policies.php">Auction Policies</a>
                        <a href="<?php echo SITE_URL; ?>/sitemap.xml">Sitemap</a>
                    </div>
                </div>
            </div>
        </div>
    </footer>
    
    <!-- Back to Top Button -->
    <button class="back-to-top" id="backToTop">
        <i class="fas fa-arrow-up"></i>
    </button>
    
    <style>
        /* Main Footer Styles */
        .main-footer {
            background: #0a0a0a;
            color: #e0e0e0;
            font-family: 'Inter', sans-serif;
            margin-top: 60px;
        }
        
        .footer-container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 0 24px;
        }
        
        /* Footer Top */
        .footer-top {
            padding: 60px 0 40px;
            border-bottom: 1px solid #1a1a1a;
        }
        
        .footer-grid {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 30px;
        }
        
        /* Footer Columns */
        .footer-col h4 {
            color: #ffffff;
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 20px;
            position: relative;
            padding-bottom: 12px;
        }
        
        .footer-col h4::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 40px;
            height: 2px;
            background: #FF8C3E;
        }
        
        /* Footer Logo */
        .footer-logo {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 20px;
        }
        
        .footer-logo img {
            height: 45px;
            width: auto;
        }
        
        .footer-logo h3 {
            color: #ffffff;
            font-size: 20px;
            font-weight: 700;
        }
        
        .footer-about {
            color: #aaa;
            font-size: 14px;
            line-height: 1.6;
            margin-bottom: 20px;
        }
        
        /* Social Icons */
        .footer-social {
            display: flex;
            gap: 12px;
        }
        
        .footer-social a {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            background: #1a1a1a;
            border-radius: 50%;
            color: #e0e0e0;
            transition: all 0.3s;
            text-decoration: none;
        }
        
        .footer-social a:hover {
            background: #FF8C3E;
            color: #0a0a0a;
            transform: translateY(-3px);
        }
        
        /* Footer Links */
        .footer-links {
            list-style: none;
            padding: 0;
        }
        
        .footer-links li {
            margin-bottom: 12px;
        }
        
        .footer-links a {
            color: #aaa;
            text-decoration: none;
            font-size: 14px;
            transition: all 0.3s;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }
        
        .footer-links a i {
            font-size: 10px;
            color: #FF8C3E;
        }
        
        .footer-links a:hover {
            color: #FF8C3E;
            transform: translateX(5px);
        }
        
        /* Contact Info */
        .footer-contact {
            list-style: none;
            padding: 0;
        }
        
        .footer-contact li {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            margin-bottom: 16px;
            font-size: 14px;
            color: #aaa;
            line-height: 1.5;
        }
        
        .footer-contact li i {
            color: #FF8C3E;
            font-size: 16px;
            margin-top: 2px;
        }
        
        .footer-contact li a {
            color: #aaa;
            text-decoration: none;
            transition: color 0.3s;
        }
        
        .footer-contact li a:hover {
            color: #FF8C3E;
        }
        
        /* Newsletter Section */
        .footer-middle {
            padding: 40px 0;
            border-bottom: 1px solid #1a1a1a;
        }
        
        .footer-newsletter {
            text-align: center;
            max-width: 600px;
            margin: 0 auto;
        }
        
        .footer-newsletter h4 {
            color: #ffffff;
            font-size: 22px;
            font-weight: 600;
            margin-bottom: 10px;
        }
        
        .footer-newsletter p {
            color: #aaa;
            font-size: 14px;
            margin-bottom: 20px;
        }
        
        .newsletter-form {
            display: flex;
            justify-content: center;
        }
        
        .newsletter-group {
            display: flex;
            width: 100%;
            max-width: 450px;
        }
        
        .newsletter-group input {
            flex: 1;
            padding: 14px 18px;
            border: none;
            border-radius: 50px 0 0 50px;
            font-size: 14px;
            background: #1a1a1a;
            color: #ffffff;
            outline: none;
        }
        
        .newsletter-group input::placeholder {
            color: #666;
        }
        
        .newsletter-group input:focus {
            outline: none;
        }
        
        .newsletter-group button {
            padding: 14px 24px;
            background: #FF8C3E;
            border: none;
            border-radius: 0 50px 50px 0;
            color: #0a0a0a;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .newsletter-group button:hover {
            background: #e67a22;
        }
        
        /* Footer Bottom */
        .footer-bottom {
            padding: 25px 0;
        }
        
        .footer-bottom-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 15px;
        }
        
        .footer-bottom p {
            color: #666;
            font-size: 13px;
        }
        
        .footer-bottom-links {
            display: flex;
            gap: 25px;
            flex-wrap: wrap;
        }
        
        .footer-bottom-links a {
            color: #666;
            text-decoration: none;
            font-size: 13px;
            transition: color 0.3s;
        }
        
        .footer-bottom-links a:hover {
            color: #FF8C3E;
        }
        
        /* Back to Top Button */
        .back-to-top {
            position: fixed;
            bottom: 30px;
            right: 30px;
            width: 50px;
            height: 50px;
            background: #FF8C3E;
            border: none;
            border-radius: 50%;
            color: #0a0a0a;
            cursor: pointer;
            font-size: 20px;
            display: none;
            align-items: center;
            justify-content: center;
            transition: all 0.3s;
            z-index: 999;
            box-shadow: 0 5px 15px rgba(0,0,0,0.2);
        }
        
        .back-to-top:hover {
            background: #046307;
            color: white;
            transform: translateY(-3px);
        }
        
        /* Custom Toast Notification */
        .footer-toast {
            position: fixed;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%) translateY(100px);
            background: #1a1a1a;
            color: white;
            padding: 14px 24px;
            border-radius: 50px;
            display: flex;
            align-items: center;
            gap: 12px;
            z-index: 10001;
            box-shadow: 0 5px 20px rgba(0,0,0,0.3);
            transition: transform 0.3s ease;
            font-size: 14px;
        }
        
        .footer-toast.show {
            transform: translateX(-50%) translateY(0);
        }
        
        .footer-toast.success {
            border-left: 4px solid #046307;
        }
        
        .footer-toast.error {
            border-left: 4px solid #dc3545;
        }
        
        .footer-toast i {
            font-size: 18px;
        }
        
        .footer-toast.success i {
            color: #046307;
        }
        
        .footer-toast.error i {
            color: #dc3545;
        }
        
        .toast-close {
            background: none;
            border: none;
            color: #888;
            cursor: pointer;
            font-size: 18px;
            margin-left: 10px;
        }
        
        .toast-close:hover {
            color: white;
        }
        
        /* Responsive Footer */
        @media (max-width: 1200px) {
            .footer-grid {
                grid-template-columns: repeat(3, 1fr);
                gap: 30px;
            }
        }
        
        @media (max-width: 992px) {
            .footer-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }
        
        @media (max-width: 768px) {
            .footer-grid {
                grid-template-columns: 1fr;
                gap: 35px;
            }
            
            .footer-top {
                padding: 40px 0 30px;
            }
            
            .footer-bottom-content {
                flex-direction: column;
                text-align: center;
            }
            
            .newsletter-group {
                flex-direction: column;
            }
            
            .newsletter-group input {
                border-radius: 50px;
                margin-bottom: 10px;
            }
            
            .newsletter-group button {
                border-radius: 50px;
                justify-content: center;
            }
            
            .back-to-top {
                bottom: 20px;
                right: 20px;
                width: 40px;
                height: 40px;
                font-size: 16px;
            }
            
            .footer-toast {
                width: 90%;
                justify-content: center;
                padding: 12px 18px;
                font-size: 12px;
            }
        }
        
        @media (max-width: 480px) {
            .footer-container {
                padding: 0 16px;
            }
            
            .footer-bottom-links {
                justify-content: center;
                gap: 15px;
            }
        }
    </style>
    
    <script>
        // Back to Top Button
        const backToTopBtn = document.getElementById('backToTop');
        
        window.addEventListener('scroll', function() {
            if (window.scrollY > 300) {
                backToTopBtn.style.display = 'flex';
            } else {
                backToTopBtn.style.display = 'none';
            }
        });
        
        backToTopBtn.addEventListener('click', function() {
            window.scrollTo({
                top: 0,
                behavior: 'smooth'
            });
        });
        
        // Newsletter Form Submission with Custom Toast
        function validateEmail(email) {
            const re = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
            return re.test(email);
        }
        
        function showFooterToast(message, type) {
            // Remove existing toast if any
            const existingToast = document.querySelector('.footer-toast');
            if (existingToast) {
                existingToast.remove();
            }
            
            // Create toast element
            const toast = document.createElement('div');
            toast.className = 'footer-toast ' + type;
            toast.innerHTML = `
                <i class="fas ${type === 'success' ? 'fa-check-circle' : 'fa-exclamation-circle'}"></i>
                <span>${message}</span>
                <button class="toast-close">&times;</button>
            `;
            
            document.body.appendChild(toast);
            
            // Show toast
            setTimeout(() => {
                toast.classList.add('show');
            }, 10);
            
            // Auto hide after 3 seconds
            setTimeout(() => {
                toast.classList.remove('show');
                setTimeout(() => toast.remove(), 300);
            }, 3000);
            
            // Close button
            toast.querySelector('.toast-close').addEventListener('click', () => {
                toast.classList.remove('show');
                setTimeout(() => toast.remove(), 300);
            });
        }
        
        document.getElementById('newsletterForm')?.addEventListener('submit', function(e) {
            e.preventDefault();
            const email = this.querySelector('input[name="newsletter_email"]').value;
            
            if (email && validateEmail(email)) {
                // You can add AJAX call here to save newsletter subscribers
                showFooterToast('Thank you for subscribing to our newsletter!', 'success');
                this.reset();
            } else if (email && !validateEmail(email)) {
                showFooterToast('Please enter a valid email address.', 'error');
            }
        });
    </script>
    
    <!-- jQuery (if needed for other scripts) -->
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    
    <!-- Custom JS -->
    <script src="<?php echo SITE_URL; ?>/assets/js/main.js"></script>
</body>
</html>
<?php
// Close database connection if needed
if (isset($conn) && $conn) {
    // mysqli_close($conn);
}
?>