/* Print & Proxy Stylesheet (A4 63x88mm Cards with Precision Crop Marks) */
@page {
    size: A4 portrait;
    margin: 8mm 6mm;
}

@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-family: Arial, sans-serif !important;
        margin: 0 !important;
        padding: 0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Hide non-printable app UI elements */
    header, nav, footer, .app-header, .drawer-container, .modal, .toast, 
    .btn, .no-print, #chat-sidebar, .tabs-bar, .deck-controls-top {
        display: none !important;
    }

    #app-container {
        display: none !important;
    }

    #print-container {
        display: block !important;
        width: 100% !important;
    }

    /* 3x3 Grid on A4 page */
    .proxy-page {
        display: grid !important;
        grid-template-columns: repeat(3, 63mm) !important;
        grid-template-rows: repeat(3, 88mm) !important;
        gap: 2mm !important;
        justify-content: center !important;
        align-content: center !important;
        page-break-after: always !important;
        break-after: page !important;
        height: 275mm !important;
        box-sizing: border-box !important;
        padding: 2mm !important;
    }

    .proxy-card {
        width: 63mm !important;
        height: 88mm !important;
        box-sizing: border-box !important;
        position: relative !important;
        border: 0.15mm solid #bbb !important;
        border-radius: 2.5mm !important;
        overflow: hidden !important;
        background: #fff !important;
        page-break-inside: avoid !important;
    }

    .proxy-card img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
    }

    /* Precision Crop Marks */
    .proxy-card::before, .proxy-card::after {
        content: '' !important;
        position: absolute !important;
        pointer-events: none !important;
    }

    /* Corner marks */
    .crop-mark {
        position: absolute;
        width: 4mm;
        height: 4mm;
        border-color: #000000;
        border-style: solid;
        pointer-events: none;
    }

    .crop-tl { top: -1px; left: -1px; border-width: 0.4mm 0 0 0.4mm; }
    .crop-tr { top: -1px; right: -1px; border-width: 0.4mm 0.4mm 0 0; }
    .crop-bl { bottom: -1px; left: -1px; border-width: 0 0 0.4mm 0.4mm; }
    .crop-br { bottom: -1px; right: -1px; border-width: 0 0.4mm 0.4mm 0; }

    /* Decklist Table Mode */
    .decklist-page {
        padding: 10mm 15mm;
        font-size: 11pt;
    }

    .decklist-title {
        font-size: 18pt;
        font-weight: bold;
        border-bottom: 2px solid #333;
        padding-bottom: 4mm;
        margin-bottom: 6mm;
    }

    .decklist-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 8mm;
    }

    .decklist-table th, .decklist-table td {
        border-bottom: 1px solid #ddd;
        padding: 6px 8px;
        text-align: left;
    }

    .decklist-table th {
        background: #f4f4f4;
        font-weight: bold;
    }
}

#print-container {
    display: none;
}
