<!DOCTYPE html>
<html>
<head>
    <title>Rekap Nilai Akhir - {{ $p4->nim_mahasiswa }}</title>
    <style>
        @page { margin: 1cm 2cm; }
        body { font-family: 'Times New Roman', Times, serif; font-size: 11pt; line-height: 1.4; margin: 0; padding: 0; }
        .header { width: 100%; margin-bottom: 5px; }
        .logo-box { width: 85px; text-align: center; vertical-align: middle; }
        .header-text { text-align: center; vertical-align: middle; }
        .header-text h3 { margin: 0; font-size: 14pt; font-weight: normal; }
        .header-text h2 { margin: 0; font-size: 15pt; font-weight: bold; }
        .header-text h2.fakultas { margin: 0; font-size: 13pt; font-weight: bold; }
        .address { text-align: center; font-size: 9pt; margin-top: 5px; font-weight: normal; }
        .line { border-bottom: 4px double black; margin-top: 5px; margin-bottom: 20px; }
        
        .title { text-align: center; font-weight: bold; text-decoration: underline; margin-bottom: 20px; text-transform: uppercase; }
        
        .student-table { width: 100%; margin-bottom: 20px; }
        .student-table td { vertical-align: top; padding: 2px 0; }
        
        .score-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; text-align: center; }
        .score-table th, .score-table td { border: 1px solid black; padding: 5px; }
        .score-table th { background-color: #f2f2f2; }
        .score-table .left { text-align: left; }
        
        .footer { margin-top: 40px; position: relative; }
        .signature { position: absolute; right: 0; width: 300px; text-align: left; }
    </style>
</head>
<body>
    <table class="header">
        <tr>
            <td class="logo-box">
                <img src="{{ public_path('Logouncenhitam.png') }}" alt="Logo UNCEN" style="width: 85px; height: auto;">
            </td>
            <td class="header-text">
                <h3>KEMENTERIAN PENDIDIKAN TINGGI, SAINS, <br> DAN TEKNOLOGI</h3>
                <h2>UNIVERSITAS CENDERAWASIH</h2>
                <h2 class="fakultas">FAKULTAS HUKUM</h2>
                <div class="address">
                    Jalan Kampwolker  Kelurahan Yabansai Distrik Heram Jayapura – PAPUA<br>
                    surel – <u style="color: blue;">fh@uncen.ac.id</u>
                </div>
            </td>
        </tr>
    </table>
    <div class="line"></div>

    <div class="title">REKAPITULASI PENILAIAN UJIAN SKRIPSI</div>

    <table class="student-table">
        <tr><td width="150">Nama Mahasiswa</td><td width="10">:</td><td>{{ $p4->nama_mahasiswa }}</td></tr>
        <tr><td>NIM</td><td>:</td><td>{{ $p4->nim_mahasiswa }}</td></tr>
        <tr><td>Program Studi</td><td>:</td><td>Ilmu Hukum</td></tr>
        <tr><td>Judul Skripsi</td><td>:</td><td style="font-style: italic; text-align: justify;">“{{ $p4->judul_skripsi }}“</td></tr>
    </table>

    <table class="score-table">
        <thead>
            <tr>
                <th width="40">No</th>
                <th>Nama Penguji</th>
                <th width="120">NIP</th>
                <th width="100">Nilai Angka</th>
            </tr>
        </thead>
        <tbody>
            @foreach($pengujis as $index => $penguji)
            <tr>
                <td>{{ $index + 1 }}</td>
                <td class="left">{{ $penguji->nama }}</td>
                <td>{{ $penguji->nip }}</td>
                <td>{{ $penguji->penilaian ? number_format($penguji->penilaian->nilai_total, 2) : 'Belum Dinilai' }}</td>
            </tr>
            @endforeach
            <tr>
                <th colspan="3" style="text-align: right;">Total Nilai Gabungan</th>
                <th>{{ number_format($total_nilai, 2) }}</th>
            </tr>
            <tr>
                <th colspan="3" style="text-align: right;">RATA-RATA NILAI AKHIR = Total Gabungan / {{ $jumlah_penguji }}</th>
                <th>{{ number_format($rata_rata, 2) }}</th>
            </tr>
            <tr>
                <th colspan="3" style="text-align: right;">NILAI HURUF (KUALIFIKASI)</th>
                <th>{{ $huruf }}</th>
            </tr>
        </tbody>
    </table>

    <div class="footer">
        <div class="signature">
            <p>Jayapura, {{ \Carbon\Carbon::now()->translatedFormat('d F Y') }}</p>
            <p>Ketua Panitia Ujian Skripsi / Dekan,</p>
            <p style="margin-bottom: 70px;"></p>
            <p><strong>Dr. Marthiunus Mambaya, S.H., M.Hum.</strong><br>
            NIP. 19600713 903 1 002</p>
        </div>
    </div>
</body>
</html>
