/* print.css - Styles specifically for printing physical ASBA IPO application forms */

@media print {
    /* Hide all web components */
    header, 
    .nav-container, 
    .print-actions, 
    .no-print,
    button,
    footer {
        display: none !important;
    }

    /* Reset body styles for paper */
    body {
        background: #fff !important;
        color: #000 !important;
        font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
        font-size: 10pt !important;
        line-height: 1.3 !important;
        margin: 0 !important;
        padding: 0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Outer container */
    .print-container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0.5in !important;
        box-shadow: none !important;
        border: none !important;
        background: transparent !important;
    }

    /* Grid/Layout adjustments */
    .asba-form {
        border: 2px solid #000;
        padding: 10px;
        background: #fff;
    }

    .asba-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 2px solid #000;
        padding-bottom: 10px;
        margin-bottom: 10px;
    }

    .asba-title {
        font-size: 14pt;
        font-weight: bold;
        text-transform: uppercase;
        text-align: center;
        flex-grow: 1;
    }

    .asba-meta-box {
        border: 1px solid #000;
        padding: 5px;
        font-size: 8pt;
        min-width: 150px;
    }

    .asba-meta-box.app-no {
        background: #f3f4f6 !important;
        font-size: 11pt;
        font-weight: bold;
        text-align: center;
        border: 2px solid #000;
    }

    .asba-section {
        margin-bottom: 12px;
        border: 1px solid #000;
    }

    .asba-section-title {
        background: #e5e7eb !important;
        padding: 4px 8px;
        font-size: 9pt;
        font-weight: bold;
        text-transform: uppercase;
        border-bottom: 1px solid #000;
        -webkit-print-color-adjust: exact;
    }

    .asba-section-content {
        padding: 8px;
    }

    /* Table styles for print */
    table.print-table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 5px;
    }

    table.print-table th, table.print-table td {
        border: 1px solid #000;
        padding: 6px;
        text-align: left;
        font-size: 9pt;
    }

    table.print-table th {
        background: #f3f4f6 !important;
        font-weight: bold;
        -webkit-print-color-adjust: exact;
    }

    /* Grid for details */
    .print-grid-2 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .print-grid-3 {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 10px;
    }

    .print-field {
        margin-bottom: 6px;
    }

    .print-label {
        font-size: 8pt;
        text-transform: uppercase;
        color: #374151;
        font-weight: bold;
    }

    .print-value {
        font-size: 10pt;
        font-family: monospace;
        border-bottom: 1px dotted #000;
        padding-bottom: 2px;
    }

    /* Barcode simulation */
    .barcode-box {
        font-family: 'Libre Barcode 39', monospace;
        font-size: 28pt;
        text-align: center;
        margin: 5px 0;
    }

    /* Signature area */
    .signature-container {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        margin-top: 15px;
        text-align: center;
    }

    .signature-box {
        border: 1px solid #000;
        height: 80px;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        padding-bottom: 5px;
        font-size: 7.5pt;
    }

    /* Tear-off slip at the bottom */
    .tear-off-line {
        border-top: 1.5px dashed #000;
        margin: 25px 0 15px 0;
        text-align: center;
        font-size: 8pt;
        font-style: italic;
        position: relative;
    }

    .tear-off-line::after {
        content: " ✂ --- TEAR HERE (ACKNOWLEDGEMENT SLIP TO APPLICANT) --- ✂ ";
        background: #fff;
        padding: 0 10px;
        position: absolute;
        top: -10px;
        left: 50%;
        transform: translateX(-50%);
    }

    .acknowledgement-slip {
        border: 2px solid #000;
        padding: 10px;
        background: #fff;
    }

    /* General print adjustments */
    @page {
        size: A4;
        margin: 0.4in;
    }
}

/* Fallback/Screen layout for print preview */
@media screen {
    .print-container {
        max-width: 800px;
        margin: 2rem auto;
        background: #ffffff;
        color: #1f2937;
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        border-radius: 12px;
        padding: 2.5rem;
        border: 1px solid #e5e7eb;
    }

    .asba-form, .acknowledgement-slip {
        border: 1.5px solid #374151;
        padding: 1.5rem;
        border-radius: 6px;
        background: #fafafa;
        margin-bottom: 2rem;
    }

    .asba-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 2px solid #374151;
        padding-bottom: 1rem;
        margin-bottom: 1.5rem;
    }

    .asba-title {
        font-size: 1.25rem;
        font-weight: 700;
        text-transform: uppercase;
        color: #111827;
    }

    .asba-meta-box {
        border: 1px solid #d1d5db;
        padding: 0.5rem;
        font-size: 0.8rem;
        border-radius: 4px;
        background: #f9fafb;
    }

    .asba-meta-box.app-no {
        font-size: 1.1rem;
        font-weight: 700;
        border: 2px solid #111827;
        background: #f3f4f6;
    }

    .asba-section {
        margin-bottom: 1.5rem;
        border: 1px solid #d1d5db;
        border-radius: 6px;
        overflow: hidden;
    }

    .asba-section-title {
        background: #f3f4f6;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        font-weight: 700;
        text-transform: uppercase;
        border-bottom: 1px solid #d1d5db;
        color: #374151;
    }

    .asba-section-content {
        padding: 1rem;
    }

    table.print-table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 0.5rem;
    }

    table.print-table th, table.print-table td {
        border: 1px solid #d1d5db;
        padding: 0.75rem;
        text-align: left;
    }

    table.print-table th {
        background: #f9fafb;
        font-weight: 600;
        color: #374151;
    }

    .print-grid-2 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .print-grid-3 {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 1rem;
    }

    .print-field {
        margin-bottom: 0.75rem;
    }

    .print-label {
        font-size: 0.75rem;
        text-transform: uppercase;
        color: #6b7280;
        font-weight: 600;
        margin-bottom: 0.25rem;
    }

    .print-value {
        font-size: 0.95rem;
        font-family: monospace;
        color: #111827;
        border-bottom: 1px dashed #d1d5db;
        padding-bottom: 0.2rem;
    }

    .barcode-box {
        font-family: monospace;
        font-size: 1rem;
        text-align: center;
        margin: 0.5rem 0;
        letter-spacing: 0.25rem;
        background: #f3f4f6;
        padding: 0.5rem;
        border-radius: 4px;
        border: 1px dashed #9ca3af;
    }

    .signature-container {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
        margin-top: 1.5rem;
        text-align: center;
    }

    .signature-box {
        border: 1px solid #d1d5db;
        border-radius: 6px;
        height: 90px;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        padding-bottom: 0.5rem;
        font-size: 0.75rem;
        color: #6b7280;
        background: #f9fafb;
    }

    .tear-off-line {
        border-top: 2px dashed #9ca3af;
        margin: 2.5rem 0 1.5rem 0;
        text-align: center;
        font-size: 0.8rem;
        font-style: italic;
        position: relative;
    }

    .tear-off-line::after {
        content: " ✂ --- TEAR HERE (ACKNOWLEDGEMENT SLIP) --- ✂ ";
        background: #ffffff;
        padding: 0 1rem;
        position: absolute;
        top: -10px;
        left: 50%;
        transform: translateX(-50%);
        color: #4b5563;
    }
}

@media screen and (max-width: 768px) {
    .print-container {
        padding: 1rem 0.5rem !important;
        margin: 1rem auto !important;
        border-radius: 8px !important;
    }
    .asba-form, .acknowledgement-slip {
        padding: 0.75rem !important;
    }
    .print-grid-2, .print-grid-3, .signature-container {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    .signature-box {
        height: 70px !important;
    }
    .asba-header {
        flex-direction: column !important;
        gap: 1rem !important;
        align-items: stretch !important;
        text-align: center !important;
    }
}
