<?php
    $heroImage = filled($hero['image_media_id'] ?? null)
        ? $pageMedia->get((int) $hero['image_media_id'])
        : null;
    $platforms = collect($hero['platforms'] ?? [])->map(function (array $platform) use ($pageMedia) {
        $media = filled($platform['media_id'] ?? null)
            ? $pageMedia->get((int) $platform['media_id'])
            : null;

        return [
            'label' => $platform['label'] ?? '',
            'media' => $media,
        ];
    })->filter(fn (array $platform) => filled($platform['label']) || filled($platform['media']))->values();

    if ($platforms->isEmpty()) {
        $platforms = collect([
            ['label' => 'GA4', 'media' => null, 'fallback' => asset('uploads/placeholders/ga4-icon.png'), 'alt' => 'Google Analytics 4 icon'],
            ['label' => 'GTM', 'media' => null, 'fallback' => asset('uploads/placeholders/gtm-icon.png'), 'alt' => 'Google Tag Manager icon'],
            ['label' => 'Looker Studio', 'media' => null, 'fallback' => asset('uploads/placeholders/looker-icon.png'), 'alt' => 'Looker Studio icon'],
            ['label' => 'Google Ads', 'media' => null, 'fallback' => asset('uploads/placeholders/google-ads-icon.png'), 'alt' => 'Google Ads icon'],
            ['label' => 'Meta Ads', 'media' => null, 'fallback' => asset('uploads/placeholders/meta-icon.png'), 'alt' => 'Meta Ads icon'],
            ['label' => 'TikTok Ads', 'media' => null, 'fallback' => asset('uploads/placeholders/tiktok-icon.png'), 'alt' => 'TikTok Ads icon'],
            ['label' => 'Server-Side', 'media' => null, 'fallback' => asset('uploads/placeholders/server-side-icon.png'), 'alt' => 'Server-side tracking icon'],
        ]);
    }

    $floatingPlatforms = $platforms->take(6)->values();

    $resolvePlatformImage = function (array $platform): array {
        $media = $platform['media'] ?? null;

        return [
            'src' => $media?->url ?? ($platform['fallback'] ?? asset('uploads/placeholders/default-logo.png')),
            'alt' => $media?->alt_text ?? ($platform['alt'] ?? ($platform['label'] . ' icon')),
            'label' => $platform['label'] ?? '',
        ];
    };
?>

<section class="prespa-saas-hero-section header-pattern ssa-hero-panel animated reveal-on-scroll">
    <div class="ssa-hero-stage">
        <div class="hidden lg:block ssa-floating-scene" aria-hidden="true">
            <?php $__currentLoopData = $floatingPlatforms; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $platform): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <?php ($platformImage = $resolvePlatformImage($platform)); ?>
                <div class="ssa-floating-platform ssa-floating-platform--random ssa-floating-platform--<?php echo e($index + 1); ?>">
                    <span class="ssa-floating-platform__bubble">
                        <span class="ssa-floating-platform__icon">
                            <img src="<?php echo e($platformImage['src']); ?>" alt="<?php echo e($platformImage['alt']); ?>">
                        </span>
                        <span class="ssa-floating-platform__text"><?php echo e($platformImage['label']); ?></span>
                    </span>
                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>

        <div class="text-center ssa-hero-stage__content">
            <div class="inline-flex items-center gap-3 prespa-saas-box ssa-badge">
                <img src="<?php echo e(asset('assets/themes/prespa-saas/assets/img/ps-patterns/icons/zap.png')); ?>" alt="">
                <span><?php echo e($hero['eyebrow'] ?? 'Built for modern measurement'); ?></span>
                <span class="ssa-badge-highlight"><?php echo e($hero['eyebrow_highlight'] ?? 'Track with confidence'); ?></span>
            </div>

            <h1 class="wp-block-heading ssa-hero-title"><?php echo $hero['title_html'] ?? '<span class="ssa-hero-title__prefix">Accurate tracking for every</span><span class="prespa-saas-animated-text" data-typed-words="Analytics|Tracking|Reporting|Advertising|Meta Ads|TikTok Ads|Google Ads|Google Analytics 4">Analytics</span>'; ?></h1>
            <p class="ssa-hero-copy"><?php echo e($hero['description'] ?? 'Clean measurement systems for GA4, GTM, ad pixels, dashboards, and server-side tracking.'); ?></p>

            <div class="wp-block-buttons is-layout-flex justify-center ssa-hero-actions">
                <div class="wp-block-button p-btn-animation-hover-arrow">
                    <a class="wp-block-button__link has-background wp-element-button ssa-gradient-button" href="<?php echo e(url($hero['primary_cta_url'] ?? '/services')); ?>">
                        <?php echo e($hero['primary_cta_label'] ?? 'Explore Services'); ?>

                    </a>
                </div>

                <div class="wp-block-button p-btn-animation-hover-arrow">
                    <a class="wp-block-button__link has-background wp-element-button ssa-secondary-button" href="<?php echo e(url($hero['secondary_cta_url'] ?? '/contact')); ?>">
                        <?php echo e($hero['secondary_cta_label'] ?? 'Contact Saleem'); ?>

                    </a>
                </div>
            </div>

            <div class="ssa-platform-strip" aria-label="Supported tracking platforms">
                <?php $__currentLoopData = $platforms; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $platform): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php ($platformImage = $resolvePlatformImage($platform)); ?>
                    <div class="ssa-platform-chip">
                        <span class="ssa-platform-chip__icon">
                            <img src="<?php echo e($platformImage['src']); ?>" alt="<?php echo e($platformImage['alt']); ?>">
                        </span>
                        <span><?php echo e($platformImage['label']); ?></span>
                    </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
        </div>
        <div class="ssa-hero-visual">
            <div class="ssa-hero-visual__frame">
                <img src="<?php echo e($heroImage?->url ?? asset('assets/themes/prespa-saas/assets/img/ps-patterns/hero-image.png')); ?>" alt="<?php echo e($heroImage?->alt_text ?? 'Analytics dashboard preview'); ?>">
            </div>
        </div>
    </div>
</section>
<?php /**PATH /home/xsoftdev/saleemsail.xsoftdevelop.com/resources/views/frontend/partials/home/hero.blade.php ENDPATH**/ ?>