<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ $title }}</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 20px;
            font-size: 12px;
        }
        @page {
            size: A4 landscape;
            margin: 0.1mm;
        }
        .header-container {
            display: flex;
            align-items: center;
            margin-bottom: 10px;
            flex-wrap: wrap;
        }
        .header-logo {
            width: 40%;
            height: auto;
            margin-right: 10px;
        }
        .title {
            text-align: center;
            font-weight: bold;
        }
        .title-last {
            margin-bottom: 15px;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 5px;
            table-layout: fixed;
        }
        th, td {
            border: 1px solid black;
            padding: 3px;
            text-align: center;
            vertical-align: middle;
            word-wrap: break-word;
        }
        th {
            font-weight: bold;
            padding: 8px 3px;
        }
        .no { width: 3%; }
        .hari { width: 6%; }
        .tanggal { width: 9%; }
        .siswa { width: 18%; }
        .guru { width: 18%; }
        .kelas { width: 6%; }
        .jamke { width: 6%; }
        .waktu { width: 7%; }
        .komputer { width: 7%; }
        .mapel { width: 25%; }
    </style>
</head>
<body>
    <div class="header-container">
        <img class="header-logo" src="{{ public_path('images/top-provinsi.jpg') }}">
    </div>

    <hr>

    <div class="title">{!! $title !!}</div>
    <div class="title title-last">{{ $subtitle }}</div>

    <table>
        <thead>
            <tr>
                <th class="no">No</th>
                <th class="hari">Hari</th>
                <th class="tanggal">Tanggal</th>
                <th class="guru">Nama Guru Pengajar</th>
                <th class="kelas">Kelas</th>
                <th class="jamke">Jam Ke-</th>
                <th class="waktu">Masuk</th>
                <th class="waktu">Keluar</th>
                <th class="mapel">Mata Pelajaran</th>
            </tr>
        </thead>
        <tbody>
            @foreach($rekapans as $index => $rekapan)
            <tr>
                <td>{{ $index + 1 }}</td>
                <td>{{ ucfirst($rekapan->jadwal->hari) }}</td>
                <td>{{ $rekapan->tanggal->translatedFormat('d F Y') }}</td>
                <td>{{ $rekapan->guru->nama ?? '-' }}</td>
                <td>{{ $rekapan->kelas->nama_kelas ?? '-' }}</td>
                <td>{{ $rekapan->jadwal->jam_ke }}</td>
                <td>{{ $rekapan->jadwal->waktu_mulai->format('H:i') }}</td>
                <td>{{ $rekapan->jadwal->waktu_selesai->format('H:i') }}</td>
                <td>{{ $rekapan->mapel->nama_mapel ?? '-' }}</td>
            </tr>
            @endforeach
        </tbody>
    </table>
</body>
</html>