/* ===============================
   PRINT SETTINGS
================================= */

@media print {
    @page {
        size: F4 portrait;
        margin: 0.4cm;
    }

    body * {
        visibility: hidden;
    }

    #print-area, #print-area * {
        visibility: visible;
    }

    #print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0.4cm;
    }

    .no-print {
        display: none !important;
    }

    .card {
        page-break-inside: avoid;
        break-inside: avoid;
    }
}

/* ===============================
   GRID – 2 kolom × 6 baris
   Pas untuk F4
================================= */

#print-area {
    display: grid;
    grid-template-columns: repeat(2, 9.5cm);
    column-gap: 0.5cm;    /* ideal gap */
    row-gap: 0.25cm;      /* ideal untuk 6 baris */
    justify-content: center;
    padding: 0.4cm;
}

/* ===============================
   CARD
================================= */

.card {
    width: 9.5cm;
    height: 5cm;            /* fix height */
    border: 1px solid #000;
    padding: 0.2cm;
    box-sizing: border-box;
    position: relative;
    background-color: white;
    color: #000;
    overflow: hidden;
}

/* ===============================
   HEADER AREA
================================= */

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.05cm;
}

.logo-container {
    width: 1cm;
    height: 1cm;
    margin-right: 0.3cm;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-img {
    max-width: 100%;
    max-height: 100%;
}

.header-text-container {
    flex: 1;
    text-align: center;
}

/* ==== AUTO-SCALE HEADER LINES ==== */
.header-text-1, .header-text-2, .header-text-3 {
    font-weight: bold;
    margin: 0;
    padding: 0;
    line-height: 1.05;
    white-space: nowrap;         /* tidak boleh pindah baris */
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: clamp(6px, 2.2vw, 11px);   /* AUTO SCALE */
}

/* Garis pembatas */
.header-divider {
    border-bottom: 1px solid #000;
    margin: 0.05cm auto 0.05cm auto;
}

/* Title */
.card-title {
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 0.1cm;
}

/* ===============================
   CONTENT
================================= */

.card-content {
    font-size: 9.5pt;
    font-family: 'Arial Narrow', Arial, sans-serif;
    width: calc(100% - 1cm);   
    display: table;
    line-height: 1.15;
}

.card-content-row {
    display: table-row;
}

.card-label {
    display: table-cell;
    padding-right: 0.15cm;
    white-space: nowrap;
}

.card-colon {
    display: table-cell;
    width: 0.25cm;
    text-align: center;
}

.card-value {
    display: table-cell;
    padding-left: 0.1cm;
    white-space: nowrap;        /* TIDAK BOLEH PINDH BARIS */
    overflow: hidden;           /* JIKA SANGAT PANJANG, tetap 1 baris */
    text-overflow: ellipsis;    /* tampil ... jika kepanjangan */
    max-width: 100%;            /* penuh sampai border */
}

.bold-value {
    font-weight: bold;
}

/* ===============================
   QR CODE & FOOTER
================================= */

.qrcode {
    position: absolute;
    right: 0.25cm;
    bottom: 0.25cm;
    width: 1.7cm;
    height: 1.7cm;
}

.card-footer {
    position: absolute;
    bottom: 0.15cm;
    left: 0.2cm;
    font-size: 7px;
    font-style: italic;
    width: calc(100% - 2.3cm);
}

/* ===============================
   NON-PRINT VIEW
================================= */

body {
    background: linear-gradient(to top, #ffffff 0%, #ffffff 50%, #2e8b57 100%);
    min-height: 100vh;
}

.main-container {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.form-container {
    background-color: white;
    color: #333;
    border-radius: 0.5rem;
}

.page-title {
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.app-footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.875rem;
    color: #ffffff;
    border-top: 1px solid rgba(255,255,255,0.2);
    margin-top: 2rem;
}
