/**
 * Invoice Print Styles
 * Optimized for printing and PDF export
 */

/* ===== Print Media Query ===== */
@media print {
    /* Hide non-printable elements */
    .header,
    .form-panel,
    .preview-header,
    .toast,
    .loading-overlay,
    .btn {
        display: none !important;
    }

    /* Reset body */
    body {
        background: white;
        margin: 0;
        padding: 0;
    }

    /* Full page preview */
    .dashboard {
        display: block;
        padding: 0;
        margin: 0;
    }

    .preview-panel {
        position: static;
        max-height: none;
        border: none;
        box-shadow: none;
        background: white;
    }

    .preview-container {
        padding: 0;
        background: white;
    }

    .invoice-preview {
        box-shadow: none;
        border-radius: 0;
    }

    .invoice-document {
        padding: 20mm;
        min-height: auto;
    }

    /* Page breaks */
    .inv-items {
        page-break-inside: avoid;
    }

    .inv-totals {
        page-break-inside: avoid;
    }

    .inv-notes {
        page-break-inside: avoid;
    }

    /* Colors for print */
    .inv-items th {
        background: #1f2937 !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .inv-title h2 {
        color: #2563eb !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .inv-grand-total span:last-child {
        color: #2563eb !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .inv-notes {
        background: #f9fafb !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .inv-totals-row {
        page-break-inside: avoid;
    }

    .inv-stamp img {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .inv-totals {
        page-break-inside: avoid;
    }
}

/* ===== PDF Export Specific Styles ===== */
.pdf-export-mode {
    background: white;
}

.pdf-export-mode .invoice-document {
    box-shadow: none;
}

/* ===== Invoice Template Variants ===== */

/* Classic Template */
.template-classic .inv-header {
    border-bottom: 3px double #1f2937;
}

.template-classic .inv-title h2 {
    color: #1f2937;
}

.template-classic .inv-items th {
    background: #1f2937;
}

/* Modern Template */
.template-modern .inv-header {
    border-bottom: 4px solid #2563eb;
}

.template-modern .inv-logo {
    background: #dbeafe;
    padding: 10px;
}

/* Minimal Template */
.template-minimal .inv-header {
    border-bottom: 1px solid #e5e7eb;
}

.template-minimal .inv-title h2 {
    font-weight: 400;
    letter-spacing: 4px;
}

.template-minimal .inv-items th {
    background: white;
    color: #6b7280;
    border-bottom: 2px solid #1f2937;
}

/* ===== Status Badges ===== */
.inv-status {
    display: inline-block;
    padding: 4px 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 9999px;
}

.inv-status-draft {
    background: #f3f4f6;
    color: #6b7280;
}

.inv-status-sent {
    background: #dbeafe;
    color: #2563eb;
}

.inv-status-paid {
    background: #d1fae5;
    color: #059669;
}

.inv-status-overdue {
    background: #fee2e2;
    color: #dc2626;
}

.inv-status-cancelled {
    background: #fef3c7;
    color: #d97706;
}

/* ===== Currency Display ===== */
.currency-symbol {
    font-family: 'Inter', system-ui, sans-serif;
}

/* ===== Watermark (for drafts) ===== */
.inv-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 100px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.03);
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 10px;
    z-index: 0;
}

/* ===== A4 Page Size Reference ===== */
.page-a4 {
    width: 210mm;
    min-height: 297mm;
    padding: 20mm;
    margin: auto;
}

/* ===== Letter Page Size Reference ===== */
.page-letter {
    width: 8.5in;
    min-height: 11in;
    padding: 0.75in;
    margin: auto;
}
