/* ========================================
   MARKAZUT TARBIYAH AL ISLAMIYAH
   Main Website Stylesheet
======================================== */

/* Bengali Fonts */

/* SolaimanLipi Regular */
@font-face {
    font-family: 'SolaimanLipi';
    src: url('/assets/SolaimanLipi.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* SolaimanLipi Bold */
@font-face {
    font-family: 'SolaimanLipi';
    src: url('/assets/SolaimanLipi-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}


/* Theme Colors */
:root {
    --green: #07512e;
    --dark: #003d24;
    --gold: #d4ad43;
    --cream: #fffcf2;
    --border: #c3d3c6;
}

/* General */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f4f5ef;
    color: #183626;
    font: 16px/1.65 'SolaimanLipi', 'Nirmala UI', sans-serif;
}

h1, h2, h3, p {
    margin: 0 0 12px;
}

h1 {
    font-size: clamp(20px, 2.5vw, 34px);
    line-height: 1.4;
    color: var(--dark);
}

h2 {
    font-size: 25px;
}

h3 {
    font-size: 18px;
    background: linear-gradient(100deg, var(--dark), #087138);
    color: white;
    margin: -20px -20px 18px;
    padding: 9px 20px;
    border-bottom: 2px solid var(--gold);
    border-radius: 10px 10px 0 0;
}

/* Website Header */
.brand {
    display: grid;
    grid-template-columns: 120px 1fr 240px;
    gap: 20px;
    align-items: center;
    background: var(--cream);
    border-block: 5px solid var(--gold);
    padding: 20px 4%;
    text-align: center;
}

.brand img {
    width: 110px;
    height: 110px;
    object-fit: contain;
}

.arabic {
    font: 30px/1.6 serif;
    color: var(--dark);
}

address {
    font-style: normal;
    text-align: left;
    font-size: 14px;
    border-left: 1px solid var(--gold);
    padding-left: 16px;
}

/* Navigation */
nav {
    background: var(--dark);
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 10px 4%;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
}

nav form {
    margin-left: auto;
}

/* Main Content */
main {
    max-width: 1380px;
    margin: auto;
    padding: 28px;
}

/* Panels */
.panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    break-inside: avoid;
}

.columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 20px;
}

/* Student Information */
.student {
    display: grid;
    grid-template-columns: 1fr 190px;
    gap: 20px;
}

.photo-placeholder {
    width: 100px;
    height: 128px;
    background: #ecede8;
    margin: 20px auto;
    text-align: center;
    padding-top: 40px;
    border: 1px dashed #999;
}

.photo-upload input {
    max-width: 145px;
}

/* Form Elements */
label {
    display: block;
    font-size: 15px;
    margin: 0 0 12px;
}

input,
select,
textarea {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #a9b8ad;
    border-radius: 6px;
    background: #fff;
    font: inherit;
    line-height: 1.4;
    color: #153c27;
}

textarea {
    min-height: 65px;
    resize: vertical;
}

b {
    color: inherit;
}

label b,
.intro b {
    color: #a51c24;
}

/* Buttons */
button,
.button {
    background: var(--green);
    color: white;
    font: inherit;
    padding: 11px 20px;
    border: 1px solid var(--gold);
    border-radius: 7px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

button:hover,
.button:hover {
    background: #08713b;
}

button:focus-visible,
a:focus-visible,
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid #d7b33b;
    outline-offset: 2px;
}

.danger {
    background: #a82323;
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin: 16px 0;
}

/* Notifications */
.info,
.success,
.error {
    padding: 14px 18px;
    border-radius: 8px;
    background: #e6f1f7;
    margin: 14px 0;
}

.success {
    background: #ddf2df;
}

.error {
    background: #ffe7e7;
    color: #891919;
}

/* Small Panel */
.small {
    max-width: 540px;
    margin: 30px auto;
}

.check {
    display: flex;
    gap: 10px;
    align-items: center;
}

.check input {
    width: auto;
}

/* Admission Form */
.form-title {
    text-align: center;
    background: var(--green);
    color: #fff;
    border: 2px solid var(--gold);
    border-radius: 30px;
    max-width: 420px;
    margin: 0 auto 20px;
    padding: 8px 20px;
}

.intro {
    text-align: center;
    margin-bottom: 25px;
}

.meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.paper {
    max-width: 1000px;
    margin: auto;
}

/* Student Photo */
.portrait {
    height: 175px;
    border: 1px solid var(--green);
    border-radius: 6px;
    text-align: center;
    padding: 10px;
    margin-top: 15px;
}

.portrait img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Student Details */
.details p {
    margin: 4px 0;
    border-bottom: 1px dotted #b3bcb3;
}

.two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 25px;
}

/* Signatures */
.signatures {
    display: flex;
    justify-content: space-around;
    padding-top: 40px;
}

.signatures span,
.signature {
    border-top: 1px dotted #536a53;
    padding-top: 5px;
}

.signature {
    max-width: 270px;
    margin: 45px 0 0 auto;
}

.office {
    background: var(--cream);
}

/* Status Badge */
.badge {
    display: inline-block;
    border-radius: 20px;
    padding: 4px 14px;
    background: #e4f0df;
}

/* Admin Dashboard Statistics */
.stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.stats section {
    flex: 1;
    background: white;
    padding: 20px;
    border-radius: 10px;
    border-top: 4px solid var(--gold);
}

.stats strong {
    display: block;
    font-size: 24px;
}

/* Tables */
.scroll {
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    width: 100%;
    font-size: 14px;
}

th {
    background: var(--green);
    color: white;
}

td,
th {
    padding: 10px;
    border: 1px solid var(--border);
    text-align: left;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    border-top: 2px solid var(--gold);
}

/* Payment Receipt */
.receipt {
    max-width: 760px;
    margin: auto;
}

.receipt h2 {
    text-align: center;
}

/* ========================================
   MOBILE RESPONSIVE DESIGN
======================================== */
@media (max-width: 800px) {

    .brand {
        grid-template-columns: 70px 1fr;
        padding: 12px;
    }

    .brand img {
        width: 65px;
        height: 65px;
    }

    .brand address {
        grid-column: 1 / -1;
        text-align: center;
        border: 0;
    }

    .columns,
    .fields {
        grid-template-columns: 1fr;
    }

    .student {
        grid-template-columns: 1fr;
    }

    .photo-upload {
        grid-row: 1;
    }

    .stats {
        flex-direction: column;
    }

    main {
        padding: 16px;
    }

    .two {
        grid-template-columns: 1fr;
    }

    .portrait {
        max-width: 140px;
    }

    .arabic {
        font-size: 24px;
    }
}

/* ========================================
   A4 PRINT SETTINGS
======================================== */
@page {
    size: A4 portrait;
    margin: 9mm;
}

@media print {

    * {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .no-print {
        display: none !important;
    }

    body {
        background: white;
        font-size: 9pt;
        line-height: 1.4;
    }

    .brand {
        grid-template-columns: 22mm 1fr 46mm;
        padding: 3mm 0;
        gap: 3mm;
        border-width: 1mm;
    }

    .brand img {
        width: 22mm;
        height: 22mm;
    }

    .brand h1 {
        font-size: 17pt;
    }

    .brand .arabic {
        font-size: 17pt;
    }

    .brand strong {
        font-size: 10pt;
    }

    .brand address {
        font-size: 8pt;
        grid-column: auto;
        text-align: left;
        border-left: 1px solid var(--gold);
    }

    main {
        padding: 4mm 0;
        max-width: none;
    }

    .paper {
        max-width: none;
    }

    .form-title {
        font-size: 13pt;
        margin: 0 auto 3mm;
        padding: 1mm 5mm;
    }

    .panel {
        padding: 3mm;
        border-radius: 2mm;
        margin-bottom: 3mm;
    }

    h3 {
        font-size: 10pt;
        margin: -3mm -3mm 2mm;
        padding: 1.5mm 3mm;
        border-radius: 2mm 2mm 0 0;
    }

    p {
        margin-bottom: 2mm;
    }

    .student {
        grid-template-columns: 1fr 30mm;
        gap: 3mm;
    }

    .portrait {
        height: 39mm;
        margin-top: 0;
        padding: 2mm;
    }

    .details p {
        margin: 1mm 0;
    }

    .columns {
        grid-template-columns: 1fr 1fr;
        gap: 3mm;
    }

    .two {
        grid-template-columns: 1fr 1fr;
        gap: 1mm 4mm;
    }

    .meta {
        margin-bottom: 3mm;
    }

    .signatures {
        padding-top: 8mm;
    }

    .signature {
        margin-top: 8mm;
    }

    .receipt {
        margin: 15mm auto;
    }

    .office {
        margin-bottom: 0;
    }

    .actions {
        display: none;
    }

    .panel,
    .brand,
    .student {
        break-inside: avoid;
    }

    .paper p {
        overflow-wrap: anywhere;
    }
}

/* Apply SolaimanLipi to website */
html,
body,
button,
input,
select,
textarea,
label,
table,
th,
td {
    font-family: 'SolaimanLipi', 'Nirmala UI', sans-serif;
}

/* Bengali headings */
h1, h2, h3, h4, h5, h6 {
    font-family: 'SolaimanLipi', sans-serif;
    font-weight: 700;
}

/* Keep Arabic text separate */
.arabic,
[lang="ar"] {
    font-family: 'Traditional Arabic', serif;
}
