{{template "base" .}}

{{define "content"}}
<div class="space-y-8">
    <!-- Header -->
    <div>
        <h1 class="text-3xl font-bold text-gray-900 dark:text-white">Browse Documents</h1>
        <p class="mt-1 text-gray-500 dark:text-gray-400">Explore your documents by category</p>
    </div>

    <!-- Category Grid -->
    <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6">
        {{range .Categories}}
        {{$count := index $.CatStats .}}
        <a href="/browse/{{.}}" class="group">
            <div class="bg-white dark:bg-gray-800 rounded-2xl p-6 shadow-sm border border-gray-100 dark:border-gray-700 hover:border-brand-300 dark:hover:border-brand-600 transition-all card-hover">
                <div class="flex items-center justify-between mb-4">
                    <span class="text-4xl">{{categoryIcon .}}</span>
                    <span class="text-2xl font-bold text-gray-300 dark:text-gray-600 group-hover:text-brand-500 transition-colors">{{$count}}</span>
                </div>
                <h3 class="text-lg font-semibold text-gray-900 dark:text-white group-hover:text-brand-600 dark:group-hover:text-brand-400 transition-colors">{{title .}}</h3>
                <p class="text-sm text-gray-500 dark:text-gray-400 mt-1">{{$count}} document{{if ne $count 1}}s{{end}}</p>
            </div>
        </a>
        {{end}}
    </div>
</div>
{{end}}
