@extends('layouts.public')

@section('title', $category->name . ' - IPA')

@section('content')
    <section class="bg-gradient-to-br from-primary-500 to-primary-600 text-white">
        <div class="container-custom py-12">
            <nav class="text-sm text-white/80 mb-3">
                <a href="{{ route('home') }}" class="hover:text-white">Beranda</a>
                <span class="mx-2">/</span>
                <span>Kategori</span>
                <span class="mx-2">/</span>
                <span class="text-white">{{ $category->name }}</span>
            </nav>
            <div class="grid gap-4 lg:grid-cols-[1.4fr_0.6fr] lg:items-end">
                <div>
                    <h1 class="text-3xl lg:text-4xl font-bold">Kategori: {{ $category->name }}</h1>
                    <p class="text-white/90 mt-1">Jelajahi aset daerah dengan kategori ini.</p>
                </div>
                <div class="rounded-3xl bg-white/10 border border-white/20 p-5 text-center">
                    <div class="text-sm text-white/70">Total aset</div>
                    <div class="mt-3 text-3xl font-bold text-white">{{ $assets->total() }}</div>
                </div>
            </div>
        </div>
    </section>

    <section class="container-custom py-8">
        @if($assets->count())
            <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-5">
                @foreach($assets as $asset)
                    <x-asset-card :asset="$asset" />
                @endforeach
            </div>
            <div class="mt-8">{{ $assets->links() }}</div>
        @else
            <div class="card p-12 text-center">
                <p class="text-gray-500">Belum ada aset dalam kategori ini.</p>
            </div>
        @endif
    </section>
@endsection