/* =========================================================
   Ibnerizam Shipping Lines — Print Stylesheet (A4 Ticket)
   ========================================================= */

@media print {
    /* Hide everything except the ticket */
    #main-header,
    #main-footer,
    .verify-banner,
    .booking-nav,
    .no-print,
    .btn,
    .modal,
    nav {
        display: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        font-family: Arial, Helvetica, sans-serif;
        font-size: 10pt;
        padding: 0 !important;
        margin: 0 !important;
    }

    .print-ticket {
        width: 210mm;
        min-height: auto;
        margin: 0 auto;
        padding: 10mm;
        background: #fff !important;
        border: none !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }

    /* Ticket header */
    .ticket-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 3px solid #3B0764;
        padding-bottom: 8mm;
        margin-bottom: 6mm;
    }

    .ticket-company-name {
        font-size: 16pt;
        font-weight: 800;
        color: #3B0764;
        letter-spacing: 0.5px;
    }

    .ticket-company-sub {
        font-size: 8pt;
        color: #666;
        margin-top: 2px;
    }

    .ticket-ref {
        text-align: right;
        font-size: 9pt;
        color: #555;
    }

    .ticket-ref strong { font-size: 11pt; color: #3B0764; display: block; }

    /* Route info */
    .ticket-route {
        background: #f4f0fb;
        border: 1px solid #3B0764;
        border-radius: 4px;
        padding: 5mm 6mm;
        margin-bottom: 5mm;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .ticket-route .route-port {
        font-size: 13pt;
        font-weight: 800;
        color: #3B0764;
    }

    .ticket-route .route-label {
        font-size: 7pt;
        color: #666;
        display: block;
    }

    .ticket-route .route-arrow {
        font-size: 16pt;
        color: #7C3AED;
    }

    /* Passenger table */
    .ticket-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 5mm;
    }

    .ticket-table th {
        background: #3B0764;
        color: #fff;
        padding: 3mm 4mm;
        font-size: 8pt;
        text-align: left;
        font-weight: 600;
    }

    .ticket-table td {
        border-bottom: 1px solid #e0d7f0;
        padding: 2.5mm 4mm;
        font-size: 9pt;
        color: #222;
        vertical-align: top;
    }

    .ticket-table tr:last-child td { border-bottom: none; }
    .ticket-table tr:nth-child(even) td { background: #faf8fe; }

    /* Price breakdown */
    .ticket-fees {
        border: 1px solid #ddd;
        border-radius: 4px;
        padding: 4mm 5mm;
        margin-bottom: 5mm;
    }

    .ticket-fees-title {
        font-size: 9pt;
        font-weight: 700;
        color: #3B0764;
        margin-bottom: 2mm;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .ticket-fee-row {
        display: flex;
        justify-content: space-between;
        font-size: 9pt;
        color: #444;
        padding: 1mm 0;
        border-bottom: 1px solid #f0e8fb;
    }

    .ticket-fee-row:last-child {
        border-bottom: none;
        font-weight: 800;
        font-size: 10.5pt;
        color: #3B0764;
        padding-top: 2mm;
    }

    /* QR and barcode row */
    .ticket-codes {
        display: flex;
        gap: 6mm;
        align-items: center;
        justify-content: flex-end;
        margin-top: 4mm;
    }

    .ticket-qr img { width: 25mm; height: 25mm; }
    .ticket-barcode img { height: 15mm; max-width: 50mm; }

    /* Footer note */
    .ticket-footer-note {
        text-align: center;
        font-size: 7pt;
        color: #888;
        border-top: 1px dashed #ccc;
        padding-top: 3mm;
        margin-top: 4mm;
    }

    /* Force A4 page */
    @page {
        size: A4 portrait;
        margin: 10mm;
    }
}

/* Screen preview of ticket (for before print) */
.ticket-preview-wrapper {
    background: #1A1030;
    border: 1px solid rgba(124, 58, 237, 0.25);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.ticket-preview-inner {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1.5rem;
    color: #222;
    font-family: Arial, Helvetica, sans-serif;
}
