@foreach($agencies as $agency)
    <a href="{{ route('customer.agency.show', $agency->slug) }}"
       class="agency-card bg-gradient-to-br from-white to-gray-50 border-2 border-gray-200 rounded-3xl p-8 hover:border-blue-500 hover:shadow-2xl transition-all duration-300 group">

        <div class="flex flex-col items-center text-center mb-6">
            @if($agency->logo)
                <img src="{{ asset('storage/' . $agency->logo) }}" alt="{{ $agency->name }}"
                     class="w-24 h-24 rounded-2xl object-cover border-4 border-white shadow-lg mb-4 group-hover:scale-110 transition-transform">
            @else
                <div
                    class="w-24 h-24 bg-gradient-to-br from-blue-600 to-purple-600 rounded-2xl flex items-center justify-center text-white font-black text-4xl shadow-lg mb-4 group-hover:scale-110 transition-transform">
                    {{ strtoupper(substr($agency->name, 0, 1)) }}
                </div>
            @endif

            <h3 class="text-xl font-bold text-gray-900 group-hover:text-blue-600 transition-colors mb-2">
                {{ $agency->name }}
            </h3>

            <div class="flex items-center gap-1 text-sm">
                <svg class="w-5 h-5 text-yellow-500" fill="currentColor" viewBox="0 0 20 20">
                    <path
                        d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"/>
                </svg>
                <span class="font-bold text-gray-900">4.{{ rand(6,9) }}</span>
                <span class="text-gray-600">({{ rand(50, 300) }})</span>
            </div>
        </div>

        <div class="space-y-4 mb-6">
            <div class="flex items-start gap-3 text-sm">
                <div class="mt-0.5">
                    <svg class="w-5 h-5 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                              d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
                    </svg>
                </div>
                <div>
                    <span class="font-bold text-gray-900">{{ $agency->tours_count }}</span>
                    <span class="text-gray-600"> Aktif Tur</span>
                </div>
            </div>

            @if($agency->city)
                <div class="flex items-start gap-3 text-sm">
                    <div class="mt-0.5">
                        <svg class="w-5 h-5 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                                  d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"/>
                        </svg>
                    </div>
                    <span class="text-gray-700">{{ $agency->city }}</span>
                </div>
            @endif

            @if($agency->description)
                <p class="text-sm text-gray-600 line-clamp-2">
                    {{ Str::limit($agency->description, 80) }}
                </p>
            @endif
        </div>

        <div class="flex gap-2">
            <div
                class="flex-1 text-center px-4 py-3 bg-gradient-to-r from-blue-50 to-purple-50 text-blue-700 rounded-xl font-bold group-hover:from-blue-600 group-hover:to-purple-600 group-hover:text-white transition-all">
                Acenteyi İncele
            </div>
        </div>

        {{-- Verified Badge --}}
        <div class="absolute top-4 right-4 bg-green-500 text-white p-2 rounded-full shadow-lg">
            <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 20 20">
                <path fill-rule="evenodd"
                      d="M6.267 3.455a3.066 3.066 0 001.745-.723 3.066 3.066 0 013.976 0 3.066 3.066 0 001.745.723 3.066 3.066 0 012.812 2.812c.051.643.304 1.254.723 1.745a3.066 3.066 0 010 3.976 3.066 3.066 0 00-.723 1.745 3.066 3.066 0 01-2.812 2.812 3.066 3.066 0 00-1.745.723 3.066 3.066 0 01-3.976 0 3.066 3.066 0 00-1.745-.723 3.066 3.066 0 01-2.812-2.812 3.066 3.066 0 00-.723-1.745 3.066 3.066 0 010-3.976 3.066 3.066 0 00.723-1.745 3.066 3.066 0 012.812-2.812zm7.44 5.252a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z"
                      clip-rule="evenodd"/>
            </svg>
        </div>
    </a>
@endforeach
