@model IEnumerable<SportsDivision.Application.DTOs.ReportDtos.PopularEventsReportDto>
@{
    ViewData["Title"] = "Popular Events";
}

<div class="d-flex justify-content-between align-items-center mb-3">
    <h2 class="mb-0">Popular Events Report</h2>
    <div class="d-flex gap-2">
        <a asp-action="PopularEventsExcel" asp-route-tournamentId="@ViewBag.TournamentId" class="btn btn-success"><i class="bi bi-file-earmark-excel"></i> Export to Excel</a>
        <a asp-action="PopularEventsPdf" asp-route-tournamentId="@ViewBag.TournamentId" class="btn btn-outline-danger"><i class="bi bi-file-earmark-pdf"></i> PDF</a>
    </div>
</div>
<hr />

<table class="table table-striped table-hover">
    <thead class="table-dark">
        <tr><th>Event</th><th>Category</th><th class="text-center">Total</th><th class="text-center">Male</th><th class="text-center">Female</th></tr>
    </thead>
    <tbody>
        @foreach (var e in Model)
        {
            <tr>
                <td>@e.EventName</td>
                <td><span class="badge bg-info">@e.Category</span></td>
                <td class="text-center"><strong>@e.RegistrationCount</strong></td>
                <td class="text-center">@e.MaleCount</td>
                <td class="text-center">@e.FemaleCount</td>
            </tr>
        }
    </tbody>
</table>

<a asp-action="Index" class="btn btn-secondary">Back to Reports</a>
