<?php
    $siteName = $settings->site_name ?? config('app.name', 'Saleem Sial Analytics');
    $brandVersion = $settings?->updated_at?->timestamp ?? $settings?->logo_media_id ?? '1';
    $logo = ($settings?->logo_url ?? asset('uploads/placeholders/default-logo.png')) . '?v=' . $brandVersion;
    $socialLinks = $settings->social_links ?? [];
    $headerCtaLabel = $settings->header_cta_label ?? 'Contact';
    $headerCtaUrl = $settings->header_cta_url ?? '/contact';
    $navItems = [
        ['label' => 'Home', 'route' => 'home'],
        ['label' => 'About', 'route' => 'about'],
        ['label' => 'Blog', 'route' => 'blog'],
        ['label' => 'Services', 'route' => 'services.index'],
        ['label' => 'Contact', 'route' => 'contact'],
    ];
?>

<?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>',
        };
    };
?>

<header class="site-header static-header" data-sticky-header x-data="{ open: false }" :class="{ 'menu-open': open }" @keydown.escape.window="open = false" x-effect="document.body.classList.toggle('nav-is-open', open)">
    <div class="top-menu">
        <div class="header-content-wrapper">
            <ul id="top-menu" class="nav-menu">
                <?php if(! empty($settings?->contact_email)): ?>
                    <li><a href="mailto:<?php echo e($settings->contact_email); ?>"><?php echo e($settings->contact_email); ?></a></li>
                <?php endif; ?>
                <?php if(! empty($settings?->contact_phone)): ?>
                    <li><a href="tel:<?php echo e($settings->contact_phone); ?>"><?php echo e($settings->contact_phone); ?></a></li>
                <?php endif; ?>
            </ul>

            <ul class="header-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>
    </div>

    <div class="main-navigation-container">
        <div class="header-content-wrapper">
            <div class="site-branding">
                <a class="custom-logo-link light-mode-logo" href="<?php echo e(route('home')); ?>" rel="home">
                    <img class="custom-logo" alt="<?php echo e($siteName); ?>" src="<?php echo e($logo); ?>">
                </a>

                <div class="site-meta">
                    <div class="site-title"><a href="<?php echo e(route('home')); ?>" rel="home"><?php echo e($siteName); ?></a></div>
                </div>
            </div>

            <nav id="main-navigation" class="main-navigation site-menu" :class="{ 'toggled': open, 'is-open': open }" aria-label="Main navigation" @click.outside="if (window.innerWidth < 901) open = false">
                <button class="menu-toggle" type="button" @click="open = !open" :aria-expanded="open.toString()" aria-controls="site-menu" aria-label="Toggle Navigation">
                    <span class="menu-toggle-bars" :class="{ 'is-active': open }">
                        <span></span>
                        <span></span>
                        <span></span>
                    </span>
                </button>

                <div class="slide-menu slide-section" x-cloak>
                    <ul id="primary-menu" class="nav-menu">
                        <?php $__currentLoopData = $navItems; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <li class="menu-item <?php echo e(request()->routeIs($item['route']) ? 'current_page_item current-menu-item' : ''); ?>">
                                <a href="<?php echo e(route($item['route'])); ?>" @click="open = false"><span><?php echo e($item['label']); ?></span></a>
                            </li>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                        <?php if(auth()->guard()->check()): ?>
                            <li class="menu-item">
                                <a href="<?php echo e(route('admin.dashboard')); ?>" @click="open = false"><span>Dashboard</span></a>
                            </li>
                        <?php endif; ?>

                        <li class="wp-block-button call-to-action">
                            <a class="wp-block-button__link ssa-header-button" href="<?php echo e(url($headerCtaUrl)); ?>" @click="open = false"><?php echo e($headerCtaLabel); ?></a>
                        </li>
                    </ul>
                </div>
            </nav>
        </div>
    </div>
</header>
<?php /**PATH C:\xampp\htdocs\saleemsailAna.com\resources\views/partials/header.blade.php ENDPATH**/ ?>