/* ==========================================
   PDF Layout for Admission Form
   Reference: SHIHAB THANGAL ISLAMIC ACADEMY
   ========================================== */

/* Import MLU-Revathi Unicode Font for Malayalam */
@font-face {
    font-family: 'MLU-Revathi';
    src: url('https://raw.githubusercontent.com/google/fonts/main/ofl/mlurevathi/MLURevathi-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

#pdfTemplate {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #121212;
    background: #ffffff;
    width: 210mm;
    max-width: 210mm;
    box-sizing: border-box;
}

#pdfContent {
    width: 210mm;
    max-width: 210mm;
    margin: 0 auto;
    box-sizing: border-box;
}

.pdf-page {
    width: 210mm;
    max-width: 210mm;
    padding: 10mm 16mm;
    background: #ffffff;
    box-sizing: border-box;
    position: relative;
}

.pdf-page-1 {
    /* Page 1 - Student Details */
}

.pdf-page-2 {
    /* Page 2 - Declarations */
}

.pdf-page-break {
    display: none;
}

.pdf-declarations {
    width: 100%;
}

.pdf-declaration-section {
    width: 100%;
}

.pdf-declaration-content-malayalam {
    font-size: 12.5pt;
    line-height: 1.8;
    text-align: justify;
    color: #121212;
    font-family: 'MLU-Revathi', 'Malayalam Sangam MN', 'Rachana', 'Meera', 'Arial Unicode MS', sans-serif;
}

.pdf-declaration-content-malayalam p {
    margin: 0 0 5mm 0;
}

.pdf-signature-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6mm;
    margin-top: 8mm;
}

/* New signature row for Guardian and Student */
.pdf-signature-row-new {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 8mm;
}

.pdf-signature-cell-new {
    text-align: center;
}

.pdf-signature-cell-new .pdf-signature-label {
    font-size: 10.5pt;
    font-weight: 700;
    color: #0f2f72;
    text-align: center;
    margin-bottom: 4px;
    font-family: 'MLU-Revathi', 'Malayalam Sangam MN', 'Rachana', 'Meera', 'Arial Unicode MS', sans-serif;
}

.pdf-signature-line {
    font-size: 11pt;
    color: #000;
    margin: 0;
    font-family: monospace;
    letter-spacing: 1px;
}

.pdf-signature-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pdf-signature-label {
    margin: 4px 0 0 0;
    font-size: 10.5pt;
    font-weight: 700;
    color: #0f2f72;
    text-align: center;
    font-family: 'MLU-Revathi', 'Malayalam Sangam MN', 'Rachana', 'Meera', 'Arial Unicode MS', sans-serif;
}

.pdf-page-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 4mm;
}

.pdf-logo-wrapper {
    width: 26mm;
    height: 26mm;
    margin: 0 auto 2mm auto;
}

.pdf-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pdf-title-block h1 {
    margin: 0;
    font-size: 22pt;
    font-weight: 700;
    letter-spacing: 0.4px;
}

.pdf-location {
    margin: 2mm 0 0 0;
    font-size: 10.5pt;
    font-weight: 500;
    letter-spacing: 0.4px;
    color: #1f1f1f;
}

.pdf-badge-bar {
    margin: 3mm 0 4mm 0;
    width: 100%;
    background: #0f2f72;
    color: #ffffff;
    text-align: center;
    font-size: 10.5pt;
    font-weight: 700;
    letter-spacing: 0.8px;
    padding: 5px 0;
}

.pdf-ref-section {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4mm;
    font-size: 9pt;
    color: #4a4a4a;
}

.pdf-ref-item {
    font-weight: 600;
}

.pdf-section {
    margin-bottom: 6mm;
}

.pdf-section-title,
.pdf-declaration-title {
    margin: 0 0 3mm 0;
    font-size: 15pt;
    font-weight: 700;
    color: #0f2f72;
    font-family: 'MLU-Revathi', 'Malayalam Sangam MN', 'Rachana', 'Meera', 'Arial Unicode MS', sans-serif;
}

.pdf-details-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 6mm;
    align-items: start;
}

.pdf-details-column {
    display: grid;
    gap: 4mm;
}

.pdf-field-row {
    display: flex;
    align-items: center;
    gap: 6mm;
    flex-wrap: wrap;
}

.pdf-row-split {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 6mm;
    align-items: center;
}

.pdf-field-label {
    flex: 0 0 40%;
    font-size: 10pt;
    font-weight: 700;
    color: #0f2f72;
    min-width: 28mm;
}

.pdf-field-value {
    flex: 1;
    min-width: 50mm;
    font-size: 10pt;
    font-weight: 600;
    letter-spacing: 0.2px;
    border-bottom: 1px solid #0f2f72;
    padding-bottom: 1mm;
    line-height: 1.4;
    display: inline-block;
}

.pdf-photo-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.pdf-photo-frame {
    width: 46mm;
    height: 60mm;
    border: 1.5px solid #0f2f72;
    background: #f5f8ff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pdf-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pdf-photo-caption {
    margin: 4px 0 0 0;
    font-size: 9pt;
    color: #4a4a4a;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.pdf-malayalam-text {
    font-size: 11pt;
    line-height: 1.75;
    text-align: justify;
    color: #121212;
    font-family: 'Malayalam Sangam MN', 'Rachana', 'Meera', 'Arial Unicode MS', sans-serif;
}

.pdf-malayalam-text p {
    margin: 0 0 5mm 0;
}

.pdf-blank-line {
    display: inline-block;
    min-width: 90mm;
    border-bottom: 1px solid #0f2f72;
    padding-bottom: 0.8mm;
}

.pdf-signature-grid {
    display: grid;
    gap: 8mm;
    margin-top: 10mm;
}

.pdf-signature-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.pdf-signature-two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pdf-sig-line {
    width: 100%;
    border-bottom: 1px solid #0f2f72;
    min-height: 14mm;
}

.pdf-sig-label {
    margin: 4px 0 0 0;
    font-size: 9pt;
    font-weight: 700;
    color: #0f2f72;
    text-align: left;
}

.pdf-attestation-line {
    margin-bottom: 6mm;
    font-size: 10pt;
    line-height: 1.5;
}

.pdf-official-note {
    margin-top: 10mm;
    font-size: 10.5pt;
    line-height: 1.6;
    color: #444;
    text-align: center;
    font-family: 'MLU-Revathi', 'Malayalam Sangam MN', 'Rachana', 'Meera', 'Arial Unicode MS', sans-serif;
}

.pdf-footer {
    margin-top: 8mm;
    font-size: 8.5pt;
    color: #8f8f8f;
    text-align: center;
    border-top: 1px solid #e4e4e4;
    padding-top: 3mm;
}

@media print {
    * {
        background: transparent !important;
        box-shadow: none !important;
    }

    body,
    html {
        margin: 0;
        padding: 0;
        background: #ffffff;
    }

    #pdfTemplate {
        display: block !important;
    }

    .pdf-page {
        width: 210mm;
        max-width: 210mm;
        padding: 10mm 16mm;
        border: none;
        margin: 0;
        background: #ffffff;
    }
}
