@php
    $partners = $data['partners'] ?? collect();
@endphp

<div class="site-section overflow-hidden">
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
        <div class="text-center mb-12 reveal">
            <h2 class="section-title mx-auto">{{ $section->title ?? 'شركاؤنا' }}</h2>
            @if($section->subtitle)
                <p class="mt-4 text-gray-500 text-lg">{{ $section->subtitle }}</p>
            @endif
        </div>

        @if($partners->count())
            <div class="relative overflow-hidden reveal">
                <div class="partners-track">
                    @for($i = 0; $i < 2; $i++)
                        @foreach($partners as $partner)
                            @if($partner->logo)
                                <div class="shrink-0 w-36 h-20 flex items-center justify-center grayscale hover:grayscale-0 opacity-60 hover:opacity-100 transition-all duration-300">
                                    <img src="{{ $partner->logo->url }}"
                                         alt="{{ $partner->name }}"
                                         class="max-w-full max-h-full object-contain">
                                </div>
                            @else
                                <div class="shrink-0 px-6 py-3 rounded-lg bg-gray-50 border border-gray-200 flex items-center justify-center">
                                    <span class="text-gray-400 text-sm font-medium">{{ $partner->name }}</span>
                                </div>
                            @endif
                        @endforeach
                    @endfor
                </div>
            </div>
        @else
            <div class="flex items-center justify-center gap-6">
                @for($i = 0; $i < 5; $i++)
                    <div class="skeleton-block w-36 h-16 !rounded-lg"></div>
                @endfor
            </div>
            <div class="empty-state mt-4">
                <p class="text-sm">لم يُضف شركاء بعد</p>
            </div>
        @endif
    </div>
</div>
