/* ========================================
   PRINT.CSS - Quote Preview A4 Styling
   ======================================== */

/* A4 Page Dimensions and Layout */
.quote-preview-a4 {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 12pt;
    line-height: 1.4;
    color: #333;
    position: relative;
}

/* Page Margins (A4 standard) */
.quote-preview-a4 {
    padding: 20mm;
    box-sizing: border-box;
}

/* Header Section */
.quote-header-a4 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15mm;
    border-radius: 8mm;
    margin-bottom: 15mm;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4mm 8mm rgba(0, 0, 0, 0.15);
}

.quote-logo-a4 img {
    max-height: 50mm;
    border-radius: 6mm;
    box-shadow: 0 2mm 4mm rgba(0, 0, 0, 0.2);
}

.quote-info-a4 h2 {
    margin: 0 0 8mm 0;
    font-size: 24pt;
    font-weight: 700;
    text-shadow: 0 2mm 4mm rgba(0, 0, 0, 0.3);
}

.quote-info-a4 p {
    margin: 3mm 0;
    font-size: 11pt;
    opacity: 0.95;
    font-weight: 300;
}

/* Content Sections */
.quote-section-a4 {
    background: white;
    border-radius: 8mm;
    padding: 15mm;
    margin-bottom: 15mm;
    box-shadow: 0 2mm 6mm rgba(0, 0, 0, 0.08);
    border-left: 3mm solid #667eea;
    position: relative;
}

.quote-section-a4 h3 {
    margin: 0 0 12mm 0;
    color: #667eea;
    font-size: 16pt;
    font-weight: 600;
    border-bottom: 1mm solid #f0f0f0;
    padding-bottom: 8mm;
    text-transform: uppercase;
    letter-spacing: 0.5pt;
}

/* Customer Details */
.customer-details-a4 p {
    margin: 6mm 0;
    font-size: 11pt;
    display: flex;
    align-items: center;
}

.customer-details-a4 strong {
    color: #555;
    min-width: 100mm;
    display: inline-block;
    font-weight: 600;
    margin-right: 8mm;
}

.customer-details-a4 span {
    color: #333;
    font-weight: 400;
}

/* Products Table */
.products-table-a4 {
    margin-top: 12mm;
    overflow: hidden;
}

.products-table-a4 table {
    width: 100%;
    border-collapse: collapse;
    border: 1mm solid #e1e5e9;
    border-radius: 4mm;
    overflow: hidden;
}

.products-table-a4 th {
    background: #f8f9fa;
    padding: 8mm 6mm;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 1mm solid #e1e5e9;
    font-size: 10pt;
    text-transform: uppercase;
    letter-spacing: 0.3pt;
}

.products-table-a4 td {
    padding: 8mm 6mm;
    border-bottom: 0.5mm solid #eee;
    font-size: 10pt;
    vertical-align: top;
}

.products-table-a4 tr:last-child td {
    border-bottom: none;
}

.products-table-a4 tr:nth-child(even) {
    background: #fafbfc;
}

/* Product Columns */
.product-name-a4 {
    font-weight: 600;
    color: #333;
    min-width: 80mm;
}

.product-description-a4 {
    color: #666;
    font-style: italic;
    max-width: 120mm;
}

.product-qty-a4 {
    text-align: center;
    font-weight: 600;
    color: #667eea;
    min-width: 25mm;
}

.product-price-a4 {
    text-align: right;
    font-weight: 600;
    color: #28a745;
    min-width: 35mm;
}

.product-total-a4 {
    text-align: right;
    font-weight: 700;
    color: #dc3545;
    min-width: 35mm;
}

/* Total Section */
.total-section-a4 {
    text-align: right;
    padding: 15mm 0;
    border-top: 2mm solid #e1e5e9;
    margin-top: 15mm;
}

.total-row-a4 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 6mm 0;
    font-size: 11pt;
}

.total-label-a4 {
    color: #555;
    font-weight: 500;
    margin-right: 15mm;
}

.total-value-a4 {
    font-weight: 600;
    color: #333;
    min-width: 40mm;
    text-align: right;
}

.total-amount-a4 {
    font-size: 18pt;
    font-weight: 700;
    color: #667eea;
    border-top: 1mm solid #e1e5e9;
    padding-top: 8mm;
    margin-top: 8mm;
}

.total-amount-a4 .total-label-a4 {
    font-size: 14pt;
    color: #555;
}

.total-amount-a4 .total-value-a4 {
    font-size: 20pt;
    color: #28a745;
}

/* Notes Section */
.notes-section-a4 {
    margin-top: 15mm;
    padding-top: 15mm;
    border-top: 1mm solid #eee;
}

.notes-section-a4 p {
    background: #f8f9fa;
    padding: 12mm;
    border-radius: 6mm;
    border-left: 3mm solid #17a2b8;
    font-style: italic;
    color: #666;
    font-size: 10pt;
    line-height: 1.5;
}

/* Footer */
.quote-footer-a4 {
    text-align: center;
    padding: 15mm;
    background: #f8f9fa;
    border-radius: 8mm;
    margin-top: 15mm;
    border: 1mm solid #e1e5e9;
}

.quote-footer-a4 p {
    margin: 4mm 0;
    font-size: 9pt;
    color: #666;
    font-style: italic;
}

/* Currency Formatting */
.currency-crc-a4::before {
    content: "₡";
    margin-right: 2mm;
    font-weight: 600;
}

.currency-usd-a4::before {
    content: "$";
    margin-right: 2mm;
    font-weight: 600;
}

/* Status Badges */
.status-draft-a4 {
    background: #ffc107;
    color: #212529;
    padding: 3mm 8mm;
    border-radius: 4mm;
    font-size: 9pt;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5pt;
}

.status-approved-a4 {
    background: #28a745;
    color: white;
    padding: 3mm 8mm;
    border-radius: 4mm;
    font-size: 9pt;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5pt;
}

.status-pending-a4 {
    background: #17a2b8;
    color: white;
    padding: 3mm 8mm;
    border-radius: 4mm;
    font-size: 9pt;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5pt;
}

/* Date Formatting */
.date-format-a4 {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #666;
}

/* Responsive Design for A4 */
@media screen and (max-width: 210mm) {
    .quote-preview-a4 {
        width: 100%;
        min-height: auto;
        margin: 0;
        padding: 10mm;
        box-shadow: none;
    }
    
    .quote-header-a4 {
        flex-direction: column;
        text-align: center;
        gap: 8mm;
    }
    
    .products-table-a4 {
        font-size: 9pt;
    }
    
    .products-table-a4 th,
    .products-table-a4 td {
        padding: 6mm 4mm;
    }
}

/* Print Media Queries */
@media print {
    .quote-preview-a4 {
        width: 210mm;
        height: 297mm;
        margin: 0;
        padding: 15mm;
        box-shadow: none;
        page-break-after: always;
    }
    
    .quote-header-a4 {
        background: #667eea !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
    
    .quote-section-a4 {
        page-break-inside: avoid;
        box-shadow: none;
    }
    
    .products-table-a4 table {
        page-break-inside: avoid;
    }
    
    .total-section-a4 {
        page-break-inside: avoid;
    }
    
    /* Hide elements not needed in print */
    .no-print-a4 {
        display: none !important;
    }
}

/* High DPI Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .quote-preview-a4 {
        font-size: 11pt;
    }
    
    .quote-header-a4 h2 {
        font-size: 22pt;
    }
    
    .quote-section-a4 h3 {
        font-size: 15pt;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .quote-preview-a4 {
        background: #1a1a1a;
        color: #e0e0e0;
    }
    
    .quote-section-a4 {
        background: #2d2d2d;
        border-left-color: #667eea;
    }
    
    .products-table-a4 th {
        background: #3a3a3a;
        color: #e0e0e0;
    }
    
    .products-table-a4 tr:nth-child(even) {
        background: #333333;
    }
    
    .notes-section-a4 p {
        background: #2d2d2d;
        color: #b0b0b0;
    }
    
    .quote-footer-a4 {
        background: #2d2d2d;
        border-color: #444;
    }
}

/* Accessibility Improvements */
.quote-preview-a4 {
    /* High contrast mode support */
    --high-contrast: 1;
}

.quote-preview-a4[data-high-contrast="true"] {
    --high-contrast: 1.2;
}

.quote-preview-a4[data-high-contrast="true"] .quote-header-a4 {
    background: #000 !important;
    color: #fff !important;
}

.quote-preview-a4[data-high-contrast="true"] .quote-section-a4 {
    border-left-color: #000;
}

/* Focus indicators for keyboard navigation */
.quote-preview-a4:focus-within {
    outline: 2mm solid #667eea;
    outline-offset: 2mm;
}

/* Screen reader support */
.sr-only-a4 {
    position: absolute;
    width: 1mm;
    height: 1mm;
    padding: 0;
    margin: -1mm;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
