@php
    $stats = $data['stats'] ?? [];
    $displayStats = [
        'participants' => ['label' => 'طالب نشط', 'icon' => 'M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z'],
        'trainers' => ['label' => 'مدرب محترف', 'icon' => 'M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z'],
        'branches' => ['label' => 'فرع', 'icon' => 'M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4'],
        'programs' => ['label' => 'برنامج تدريبي', 'icon' => 'M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253'],
        'activities' => ['label' => 'نشاط رياضي', 'icon' => 'M13 10V3L4 14h7v7l9-11h-7z'],
    ];
    $hasStats = !empty($stats) && array_sum($stats) > 0;
@endphp

<div class="stats-band py-16 lg:py-20">
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
        @if($section->title)
            <div class="text-center mb-12 reveal">
                <h2 class="section-title mx-auto">{{ $section->title ?? 'إنجازاتنا' }}</h2>
            </div>
        @endif

        @if($hasStats)
            <div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-8">
                @foreach($displayStats as $key => $meta)
                    @if(($stats[$key] ?? 0) > 0)
                        <div class="text-center reveal reveal--delay-{{ $loop->index + 1 }}">
                            <div class="w-14 h-14 mx-auto mb-4 rounded-xl bg-[var(--site-accent)]/10 flex items-center justify-center">
                                <svg class="w-7 h-7 text-[var(--site-accent)]" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="{{ $meta['icon'] }}"/>
                                </svg>
                            </div>
                            <span class="stat-number" data-counter="{{ $stats[$key] }}" data-suffix="+">0</span>
                            <span class="block mt-2 text-white/60 text-sm">{{ $meta['label'] }}</span>
                        </div>
                    @endif
                @endforeach
            </div>
        @else
            <div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-8">
                @foreach($displayStats as $key => $meta)
                    <div class="text-center reveal reveal--delay-{{ $loop->index + 1 }}">
                        <div class="w-14 h-14 mx-auto mb-4 rounded-xl bg-white/5 flex items-center justify-center">
                            <svg class="w-7 h-7 text-white/20" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="{{ $meta['icon'] }}"/>
                            </svg>
                        </div>
                        <span class="block text-2xl font-bold text-white/20">0+</span>
                        <span class="block mt-2 text-white/30 text-sm">{{ $meta['label'] }}</span>
                    </div>
                @endforeach
            </div>
        @endif
    </div>
</div>
