/* استایل‌های عمومی فاکتور */
.invoice-container {
    font-family: 'Tahoma', 'Arial', sans-serif;
    direction: rtl;
    text-align: right;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    color: #333;
}

/* هدر فاکتور */
.invoice-header {
    border-bottom: 2px solid #333;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.company-info {
    text-align: center;
    margin-bottom: 20px;
}

.company-info h1 {
    font-size: 24px;
    font-weight: bold;
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.company-info h2 {
    font-size: 18px;
    font-weight: normal;
    margin: 0 0 10px 0;
    color: #34495e;
}

.company-info p {
    font-size: 14px;
    margin: 0;
    color: #7f8c8d;
}

.invoice-title {
    text-align: center;
    margin: 20px 0;
}

.invoice-title h3 {
    font-size: 28px;
    font-weight: bold;
    margin: 0;
    color: #2c3e50;
    border: 2px solid #333;
    padding: 10px 20px;
    display: inline-block;
}

.invoice-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.meta-left, .meta-right {
    flex: 1;
}

.meta-left p, .meta-right p {
    margin: 5px 0;
    font-size: 14px;
}

/* جدول محصولات */
.invoice-items {
    margin: 30px 0;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #333;
    margin-bottom: 20px;
}

.items-table th {
    background-color: #f8f9fa;
    border: 1px solid #333;
    padding: 12px 8px;
    font-weight: bold;
    text-align: center;
    font-size: 14px;
}

.items-table td {
    border: 1px solid #333;
    padding: 8px;
    text-align: center;
    font-size: 13px;
}

.items-table td:nth-child(2) {
    text-align: right;
    padding-right: 15px;
}

.items-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

/* فوتر فاکتور */
.invoice-footer {
    margin-top: 30px;
    border-top: 2px solid #333;
    padding-top: 20px;
}

.total-amount {
    margin-bottom: 20px;
}

.total-amount p {
    font-size: 16px;
    margin: 8px 0;
    font-weight: bold;
}

.disclaimer {
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.disclaimer p {
    font-size: 12px;
    line-height: 1.6;
    margin: 0;
    text-align: justify;
}

.signatures {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.seller-signature, .buyer-signature {
    flex: 1;
    text-align: center;
}

.seller-signature p, .buyer-signature p {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 20px;
}

.stamp {
    border: 2px solid #333;
    padding: 10px;
    background-color: #e8f4fd;
    display: inline-block;
    margin-top: 10px;
}

.stamp p {
    margin: 2px 0;
    font-size: 12px;
    font-weight: normal;
}

/* استایل‌های دکمه چاپ */
.wpi-print-invoice-section {
    margin: 20px 0;
    text-align: center;
}

.wpi-print-invoice-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.wpi-print-invoice-btn:hover {
    background: #005a87;
}

.wpi-print-invoice-btn .dashicons {
    margin-left: 8px;
    vertical-align: middle;
}

/* استایل‌های چاپ */
@media print {
    body {
        margin: 0;
        padding: 0;
        background: white;
    }
    
    .invoice-container {
        max-width: none;
        margin: 0;
        padding: 0;
        box-shadow: none;
    }
    
    .wpi-print-invoice-section {
        display: none;
    }
    
    .invoice-header {
        page-break-inside: avoid;
    }
    
    .items-table {
        page-break-inside: avoid;
    }
    
    .invoice-footer {
        page-break-inside: avoid;
    }
    
    @page {
        margin: 1cm;
        size: A4;
    }
}

/* استایل‌های عمومی صفحه */
.wpi-print-invoice-section {
    margin: 20px 0;
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #ddd;
}

/* انیمیشن لودینگ */
.wpi-loading {
    opacity: 0.6;
    pointer-events: none;
}

.wpi-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: wpi-spin 1s linear infinite;
}

@keyframes wpi-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
