@extends('member.layouts.app')

@section('title', 'Partners')

@section('content')
    @php
        $hasMembership = request()->boolean('membership', true);
        $partners = [
            ['name' => 'Hilton Colombo', 'category' => 'Dining', 'rating' => 4.8, 'location' => 'Colombo 01', 'phone' => '011-2492492', 'website' => 'hilton.com'],
            ['name' => 'Odel', 'category' => 'Shopping', 'rating' => 4.5, 'location' => 'Multiple Locations', 'phone' => '011-4625800', 'website' => 'odel.lk'],
            ['name' => 'Jetwing Hotels', 'category' => 'Travel', 'rating' => 4.9, 'location' => 'Islandwide', 'phone' => '011-2345700', 'website' => 'jetwinghotels.com'],
            ['name' => 'Laugfs Supermarkets', 'category' => 'Groceries', 'rating' => 4.2, 'location' => 'Multiple Locations', 'phone' => '011-5555555', 'website' => 'laugfs.lk'],
            ['name' => 'Nawaloka Hospitals', 'category' => 'Health', 'rating' => 4.6, 'location' => 'Colombo 02', 'phone' => '011-5577111', 'website' => 'nawaloka.com'],
            ['name' => 'Scope Cinemas', 'category' => 'Entertainment', 'rating' => 4.7, 'location' => 'Colombo City Centre', 'phone' => '011-2083063', 'website' => 'scopecinemas.com'],
        ];
    @endphp

    <div class="space-y-6">
        <div><h1 class="text-2xl font-bold text-gray-900">Our Partners</h1><p class="text-gray-600">Browse our network of trusted partners across Sri Lanka.</p></div>
        <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
            @foreach($partners as $index => $partner)
                @php $isLocked = !$hasMembership && $index >= 3; @endphp
                <div class="relative bg-white rounded-xl border border-gray-100 shadow-sm overflow-hidden">
                    <div class="{{ $isLocked ? 'blur-sm opacity-50 pointer-events-none' : '' }}">
                        <div class="h-32 bg-gray-200 w-full relative"><div class="absolute top-3 right-3 bg-white px-2 py-1 rounded-md text-xs font-bold shadow-sm flex items-center gap-1"><i data-lucide="star" class="w-3 h-3 text-amber-400 fill-amber-400"></i>{{ $partner['rating'] }}</div></div>
                        <div class="p-5">
                            <div class="flex justify-between items-start mb-2"><h3 class="font-bold text-lg text-gray-900">{{ $partner['name'] }}</h3><span class="text-xs font-medium px-2 py-1 bg-gray-100 rounded text-gray-600">{{ $partner['category'] }}</span></div>
                            <div class="space-y-2 mt-4 text-sm text-gray-600">
                                <div class="flex items-center gap-3"><i data-lucide="map-pin" class="w-4 h-4 text-gray-400"></i>{{ $partner['location'] }}</div>
                                <div class="flex items-center gap-3"><i data-lucide="phone" class="w-4 h-4 text-gray-400"></i>{{ $partner['phone'] }}</div>
                                <div class="flex items-center gap-3"><i data-lucide="globe" class="w-4 h-4 text-gray-400"></i>{{ $partner['website'] }}</div>
                            </div>
                            <button class="w-full mt-6 py-2 text-sm font-medium text-[#0d4a4a] border border-[#0d4a4a] rounded-lg">View Profile</button>
                        </div>
                    </div>
                    @if($isLocked)
                        <div class="absolute inset-0 flex flex-col items-center justify-center z-10 bg-white/30"><div class="bg-white/90 backdrop-blur-md p-4 rounded-xl shadow-lg text-center"><i data-lucide="lock" class="w-6 h-6 text-[#0d4a4a] mx-auto mb-2"></i><p class="font-bold text-gray-900 text-sm mb-1">Partner Locked</p><p class="text-xs text-gray-500 mb-3">Upgrade to see all 500+ partners</p><button class="text-xs bg-[#0d4a4a] text-white px-3 py-1.5 rounded-lg font-medium">Upgrade Now</button></div></div>
                    @endif
                </div>
            @endforeach
        </div>
    </div>
@endsection
