<?php
require_once 'api/getLocations.php';
require_once 'api/getServices.php';
$locations = getLocations();
$services = getServices();
?>

<footer class="site-footer">
    <div class="footer-container">
        <!-- Logo and Company Info Section -->
        <div class="footer-section">
            <div class="footer-logo">
                <img src="/assets/images/logo.png" alt="Packingo Logo">
            </div>
            <p class="company-description">
                We are your trusted partner for all packing and moving needs. With years of experience, we ensure safe and efficient relocation services across India.
            </p>
        </div>

        <!-- Services Section -->
        <div class="footer-section">
            <h3>Our Services</h3>
            <ul>
                <?php foreach ($services as $service): ?>
                    <li><a href="/services/<?php echo htmlspecialchars($service['slug']); ?>"><?php echo htmlspecialchars($service['name']); ?></a></li>
                <?php endforeach; ?>
            </ul>
            </ul>
        </div>

        <!-- Locations Section -->
        <div class="footer-section">
            <h3>Areas we serve</h3>
            <ul>
                <?php foreach (array_slice($locations, 0, 5) as $location): ?>
                    <li>
                        <a href="/location/<?php echo htmlspecialchars($location['location_slug']); ?>">
                            <?php echo htmlspecialchars($location['location_name']); ?>
                        </a>
                    </li>
                <?php endforeach; ?>
                <?php if (count($locations) > 5): ?>
                    <li><a href="/locations" aria-label="See more locations served by Packingo">See more locations</a></li>
                <?php endif; ?>
            </ul>
        </div>

        <!-- Contact Section -->
        <div class="footer-section">
            <h3>Contact Us</h3>
            <address>
                <p>45-1-14, Heera Complex, Danavaipeta post</p>
                <p>Rajahmundry, Andhra Pradesh, India - 533103.</p>
                <p><i class="fas fa-envelope"></i>: packingomoversindia@gmail.com</p>
                <p><i class="fas fa-phone"></i>: +91 91009 56577 | +91 91001 56577</p>
                <p>
                    <a href="https://instagram.com/packingo.movers" target="_blank">
                        <i class="fab fa-instagram"></i> Instagram
                    </a>
                </p>
            </address>
        </div>
    </div>

    <!-- Bottom Bar -->
    <div class="footer-bottom">
        <div>

            <p>&copy; <?php echo date('Y'); ?> Packingo. All rights reserved.</p>
        </div>

        <div class="footer-links">
            <a href="/privacy-policy">Privacy Policy</a>
            <a href="/terms-of-service">Terms of Service</a>
        </div>
        <div class="powered-by">
            Powered by <a href="https://anisol.co.in" target="_blank">Anisol Technologies </a>
        </div>
    </div>

    <!-- nav to top -->
    <div class="back-to-top">
        <a href="#"><i class="fas fa-arrow-up"></i> Back to Top</a>
    </div>

    <!-- overlay call and whatsapp icons on right  -->
    <div class="overlay-icons">
        <a href="<?php echo $whatsapplink; ?>" class="overlay-icon whatsapp-icon" aria-label="Chat with us on WhatsApp">
            <i class="fab fa-whatsapp" aria-hidden="true"></i>
            <span class="overlay-text"><?php echo $whatsapp; ?></span>
        </a>

        <a href="tel:<?php echo $phone; ?>" class="overlay-icon call-icon" aria-label="Call us">
            <i class="fas fa-phone" aria-hidden="true"></i>
            <span class="overlay-text"><?php echo $phone; ?></span>
        </a>
    </div>

</footer>