@extends('layouts.student')

@section('title', 'Coursework Marks')

@section('content')
<div class="container mt-4">
    <div class="card shadow-sm">
        <div class="card-header bg-success text-white">
            <h4 class="mb-0">Coursework Marks</h4>
        </div>

        <div class="card-body">
            @if($courseworks->isEmpty())
                <p>No coursework records found.</p>
            @else
                <table class="table table-bordered table-striped">
                    <thead class="thead-dark">
                        <tr>
                            <th>Course Code</th>
                            <th>Course Name</th>
                            <th>Assessment 1<br><small>[10%]</small></th>
                            <th>Assessment 2<br><small>[10%]</small></th>
                            <th>Assessment 3<br><small>[10%]</small></th>
                            <th>Assessment 4<br><small>[10%]</small></th>
                            <th>Total<br><small>[40%]</small></th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach($courseworks as $cw)
                        <tr>
                            <td>{{ $cw->course_code }}</td>
                            <td>{{ $cw->course_description }}</td>
                            <td>{{ $cw->assessment_1 }}</td>
                            <td>{{ $cw->assessment_2 }}</td>
                            <td>{{ $cw->assessment_3 }}</td>
                            <td>{{ $cw->assessment_4 }}</td>
                            <td class="font-weight-bold text-primary">{{ $cw->total }}</td>
                        </tr>
                        @endforeach
                    </tbody>
                </table>
            @endif
        </div>
    </div>
</div>
@endsection
