<?php
/**
 * Centralized Footer Component
 * Edit this file once to update footer across all pages
 */

// Include phone protection system
require_once __DIR__ . '/../phone_protection.php';

// Ensure phoneProtection instance is available
global $phoneProtection;
if (!isset($phoneProtection) || !is_object($phoneProtection)) {
    $phoneProtection = new PhoneProtection();
}
?>

<?php $prefix = $urlPrefix ?? ''; ?>
    
    <!-- Footer -->
    <footer class="bg-dark text-white py-4"> 
        <div class="container">
            <div class="row">
                <div class="col-md-4 mb-3 mb-md-0">
                    <h5>Mark's Tech Solution</h5>
                    <p>Your trusted local tech experts in East Weymouth, MA.</p>
                </div>
                <div class="col-md-4 mb-3 mb-md-0">
                    <h5>Quick Links</h5>
                    <ul class="list-unstyled">
                       <li><a href="index.php">Home</a></li>
                            <li><a href="services.php">Services</a></li>
                            <li><a href="contact.php#contact-form">Request a Quote</a></li>
                            <li><a href="legal-documents.php">Privacy &amp; Terms</a></li>

                    </ul>
                </div>
                <div class="col-md-4">
                    <h5>Contact Info</h5>
                    <address>
                        16 Dale Rd<br>
                        East Weymouth, MA 02189<br>
                        <a href="tel:+13397460995" class="text-white"><?php 
                            if (isset($phoneProtection) && is_object($phoneProtection)) {
                                echo $phoneProtection->getProtectedPhoneHTML();
                            } else {
                                echo '<span>+1 (339) 746-0995</span>';
                            }
                        ?></a><br>
                        <a href="mailto:m.geden01@markstechsolution.com?subject=Website%20Inquiry" class="text-white">
                            <img src="assets/email_icon.png" alt="Email" width="16" height="16" class="me-1">
                            m.geden01@markstechsolution.com
                        </a>
                    </address>
                </div>
            </div>
            <hr class="my-4">
            <div class="text-center">
                <div class="footer-google-badge mb-3">
                    <a href="https://www.google.com/search?q=Mark%27s+Tech+Solution+Weymouth+reviews" target="_blank" rel="noopener noreferrer" class="text-decoration-none">
                        <span class="google-badge-rating">4.6</span>
                        <span class="google-badge-stars">
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star-half-alt"></i>
                        </span>
                        <span class="google-badge-text">Google rating · 9 reviews</span>
                    </a>
                </div>
                <p class="mb-0">&copy; <span id="copyright-year">2026</span> Mark's Tech Solution. All rights reserved.</p>
            </div>
        </div>
    </footer>

    <style>
        .footer-google-badge a {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            background: rgba(255, 255, 255, 0.1);
            padding: 0.5rem 1rem;
            border-radius: 50px;
            color: #ffffff;
            transition: background 0.2s ease;
        }
        .footer-google-badge a:hover {
            background: rgba(255, 255, 255, 0.2);
            color: #ffffff;
        }
        .google-badge-rating {
            font-weight: 800;
            font-size: 1.25rem;
        }
        .google-badge-stars {
            color: #ffb400;
            font-size: 0.85rem;
        }
        .google-badge-text {
            font-size: 0.85rem;
            opacity: 0.9;
        }
    </style>

    <!-- reCAPTCHA callback function -->
    <script>
      function onSubmit(token) {
        document.getElementById("quoteForm").submit();
      }
    </script>
    
    <!-- Structured Data -->
    <script type="application/ld+json">
    {
        "@context": "https://schema.org",
        "@type": "LocalBusiness",
        "name": "Mark's Tech Solution",
        "image": "https://markstechsolution.com/assets/mts_logo_inc.png",
        "@id": "https://markstechsolution.com/",
        "url": "https://markstechsolution.com/",
        "telephone": "+1339-746-0995",
        "email": "m.geden01@markstechsolution.com",
        "address": {
            "@type": "PostalAddress",
            "streetAddress": "16 Dale Rd",
            "addressLocality": "East Weymouth",
            "addressRegion": "MA",
            "postalCode": "02189",
            "addressCountry": "US"
        },
        "geo": {
            "@type": "GeoCoordinates",
            "latitude": 42.226008,
            "longitude": -70.945108
        },
        "openingHoursSpecification": [
            {
                "@type": "OpeningHoursSpecification",
                "dayOfWeek": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
                "opens": "10:00",
                "closes": "19:00"
            },
            {
                "@type": "OpeningHoursSpecification",
                "dayOfWeek": ["Saturday"],
                "opens": "11:00",
                "closes": "16:00"
            }
        ],
        "sameAs": [
            "https://www.google.com/maps/place/16+Dale+Rd,+East+Weymouth,+MA+02189"
        ],
        "knowsAbout": [
            "Computer Repair",
            "Network Setup",
            "WiFi Optimization",
            "Custom PC Builds",
            "Virus Removal",
            "Data Recovery",
            "Printer Setup",
            "IT Support",
            "On-Site Technical Support",
            "Remote Computer Support"
        ],
        "priceRange": "$$",
        "description": "Professional computer repair, network setup, and IT support services in East Weymouth, MA.",
        "aggregateRating": {
            "@type": "AggregateRating",
            "ratingValue": "4.6",
            "reviewCount": "9",
            "bestRating": "5",
            "worstRating": "1"
        },
        "serviceArea": {
            "@type": "GeoCircle",
            "geoMidpoint": {
                "@type": "GeoCoordinates",
                "latitude": 42.226008,
                "longitude": -70.945108
            },
            "geoRadius": "25000"
        },
        "hasOfferCatalog": {
            "@type": "OfferCatalog",
            "name": "IT Services",
            "itemListElement": [
                {
                    "@type": "Offer",
                    "itemOffered": {
                        "@type": "Service",
                        "name": "On-Site Tech Support",
                        "description": "Professional tech support at your location"
                    }
                },
                {
                    "@type": "Offer",
                    "itemOffered": {
                        "@type": "Service",
                        "name": "Network Installation",
                        "description": "Wi-Fi and wired network setup and configuration"
                    }
                },
                {
                    "@type": "Offer",
                    "itemOffered": {
                        "@type": "Service",
                        "name": "Computer Repair",
                        "description": "Hardware and software computer repair services"
                    }
                },
                {
                    "@type": "Offer",
                    "itemOffered": {
                        "@type": "Service",
                        "name": "Custom PC Builds",
                        "description": "Custom computer systems tailored to your needs"
                    }
                },
                {
                    "@type": "Offer",
                    "itemOffered": {
                        "@type": "Service",
                        "name": "Virus & Malware Removal",
                        "description": "Comprehensive security scanning and malware removal"
                    }
                },
                {
                    "@type": "Offer",
                    "itemOffered": {
                        "@type": "Service",
                        "name": "WiFi Network Setup",
                        "description": "Wireless network optimization and access point installation"
                    }
                },
                {
                    "@type": "Offer",
                    "itemOffered": {
                        "@type": "Service",
                        "name": "Printer Setup & Repair",
                        "description": "Network printer configuration and troubleshooting"
                    }
                }
            ]
        }
    }
    </script>
    
    <?php 
        if (isset($phoneProtection) && is_object($phoneProtection)) {
            echo $phoneProtection->getProtectionScript();
        }
    ?>
    
    <script>
        // Dynamically update copyright year
        document.getElementById('copyright-year').textContent = new Date().getFullYear();
    </script>
</body>
</html>