@foreach($tours as $tour)
    <a href="{{ route('customer.agency.tours.detail', ['agency' => $tour->agency->slug, 'type' => 'kultur-turu', 'slug' => $tour->slug]) }}"
       class="tour-card bg-white rounded-3xl overflow-hidden shadow-lg hover:shadow-2xl transition-all duration-500 group border-2 border-transparent hover:border-purple-200">
        <div class="relative overflow-hidden h-72">
            @if($tour->coverImage && $tour->coverImage->galleryImage)
                <img src="{{ $tour->coverImage->galleryImage->full_url }}" alt="{{ $tour->name }}"
                     class="w-full h-full object-cover group-hover:scale-110 transition-transform duration-700">
            @else
                <img src="https://picsum.photos/600/400?random={{ $tour->id }}" alt="{{ $tour->name }}"
                     class="w-full h-full object-cover group-hover:scale-110 transition-transform duration-700">
            @endif

            @if($tour->defaultPricing && $tour->defaultPricing->early_booking_discount > 0)
                <div
                    class="absolute top-5 right-5 bg-gradient-to-r from-amber-500 to-orange-500 text-white px-5 py-3 rounded-2xl font-black text-lg shadow-xl">
                    %{{ $tour->defaultPricing->early_booking_discount }} İndirim
                </div>
            @endif

            @if($tour->is_featured)
                <div
                    class="absolute top-5 left-5 bg-gradient-to-r from-blue-500 to-purple-500 text-white px-4 py-2 rounded-xl font-bold text-sm shadow-lg">
                    <svg class="w-4 h-4 inline" 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>
                    Öne Çıkan
                </div>
            @endif

            <div
                class="absolute bottom-5 left-5 bg-white/95 backdrop-blur-sm px-5 py-3 rounded-2xl flex items-center gap-2 shadow-lg">
                <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">{{ number_format($tour->rating_average, 1) }}</span>
                <span class="text-sm text-gray-600">({{ $tour->rating_count }})</span>
            </div>
        </div>

        <div class="p-7">
            <div class="flex items-center gap-2 text-sm text-gray-600 mb-3">
                <svg class="w-4 h-4 text-purple-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>
                {{ $tour->departureCity->city ?? 'Türkiye' }}
                @if($tour->arrivalCity && $tour->arrivalCity->id != $tour->departureCity->id)
                    → {{ $tour->arrivalCity->city }}
                @endif
            </div>

            <h3 class="text-xl font-bold text-gray-900 mb-3 line-clamp-2 group-hover:text-purple-600 transition-colors">
                {{ $tour->name }}
            </h3>

            <div class="flex items-center gap-4 text-sm text-gray-600 mb-5">
                @if($tour->days)
                    <div class="flex items-center gap-1">
                        <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="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"/>
                        </svg>
                        {{ $tour->days }} Gün
                    </div>
                @endif
                @if($tour->min_participants || $tour->max_participants)
                    <div class="flex items-center gap-1">
                        <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="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"/>
                        </svg>
                        {{ $tour->min_participants }}-{{ $tour->max_participants }} Kişi
                    </div>
                @endif
                @if($tour->has_guide)
                    <div class="flex items-center gap-1 text-green-600">
                        <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="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
                        </svg>
                        Rehberli
                    </div>
                @endif
            </div>

            <div class="flex items-center justify-between pt-5 border-t border-gray-100">
                <div>
                    @if($tour->defaultPricing)
                        <div class="text-3xl font-black text-gray-900">
                            ₺{{ number_format($tour->defaultPricing->adult_price, 0, ',', '.') }}
                        </div>
                        @if($tour->defaultPricing->early_booking_discount > 0)
                            <div class="text-sm text-gray-500 line-through">
                                ₺{{ number_format($tour->defaultPricing->adult_price / (1 - $tour->defaultPricing->early_booking_discount/100), 0, ',', '.') }}
                            </div>
                        @endif
                    @else
                        <div class="text-2xl font-bold text-gray-900">Fiyat Bilgisi</div>
                        <div class="text-sm text-gray-500">İletişime Geçin</div>
                    @endif
                </div>
                <button
                    class="px-8 py-4 bg-gradient-to-r from-purple-600 to-pink-600 text-white rounded-2xl font-bold hover:shadow-lg hover:scale-105 transition-all">
                    İncele
                </button>
            </div>
        </div>
    </a>
@endforeach
