<?php
    $siteName = $settings->site_name ?? config('app.name', 'Saleem Sial Analytics');
    $socialLinks = $settings->social_links ?? [];
    $footerCtaLabel = $settings->footer_cta_label ?? 'Contact Us';
    $footerCtaUrl = $settings->footer_cta_url ?? '/contact';
    $brandVersion = $settings?->updated_at?->timestamp ?? $settings?->logo_media_id ?? '1';
    $logo = ($settings?->logo_url ?? asset('uploads/placeholders/default-logo.png')) . '?v=' . $brandVersion;
?>

<?php
    $renderSocialIcon = function (string $platform): string {
        return match ($platform) {
            'facebook' => '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="feather feather-facebook" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z"></path></svg>',
            'instagram' => '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="feather feather-instagram" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="2" width="20" height="20" rx="5" ry="5"></rect><path d="M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"></path><line x1="17.5" y1="6.5" x2="17.51" y2="6.5"></line></svg>',
            'linkedin' => '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="feather feather-linkedin" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z"></path><rect x="2" y="9" width="4" height="12"></rect><circle cx="4" cy="4" r="2"></circle></svg>',
            default => '<svg xmlns="http://www.w3.org/2000/svg" width="25" height="24" viewBox="0 0 25 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M11 12.5L2.5 1.5H8L14.5 10.3833M11 12.5L18 22H23L14.5 10.3833M11 12.5L1.5 23M14.5 10.3833L22.5 1"></path></svg>',
        };
    };
?>

<footer id="colophon" class="site-footer" role="contentinfo" aria-label="Footer">
    <div class="footer-content">
        <div class="ssa-footer-cta">
            <div>
                <p class="ssa-footer-kicker">Need a cleaner measurement setup?</p>
                <h3><?php echo e($settings->footer_text ?? 'Build a reporting and tracking stack your team can trust.'); ?></h3>
            </div>
            <a href="<?php echo e(url($footerCtaUrl)); ?>" class="ssa-outline-button ssa-outline-button--light"><?php echo e($footerCtaLabel); ?></a>
        </div>

        <ul class="social-icons">
            <?php $__currentLoopData = $socialLinks; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $platform => $url): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <li class="social-icon">
                    <a href="<?php echo e($url); ?>" aria-label="<?php echo e($platform); ?>"><?php echo $renderSocialIcon($platform); ?></a>
                </li>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </ul>

        <div class="ssa-footer-grid">
            <div>
                <img src="<?php echo e($logo); ?>" alt="<?php echo e($siteName); ?>" class="ssa-footer-logo">
                <h4><?php echo e($siteName); ?></h4>
                <p><?php echo e($settings->footer_text ?? 'GA4, GTM, ad tracking, dashboards, and server-side measurement support for growth teams that need cleaner reporting.'); ?></p>
            </div>
            <div>
                <h4>Contact</h4>
                <?php if(! empty($settings?->contact_email)): ?>
                    <p><a href="mailto:<?php echo e($settings->contact_email); ?>"><?php echo e($settings->contact_email); ?></a></p>
                <?php endif; ?>
                <?php if(! empty($settings?->contact_phone)): ?>
                    <p><a href="tel:<?php echo e($settings->contact_phone); ?>"><?php echo e($settings->contact_phone); ?></a></p>
                <?php endif; ?>
                <?php if(filled($settings?->whatsapp_url)): ?>
                    <p><a href="<?php echo e($settings->whatsapp_url); ?>" target="_blank" rel="noopener">WhatsApp Chat</a></p>
                <?php endif; ?>
            </div>
            <div>
                <h4>Navigate</h4>
                <p><a href="<?php echo e(route('home')); ?>">Home</a></p>
                <p><a href="<?php echo e(route('about')); ?>">About</a></p>
                <p><a href="<?php echo e(route('blog')); ?>">Blog</a></p>
                <p><a href="<?php echo e(route('services.index')); ?>">Services</a></p>
                <p><a href="<?php echo e(route('contact')); ?>">Contact</a></p>
            </div>
            <div>
                <h4>Service categories</h4>
                <?php $__currentLoopData = $footerServiceCategories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <p><a href="<?php echo e(route('services.index', ['category' => $category])); ?>"><?php echo e($category); ?></a></p>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
        </div>

        <div class="site-info">
            <p>&copy; <?php echo e(date('Y')); ?> <?php echo e($siteName); ?>. All rights reserved.</p>
        </div>
    </div>
</footer>
<?php /**PATH C:\xampp\htdocs\saleemsailAna.com\resources\views/partials/footer.blade.php ENDPATH**/ ?>