<footer class="site-footer">
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-16">
        <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-10">
            {{-- Academy Info --}}
            <div class="lg:col-span-2">
                <div class="flex items-center gap-3 mb-4">
                    @if($academy->logo_path)
                        <img src="{{ asset('storage/' . $academy->logo_path) }}"
                             alt="{{ $academy->name_ar }}"
                             class="h-12 w-12 rounded-lg object-contain">
                    @endif
                    <span class="text-xl font-bold text-white">{{ $academy->name_ar }}</span>
                </div>
                @if($settings->site_description)
                    <p class="text-white/60 leading-relaxed max-w-md">
                        {{ Str::limit($settings->site_description, 200) }}
                    </p>
                @endif

                @if(is_array($settings->social_links ?? null) && count(array_filter($settings->social_links)))
                    <div class="flex items-center gap-3 mt-6">
                        @foreach(['facebook', 'instagram', 'twitter', 'youtube', 'tiktok'] as $platform)
                            @if(!empty($settings->social_links[$platform]))
                                <a href="{{ $settings->social_links[$platform] }}"
                                   target="_blank"
                                   rel="noopener"
                                   class="w-10 h-10 rounded-lg bg-white/5 border border-white/10 flex items-center justify-center text-white/60 hover:text-[var(--site-accent)] hover:border-[var(--site-accent)] transition-all"
                                   aria-label="{{ $platform }}">
                                    @include("website.icons.{$platform}")
                                </a>
                            @endif
                        @endforeach
                    </div>
                @endif
            </div>

            {{-- Quick Links --}}
            <div>
                <h4 class="text-white font-bold mb-4">روابط سريعة</h4>
                <ul class="space-y-2">
                    @foreach($sections->take(6) as $section)
                        <li>
                            <a href="#section-{{ $section->section_key->value }}"
                               class="text-white/60 hover:text-[var(--site-accent)] transition-colors text-sm">
                                {{ $section->title ?? $section->section_key->label() }}
                            </a>
                        </li>
                    @endforeach
                </ul>
            </div>

            {{-- Contact Info --}}
            <div>
                <h4 class="text-white font-bold mb-4">تواصل معنا</h4>
                <ul class="space-y-3 text-sm">
                    @if($academy->phone)
                        <li class="flex items-center gap-2 text-white/60">
                            <svg class="w-4 h-4 text-[var(--site-accent)]" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"/></svg>
                            <span dir="ltr">{{ $academy->phone }}</span>
                        </li>
                    @endif
                    @if($academy->email)
                        <li class="flex items-center gap-2 text-white/60">
                            <svg class="w-4 h-4 text-[var(--site-accent)]" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"/></svg>
                            <span>{{ $academy->email }}</span>
                        </li>
                    @endif
                    @if($settings->whatsapp_number)
                        <li class="flex items-center gap-2 text-white/60">
                            <svg class="w-4 h-4 text-green-400" fill="currentColor" viewBox="0 0 24 24"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347z"/></svg>
                            <span dir="ltr">{{ $settings->whatsapp_number }}</span>
                        </li>
                    @endif
                </ul>
            </div>
        </div>

        {{-- Bottom Bar --}}
        <div class="mt-12 pt-8 border-t border-white/10 flex flex-col sm:flex-row items-center justify-between gap-4">
            <p class="text-white/40 text-sm">
                &copy; {{ date('Y') }} {{ $academy->name_ar }}. جميع الحقوق محفوظة.
            </p>
            <p class="text-white/30 text-xs">
                مدعوم بنظام El Captain
            </p>
        </div>
    </div>
</footer>
