﻿/* ========== Invoice Wrapper ========== */
.invoice-wrapper {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    max-width: 1200px;
    margin: 0 auto;
}

/* ========== Invoice Header - بدون gradient ========== */
.invoice-header {
    background: rgb(47 201 10) !important; /* رنگ ثابت مترونیک */
    padding: 3rem;
    border-radius: 12px 12px 0 0;
    color: rgb(255, 255, 255) !important;
    position: relative;
    overflow: hidden;
}

    .invoice-header::before {
        content: '';
        position: absolute;
        top: -50%;
        right: -10%;
        width: 300px;
        height: 300px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 50%;
    }

.invoice-number {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    display: inline-block;
    backdrop-filter: blur(10px);
}

/* ========== Invoice Info Cards ========== */
.invoice-info-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    transition: all 0.3s;
}

    .invoice-info-card:hover {
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
        transform: translateY(-2px);
    }

/* ========== Products Section ========== */
.products-section {
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 2rem;
}

.products-section-header {
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

/* ========== Invoice Table ========== */
.invoice-table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 0 1px #e9ecef;
    border-collapse: separate;
    border-spacing: 0;
}

    .invoice-table thead {
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    }

        .invoice-table thead th {
            border: none;
            padding: 1.2rem 1rem;
            font-weight: 600;
            color: #495057;
            text-transform: uppercase;
            font-size: 0.75rem;
            letter-spacing: 0.5px;
            position: relative;
        }

            .invoice-table thead th:not(:last-child)::after {
                content: '';
                position: absolute;
                right: 0;
                top: 25%;
                height: 50%;
                width: 1px;
                background: #dee2e6;
            }

    /* ========== Table Rows - Zebra Striping ========== */
    .invoice-table tbody tr {
        transition: all 0.2s ease;
        border: none;
    }

        .invoice-table tbody tr.row-odd {
            background-color: #ffffff;
        }

        .invoice-table tbody tr.row-even {
            background-color: #f8f9fa;
        }

        .invoice-table tbody tr:hover {
            background-color: #e3f2fd !important;
            transform: scale(1.01);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

    .invoice-table tbody td {
        padding: 1.2rem 1rem;
        vertical-align: middle;
        border-bottom: 1px solid #f1f3f5;
        position: relative;
    }

        .invoice-table tbody td:not(:last-child)::after {
            content: '';
            position: absolute;
            right: 0;
            top: 25%;
            height: 50%;
            width: 1px;
            background: #f1f3f5;
        }

/* ========== Summary Section ========== */
.summary-section {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.summary-table {
    border-collapse: separate;
    border-spacing: 0;
}

.summary-row {
    background: transparent;
}

    .summary-row td {
        padding: 0.75rem 1rem;
        font-weight: 500;
        border: none;
        border-bottom: 1px solid #e9ecef;
    }

    .summary-row:last-child td {
        border-bottom: none;
    }

    /* ========== جمع کل بدون gradient ========== */
    .summary-row.total {
        background: gray !important; /* رنگ ثابت مترونیک */
        color: white !important;
        border-radius: 10px;
        margin-top: 0.5rem;
    }

        .summary-row.total td {
            border-color: green;
        }

/* ========== Status Badges ========== */
.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
}

    .status-badge.active {
        background: #d1fae5;
        color: #065f46;
    }

    .status-badge.pending {
        background: #fed7aa;
        color: #92400e;
    }

    .status-badge.paid {
        background: #ddd6fe;
        color: #5b21b6;
    }

/* ========== Print Button ========== */
.print-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #009ef7;
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 158, 247, 0.4);
    transition: all 0.3s;
    z-index: 1000;
}

    .print-button:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 158, 247, 0.5);
        background: #0084d3;
    }

/* ========== Print Styles ========== */
@media print {
    .no-print {
        display: none !important;
    }

    .invoice-header {
        background:#a1a1a1 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        color: white !important;
    }

    .invoice-table tbody tr.row-even {
        background-color: #f8f9fa !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .summary-row.total {
        background: #495057 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        color: white !important;
    }
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    .invoice-header {
        padding: 2rem 1rem;
    }

    .products-section,
    .summary-section {
        padding: 1rem;
    }

    .invoice-table thead th,
    .invoice-table tbody td {
        padding: 0.8rem 0.5rem;
        font-size: 0.85rem;
    }

    .print-button {
        bottom: 1rem;
        right: 1rem;
        width: 50px;
        height: 50px;
    }
}

/* ========== Animation Effects ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.invoice-wrapper {
    animation: fadeInUp 0.5s ease-out;
}

.invoice-table tbody tr {
    animation: fadeInUp 0.3s ease-out;
}

    .invoice-table tbody tr:nth-child(1) {
        animation-delay: 0.1s;
    }

    .invoice-table tbody tr:nth-child(2) {
        animation-delay: 0.2s;
    }

    .invoice-table tbody tr:nth-child(3) {
        animation-delay: 0.3s;
    }

    .invoice-table tbody tr:nth-child(4) {
        animation-delay: 0.4s;
    }

    .invoice-table tbody tr:nth-child(5) {
        animation-delay: 0.5s;
    }
