<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-10">
            <div class="hero-section">
                <!-- Header -->
                <div class="text-center mb-5">
                    <h2 class="fw-bold" style="color: var(--primary-color);">
                        <i class="bi bi-trophy me-2"></i>HASIL TES KEMAMPUAN AKADEMIK
                    </h2>
                    <p class="text-muted">Data valid per <?php echo date('d F Y'); ?></p>
                </div>

                <!-- Student Information -->
                <div class="card result-card mb-4">
                    <div class="card-header bg-primary text-white">
                        <h5 class="mb-0"><i class="bi bi-person-circle me-2"></i>Informasi Peserta</h5>
                    </div>
                    <div class="card-body">
                        <div class="row">
                            <div class="col-md-6">
                                <table class="table table-borderless">
                                    <tr>
                                        <th width="40%">NISN</th>
                                        <td>: <?php echo $result->NISN; ?></td>
                                    </tr>
                                    <tr>
                                        <th>No. Peserta</th>
                                        <td>: <?php echo $result->NO_PESERTA; ?></td>
                                    </tr>
                                    <tr>
                                        <th>Nama Peserta</th>
                                        <td>: <strong><?php echo $result->NAMA_PESERTA; ?></strong></td>
                                    </tr>
                                    <tr>
                                        <th>Tempat/Tgl Lahir</th>
                                        <td>: <?php echo $result->TEMPAT_TGL_LAHIR; ?></td>
                                    </tr>
                                </table>
                            </div>
                            <div class="col-md-6">
                                <div class="text-center">
                                    <!-- <div class="p-3 rounded"
                                        style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white;">
                                        <h6 class="mb-2">Download Hasil TKA</h6>
                                        <a href="<?php echo base_url('uploads/' . $result->LAMPIRAN); ?>"
                                            target="_blank">
                                            <h4 class=" fw-bold">DOWNLOAD</h4>
                                        </a>
                                    </div> -->
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Test Results -->
                <div class="card result-card mb-4">
                    <div class="card-header bg-success text-white">
                        <h5 class="mb-0"><i class="bi bi-clipboard-data me-2"></i>Hasil Tes</h5>
                    </div>
                    <div class="card-body">
                        <div class="table-responsive">
                            <table class="table table-hover">
                                <thead class="table-light">
                                    <tr>
                                        <th>Mata Pelajaran</th>
                                        <th class="text-center">Nilai</th>
                                        <th class="text-center">Keterangan</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr>
                                        <td>Bahasa Indonesia</td>
                                        <td class="text-center">
                                            <span class="badge bg-primary score-badge">
                                                <?php echo $result->BHS_INDONESIA; ?>
                                            </span>
                                        </td>
                                        <td class="text-center">-</td>
                                    </tr>
                                    <tr>
                                        <td>Matematika</td>
                                        <td class="text-center">
                                            <span class="badge bg-primary score-badge">
                                                <?php echo $result->MATEMATIKA; ?>
                                            </span>
                                        </td>
                                        <td class="text-center">-</td>
                                    </tr>
                                    <tr>
                                        <td>Bahasa Inggris</td>
                                        <td class="text-center">
                                            <span class="badge bg-primary score-badge">
                                                <?php echo $result->BHS_INGGRIS; ?>
                                            </span>
                                        </td>
                                        <td class="text-center">-</td>
                                    </tr>
                                    <?php if (!empty($result->NAMA_MATPEL_PIL_1)): ?>
                                        <tr>
                                            <td><?php echo $result->NAMA_MATPEL_PIL_1; ?></td>
                                            <td class="text-center">
                                                <span class="badge bg-warning score-badge">
                                                    <?php echo $result->NILAI_MATPEL_PIL_1; ?>
                                                </span>
                                            </td>
                                            <td class="text-center">Pilihan 1</td>
                                        </tr>
                                    <?php endif; ?>
                                    <?php if (!empty($result->NAMA_MATPEL_PIL_2)): ?>
                                        <tr>
                                            <td><?php echo $result->NAMA_MATPEL_PIL_2; ?></td>
                                            <td class="text-center">
                                                <span class="badge bg-warning score-badge">
                                                    <?php echo $result->NILAI_MATPEL_PIL_2; ?>
                                                </span>
                                            </td>
                                            <td class="text-center">Pilihan 2</td>
                                        </tr>
                                    <?php endif; ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>

                <!-- Action Buttons -->
                <div class="row mb-4">
                    <div class="col-md-6 mb-2">
                        <a href="<?php echo site_url(); ?>" class="btn btn-outline-primary w-100">
                            <i class="bi bi-arrow-left me-2"></i>Kembali ke Pencarian
                        </a>
                    </div>
                    <div class="col-md-6 mb-2">

                        <!-- <a href="<?php echo base_url('uploads/' . $result->LAMPIRAN); ?>" target="_blank">
                            <button class="btn btn-success w-100 mt-2">
                                <i class="bi bi-download me-2"></i>Download Lampiran</button>
                        </a> -->
                    </div>
                </div>

                <!-- Note -->
                <div class="alert alert-info">
                    <h6><i class="bi bi-exclamation-circle me-2"></i>Catatan Penting:</h6>
                    <ul class="mb-0">
                        <li>Hasil ini adalah hasil resmi dan telah divalidasi oleh sistem</li>
                        <li>Simpan hasil ini sebagai bukti telah mengikuti TKA</li>
                        <li>Hasil dapat diakses kembali dengan menggunakan token yang sama</li>
                        <li>Token akan expired setelah 24 jam dari waktu generate</li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>