<div class="container-fluid">
    <div class="d-flex justify-content-between align-items-center mb-3">
        <h2 class="mb-0">Kategori Görüntülenmeleri</h2>
        <div class="d-flex gap-2 align-items-center">
            <form class="d-flex" action="/admin/content/product-category-views" method="GET">
                <input type="search" name="category_id" class="form-control form-control-sm me-2"
                    placeholder="Category ID..." value="{{ .CategoryID }}">
                <button class="btn btn-sm btn-outline-secondary" type="submit"><i class="bi bi-search"></i></button>
            </form>
        </div>
    </div>

    <div class="card border-0 shadow-sm">
        <div class="table-responsive">
            <table class="table table-hover align-middle mb-0">
                <thead class="bg-light">
                    <tr>
                        <th class="ps-3 border-0 text-muted small text-uppercase">ID</th>
                        <th class="border-0 text-muted small text-uppercase">Kategori ID</th>
                        <th class="border-0 text-muted small text-uppercase">IP Adresi</th>
                        <th class="border-0 text-muted small text-uppercase">Ziyaret Tarihi</th>
                    </tr>
                </thead>
                <tbody>
                    {{ range .Views }}
                    <tr>
                        <td class="ps-3"><span class="text-secondary fw-medium">#{{ .ID }}</span></td>
                        <td><span class="badge bg-primary">Kategori #{{ .CategoryID }}</span></td>
                        <td><span class="text-dark font-monospace">{{ .IPAddress }}</span></td>
                        <td class="text-secondary small">
                            {{ .CreatedAt.Format "02.01.2006 15:04" }}
                        </td>
                    </tr>
                    {{ else }}
                    <tr>
                        <td colspan="4" class="text-center py-5 text-muted">
                            <i class="bi bi-eye fs-1 d-block mb-2"></i>
                            Kategorileriniz henüz görüntülenmemiş veya veri yok.
                        </td>
                    </tr>
                    {{ end }}
                </tbody>
            </table>
        </div>
    </div>
</div>