/* ProformaInvoiceView.razor.css - Scoped styles for Proforma/Invoice view */

/* Action Bar (No Print) */
.action-bar {
    background: white;
    padding: 15px;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 20px;
}

/* Document Content */
.document-content {
    background: white;
    padding: 30px;
    max-width: 210mm;
    margin: 0 auto;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Header Section */
.document-header {
    border-bottom: 3px solid #2c3e50;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.company-logo {
    max-width: 150px;
    max-height: 80px;
    object-fit: contain;
}

.company-logo-placeholder {
    width: 150px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 5px;
}

.gra-logo {
    max-width: 100px;
    max-height: 60px;
    object-fit: contain;
}

.document-title {
    color: #2c3e50;
    font-weight: 700;
    font-size: 24px;
    margin-bottom: 10px;
}

/* Info Section */
.info-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.company-name {
    color: #2c3e50;
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 10px;
}

.invoice-info-box {
    background: white;
    border: 2px solid #2c3e50;
    border-radius: 8px;
    padding: 15px;
}

.invoice-info-box h5 {
    background: #2c3e50;
    color: white;
    padding: 8px 15px;
    margin: -15px -15px 15px -15px;
    border-radius: 6px 6px 0 0;
    text-align: center;
}

/* Line Items Section */
.line-items-section {
    margin-top: 30px;
}

.line-items-section table {
    font-size: 13px;
}

.line-items-section thead th {
    background: #2c3e50 !important;
    color: white;
    font-weight: 600;
    padding: 10px;
    border: 1px solid #1a252f;
}

.line-items-section tbody td {
    padding: 8px;
    vertical-align: top;
}

.separator-line {
    height: 2px;
    background: #dee2e6;
    padding: 0 !important;
}

/* Footer Section */
.footer-section {
    margin-top: 30px;
}

.footer-charges {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
}

.totals-table {
    border: 2px solid #2c3e50;
}

.totals-table td {
    padding: 8px 12px;
}

.totals-table .table-success td {
    background: #d4edda !important;
    font-weight: bold;
}

.totals-table .table-info td {
    background: #d1ecf1 !important;
}

/* Document Footer */
.document-footer {
    border-top: 2px solid #dee2e6;
    padding-top: 20px;
    margin-top: 40px;
}

/* Print Styles */
@media print {
    /* Hide non-printable elements */
    .action-bar,
    .no-print {
        display: none !important;
    }

    /* Reset for print */
    body {
        margin: 0;
        padding: 0;
    }

    .document-content {
        max-width: 100%;
        margin: 0;
        padding: 15mm;
        box-shadow: none;
    }

    /* Ensure proper page breaks */
    .document-header,
    .info-section,
    .line-items-section,
    .footer-section {
        page-break-inside: avoid;
    }

    /* Ensure colors print correctly */
    .line-items-section thead th,
    .invoice-info-box h5,
    .totals-table .table-success td,
    .totals-table .table-info td {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Ensure table headers repeat on each page */
    thead {
        display: table-header-group;
    }

    tfoot {
        display: table-footer-group;
    }

    /* Optimize borders for print */
    .table-bordered {
        border: 1px solid #000;
    }

    .table-bordered th,
    .table-bordered td {
        border: 1px solid #000;
    }

    /* Remove shadows that don't print well */
    .invoice-info-box,
    .info-section {
        box-shadow: none;
    }
}

/* Responsive */
@media screen and (max-width: 768px) {
    .document-content {
        padding: 15px;
    }

    .document-title {
        font-size: 20px;
    }

    .line-items-section table {
        font-size: 11px;
    }
}