@model IEnumerable<SportsDivision.Application.DTOs.ReportDtos.ScoresByEventReportDto>
@{
    ViewData["Title"] = "Scores by Event";
}

<h2>Scores by Event</h2>
<hr />

@foreach (var evt in Model)
{
    <div class="card shadow-sm mb-3">
        <div class="card-header bg-dark text-white">
            <h5 class="mb-0">@evt.EventName - @evt.EventLevelName <span class="badge bg-info">@evt.Category</span></h5>
        </div>
        <div class="card-body p-0">
            <table class="table table-hover mb-0">
                <thead><tr><th>#</th><th>Student</th><th>School</th><th>Performance</th><th>Points</th><th>Placement Pts</th></tr></thead>
                <tbody>
                    @foreach (var s in evt.Scores)
                    {
                        <tr>
                            <td>@(s.Placement?.ToString() ?? "-")</td>
                            <td>@s.StudentName</td>
                            <td>@s.SchoolName</td>
                            <td>@s.RawPerformance</td>
                            <td>@s.CalculatedPoints</td>
                            <td><strong>@s.PlacementPoints</strong></td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>
    </div>
}

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