<nav class="site-nav {{ $settings->navbar_style === 'solid' ? 'site-nav--solid' : '' }}" id="site-navbar">
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
        <div class="flex items-center justify-between h-20">
            {{-- Logo + Name --}}
            <a href="#" class="flex items-center gap-3 group">
                @if($academy->logo_path)
                    <img src="{{ asset('storage/' . $academy->logo_path) }}"
                         alt="{{ $academy->name_ar }}"
                         class="h-10 w-10 rounded-lg object-contain transition-transform group-hover:scale-110">
                @endif
                <span class="text-lg font-bold text-white">{{ $academy->name_ar }}</span>
            </a>

            {{-- Desktop Navigation --}}
            <div class="hidden lg:flex items-center gap-1">
                @foreach($sections->take(7) as $section)
                    <a href="#section-{{ $section->section_key->value }}"
                       class="px-3 py-2 text-sm font-medium text-white/80 hover:text-white rounded-lg hover:bg-white/5 transition-all">
                        {{ $section->title ?? $section->section_key->label() }}
                    </a>
                @endforeach
            </div>

            {{-- CTA + Login + Mobile Toggle --}}
            <div class="flex items-center gap-3">
                @php
                    $heroSection = $sections->firstWhere('section_key', \App\Domain\Website\Enums\SectionKey::Cta);
                    $ctaText = $heroSection?->getSetting('cta_text') ?? 'سجّل الآن';
                @endphp
                <a href="#section-contact" class="hidden sm:inline-flex site-btn site-btn--primary text-sm !py-2 !px-4">
                    {{ $ctaText }}
                </a>

                @auth
                    <a href="{{ route('dashboard') }}" class="hidden sm:inline-flex items-center gap-1 px-3 py-2 text-sm font-medium text-white/80 hover:text-white rounded-lg hover:bg-white/10 transition-all">
                        <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"/></svg>
                        {{ __('لوحة التحكم') }}
                    </a>
                @else
                    <a href="{{ route('login') }}" class="hidden sm:inline-flex items-center gap-1 px-3 py-2 text-sm font-medium text-white/80 hover:text-white rounded-lg hover:bg-white/10 transition-all">
                        <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1"/></svg>
                        {{ __('تسجيل الدخول') }}
                    </a>
                @endauth

                {{-- Mobile Menu Button --}}
                <button type="button"
                        class="lg:hidden p-2 rounded-lg text-white/80 hover:text-white hover:bg-white/10 transition-colors"
                        onclick="document.getElementById('mobile-menu').classList.toggle('hidden')"
                        aria-label="القائمة">
                    <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"/>
                    </svg>
                </button>
            </div>
        </div>
    </div>

    {{-- Mobile Menu --}}
    <div id="mobile-menu" class="hidden lg:hidden bg-black/95 backdrop-blur-lg border-t border-white/10">
        <div class="px-4 py-4 space-y-1">
            @foreach($sections as $section)
                <a href="#section-{{ $section->section_key->value }}"
                   class="block px-4 py-3 text-white/80 hover:text-white hover:bg-white/5 rounded-lg transition-colors"
                   onclick="document.getElementById('mobile-menu').classList.add('hidden')">
                    {{ $section->title ?? $section->section_key->label() }}
                </a>
            @endforeach

            <div class="border-t border-white/10 pt-3 mt-3">
                @auth
                    <a href="{{ route('dashboard') }}" class="block px-4 py-3 text-white/80 hover:text-white hover:bg-white/5 rounded-lg transition-colors">
                        {{ __('لوحة التحكم') }}
                    </a>
                @else
                    <a href="{{ route('login') }}" class="block px-4 py-3 text-white/80 hover:text-white hover:bg-white/5 rounded-lg transition-colors">
                        {{ __('تسجيل الدخول') }}
                    </a>
                @endauth
            </div>
        </div>
    </div>
</nav>
