<!DOCTYPE html>
<html lang="id">
<head>
    <?php helper('logo'); ?>
    <link rel="icon" type="image/png" href="<?= getLogo('sekolah') ?>">
<meta charset="UTF-8">
<title>Cetak Tanda Bel Asesmen</title>
<style>
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background: #e2e8f0;
    padding: 20px;
}

/* Preview Header */
.preview-header {
    background: #1e293b;
    color: white;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 10px;
    z-index: 100;
}
.preview-header h2 {
    font-size: 1.1rem;
    margin: 0;
}
.preview-header p {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: 4px;
}
.btn-back {
    background: #475569;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-right: 8px;
}
.btn-print {
    background: #0ea5e9;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Page Setup: A4 Landscape */
@page {
    size: A4 landscape;
    margin: 0;
}

.a4-sheet-landscape {
    width: 297mm;
    height: 210mm;
    background: white;
    position: relative;
    margin: 0 auto;
    padding: 10mm 15mm;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
}

.double-border-box {
    border: 4px double #000;
    padding: 8mm 12mm;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Print Overrides */
@media print {
    body {
        background: white;
        padding: 0;
        margin: 0;
    }
    .preview-header {
        display: none !important;
    }
    .a4-sheet-landscape {
        margin: 0;
        box-shadow: none;
        page-break-after: avoid;
    }
    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
</style>
</head>
<body>

<div class="preview-header">
    <div>
        <h2>🔔 Cetak Ketentuan Tanda Bel</h2>
        <p>Tempelan Informasi Asesmen &nbsp;·&nbsp; Kertas A4 Landscape (Default Sign)</p>
    </div>
    <div>
        <button class="btn-back" onclick="window.history.back()">← Kembali</button>
        <button class="btn-print" onclick="window.print()">🖨 Cetak / Simpan PDF</button>
    </div>
</div>

<div class="a4-sheet-landscape">
    <div class="double-border-box">
        
        <!-- Kop Surat -->
        <?= view('letter/_kop', ['letterSettings' => $letterSettings, 'schoolSettings' => $schoolSettings]) ?>

        <!-- Title -->
        <div style="text-align: center; margin-bottom: 8mm; font-family: Arial, sans-serif; line-height: 1.2;">
            <h1 style="font-size: 26pt; font-weight: bold; letter-spacing: 1.5px; margin-bottom: 2mm;">TANDA BEL</h1>
            <h2 style="font-size: 18pt; font-weight: bold; text-transform: uppercase; margin-bottom: 1.5mm; color: #1e293b;">ASESMEN <?= strtoupper(esc($event['name'])) ?></h2>
            <h3 style="font-size: 14pt; font-weight: bold; text-transform: uppercase; color: #475569;">TAHUN AJARAN <?= strtoupper(esc($event['academic_year'] ?? '2025 / 2026')) ?></h3>
        </div>

        <!-- Bell Content -->
        <div class="bell-content" style="flex: 1; display: flex; flex-direction: column; justify-content: space-around; padding: 0 10mm; margin-bottom: 4mm; font-family: Arial, sans-serif;">
            
            <!-- Row 1 -->
            <div class="bell-row" style="display: flex; align-items: center; font-size: 22pt; font-weight: bold;">
                <div class="bell-icons" style="width: 75mm; display: flex; gap: 3.5mm; justify-content: flex-start; align-items: center; flex-shrink: 0;">
                    <?php for($i=0; $i<3; $i++): ?>
                        <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" fill="currentColor" viewBox="0 0 16 16" style="color: #000;">
                            <path d="M8 16a2 2 0 0 0 2-2H6a2 2 0 0 0 2 2m.995-14.901a1 1 0 1 0-1.99 0A5 5 0 0 0 3 6c0 1.098-.5 6-2 7h14c-1.5-1-2-5.902-2-7 0-2.42-1.72-4.44-4.005-4.901"/>
                        </svg>
                    <?php endfor; ?>
                </div>
                <div style="width: 15mm; text-align: center; flex-shrink: 0;">:</div>
                <div style="flex: 1; text-transform: uppercase; letter-spacing: 0.5px;">Masuk Ruangan</div>
            </div>

            <!-- Row 2 -->
            <div class="bell-row" style="display: flex; align-items: center; font-size: 22pt; font-weight: bold;">
                <div class="bell-icons" style="width: 75mm; display: flex; gap: 3.5mm; justify-content: flex-start; align-items: center; flex-shrink: 0;">
                    <?php for($i=0; $i<2; $i++): ?>
                        <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" fill="currentColor" viewBox="0 0 16 16" style="color: #000;">
                            <path d="M8 16a2 2 0 0 0 2-2H6a2 2 0 0 0 2 2m.995-14.901a1 1 0 1 0-1.99 0A5 5 0 0 0 3 6c0 1.098-.5 6-2 7h14c-1.5-1-2-5.902-2-7 0-2.42-1.72-4.44-4.005-4.901"/>
                        </svg>
                    <?php endfor; ?>
                </div>
                <div style="width: 15mm; text-align: center; flex-shrink: 0;">:</div>
                <div style="flex: 1; text-transform: uppercase; letter-spacing: 0.5px;">Mulai Mengerjakan</div>
            </div>

            <!-- Row 3 -->
            <div class="bell-row" style="display: flex; align-items: center; font-size: 22pt; font-weight: bold;">
                <div class="bell-icons" style="width: 75mm; display: flex; gap: 3.5mm; justify-content: flex-start; align-items: center; flex-shrink: 0;">
                    <?php for($i=0; $i<1; $i++): ?>
                        <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" fill="currentColor" viewBox="0 0 16 16" style="color: #000;">
                            <path d="M8 16a2 2 0 0 0 2-2H6a2 2 0 0 0 2 2m.995-14.901a1 1 0 1 0-1.99 0A5 5 0 0 0 3 6c0 1.098-.5 6-2 7h14c-1.5-1-2-5.902-2-7 0-2.42-1.72-4.44-4.005-4.901"/>
                        </svg>
                    <?php endfor; ?>
                </div>
                <div style="width: 15mm; text-align: center; flex-shrink: 0;">:</div>
                <div style="flex: 1; text-transform: uppercase; letter-spacing: 0.5px;">Peringatan Waktu Tersisa 15 menit</div>
            </div>

            <!-- Row 4 -->
            <div class="bell-row" style="display: flex; align-items: center; font-size: 22pt; font-weight: bold;">
                <div class="bell-icons" style="width: 75mm; display: flex; gap: 3.5mm; justify-content: flex-start; align-items: center; flex-shrink: 0;">
                    <?php for($i=0; $i<4; $i++): ?>
                        <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" fill="currentColor" viewBox="0 0 16 16" style="color: #000;">
                            <path d="M8 16a2 2 0 0 0 2-2H6a2 2 0 0 0 2 2m.995-14.901a1 1 0 1 0-1.99 0A5 5 0 0 0 3 6c0 1.098-.5 6-2 7h14c-1.5-1-2-5.902-2-7 0-2.42-1.72-4.44-4.005-4.901"/>
                        </svg>
                    <?php endfor; ?>
                </div>
                <div style="width: 15mm; text-align: center; flex-shrink: 0;">:</div>
                <div style="flex: 1; text-transform: uppercase; letter-spacing: 0.5px;">Waktu Ujian Telah Habis</div>
            </div>

        </div>

    </div>
</div>

</body>
</html>
