/**
 * Invoice CSS - Professional Invoice Styling
 * For both HTML and PDF invoices
 */

/* Base Invoice Container */
.akerp-invoice-container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    line-height: 1.5;
}

/* Invoice Wrapper */
.akerp-invoice-wrapper {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Header Section */
.akerp-invoice-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 30px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.akerp-company-info h1 {
    margin: 0 0 5px;
    font-size: 28px;
    font-weight: 600;
}

.akerp-company-info p {
    margin: 5px 0;
    opacity: 0.9;
    font-size: 13px;
}

.akerp-invoice-title {
    text-align: right;
}

.akerp-invoice-title h2 {
    margin: 0 0 5px;
    font-size: 32px;
    font-weight: 600;
    letter-spacing: 2px;
}

.akerp-invoice-title p {
    margin: 0;
    font-size: 12px;
    opacity: 0.8;
}

/* Invoice Body */
.akerp-invoice-body {
    padding: 40px;
}

/* Customer & Invoice Details */
.akerp-details-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.akerp-detail-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #2271b1;
}

.akerp-detail-box h3 {
    margin: 0 0 15px;
    font-size: 16px;
    color: #1e3c72;
    font-weight: 600;
}

.akerp-detail-box p {
    margin: 8px 0;
    font-size: 13px;
}

.akerp-detail-box strong {
    color: #333;
}

/* Items Table */
.akerp-items-table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
}

.akerp-items-table th {
    background: #f8f9fa;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #555;
    border-bottom: 2px solid #dee2e6;
}

.akerp-items-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
    font-size: 13px;
}

.akerp-items-table tbody tr:hover {
    background: #f8f9fa;
}

/* Totals Section */
.akerp-totals-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #eee;
    display: flex;
    justify-content: flex-end;
}

.akerp-totals-table {
    width: 350px;
    border-collapse: collapse;
}

.akerp-totals-table td {
    padding: 8px 10px;
    font-size: 13px;
}

.akerp-totals-table tr:last-child td {
    padding-top: 15px;
    border-top: 2px solid #dee2e6;
    font-weight: bold;
    font-size: 18px;
    color: #1e3c72;
}

.akerp-totals-table td:last-child {
    text-align: right;
    font-weight: 600;
}

/* Amount in Words */
.akerp-amount-words {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 12px;
    color: #666;
}

.akerp-amount-words strong {
    color: #333;
}

/* Notes Section */
.akerp-notes-section {
    margin-top: 30px;
    padding: 15px;
    background: #fff8e7;
    border-left: 4px solid #f0ad4e;
    border-radius: 8px;
    font-size: 12px;
}

.akerp-notes-section strong {
    color: #f0ad4e;
}

/* Footer */
.akerp-invoice-footer {
    background: #f8f9fa;
    padding: 20px 40px;
    text-align: center;
    font-size: 12px;
    color: #666;
    border-top: 1px solid #eee;
}

.akerp-invoice-footer p {
    margin: 5px 0;
}

/* Thank You Message */
.akerp-thankyou {
    text-align: center;
    margin-top: 30px;
    font-size: 16px;
    font-weight: 600;
    color: #1e3c72;
}

/* Status Badges */
.akerp-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.akerp-status-paid {
    background: #d1fae5;
    color: #065f46;
}

.akerp-status-pending {
    background: #fed7aa;
    color: #92400e;
}

.akerp-status-partial {
    background: #e0e7ff;
    color: #3730a3;
}

/* QR Code Section */
.akerp-qr-section {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

.akerp-qr-code {
    text-align: center;
}

.akerp-qr-code img {
    width: 100px;
    height: 100px;
    border: 1px solid #ddd;
    padding: 5px;
    border-radius: 8px;
}

.akerp-qr-code p {
    font-size: 10px;
    margin: 5px 0 0;
    color: #666;
}

/* Signature Section */
.akerp-signature {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px dashed #ddd;
}

.akerp-signature-line {
    text-align: center;
    width: 200px;
}

.akerp-signature-line .line {
    border-top: 1px solid #333;
    margin-top: 30px;
    padding-top: 8px;
    font-size: 11px;
    color: #666;
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
        margin: 0;
    }
    
    .akerp-invoice-wrapper {
        box-shadow: none;
        border-radius: 0;
    }
    
    .akerp-invoice-header {
        background: #1e3c72;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .akerp-detail-box {
        background: #f8f9fa;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .akerp-items-table th {
        background: #f8f9fa;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .akerp-invoice-footer {
        background: #f8f9fa;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        position: fixed;
        bottom: 0;
        width: 100%;
    }
    
    .akerp-signature-line .line {
        border-top: 1px solid #333;
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .akerp-invoice-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .akerp-invoice-title {
        text-align: center;
    }
    
    .akerp-details-section {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .akerp-invoice-body {
        padding: 20px;
    }
    
    .akerp-totals-section {
        justify-content: center;
    }
    
    .akerp-totals-table {
        width: 100%;
    }
    
    .akerp-items-table {
        font-size: 12px;
    }
    
    .akerp-items-table th,
    .akerp-items-table td {
        padding: 8px 10px;
    }
    
    .akerp-signature {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .akerp-invoice-wrapper {
        background: #1a1a1a;
        color: #e0e0e0;
    }
    
    .akerp-detail-box {
        background: #2a2a2a;
        border-left-color: #4a90e2;
    }
    
    .akerp-items-table th {
        background: #2a2a2a;
        color: #e0e0e0;
        border-bottom-color: #444;
    }
    
    .akerp-items-table td {
        border-bottom-color: #333;
    }
    
    .akerp-items-table tbody tr:hover {
        background: #252525;
    }
    
    .akerp-totals-section {
        border-top-color: #333;
    }
    
    .akerp-amount-words {
        background: #2a2a2a;
        color: #aaa;
    }
    
    .akerp-notes-section {
        background: #2a2a2a;
    }
    
    .akerp-invoice-footer {
        background: #2a2a2a;
        border-top-color: #333;
    }
}

/* Animation for loading */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.akerp-invoice-wrapper {
    animation: fadeIn 0.3s ease-out;
}

/* Tax Summary Table */
.akerp-tax-summary {
    margin-top: 20px;
    padding: 15px;
    background: #f0f7ff;
    border-radius: 8px;
}

.akerp-tax-summary h4 {
    margin: 0 0 10px;
    font-size: 14px;
    color: #2271b1;
}

.akerp-tax-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.akerp-tax-table td {
    padding: 5px;
}

.akerp-tax-table td:last-child {
    text-align: right;
}

/* Bank Details */
.akerp-bank-details {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 12px;
}

.akerp-bank-details h4 {
    margin: 0 0 10px;
    font-size: 13px;
    color: #333;
}

.akerp-bank-details p {
    margin: 5px 0;
}

/* Terms & Conditions */
.akerp-terms {
    margin-top: 20px;
    font-size: 11px;
    color: #888;
    text-align: center;
}

/* Watermark for Paid/Unpaid */
.akerp-watermark {
    position: relative;
}

.akerp-watermark-paid::before {
    content: "PAID";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 80px;
    font-weight: bold;
    color: rgba(0, 163, 42, 0.1);
    pointer-events: none;
    z-index: 1;
}

.akerp-watermark-pending::before {
    content: "PENDING";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 80px;
    font-weight: bold;
    color: rgba(240, 173, 78, 0.1);
    pointer-events: none;
    z-index: 1;
}