/* تعریف فونت‌های فارسی */
@font-face {
    font-family: 'IRANSans';
    src: url('fonts/IRANSans.woff2') format('woff2'),
         url('fonts/IRANSans.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANSans';
    src: url('fonts/IRANSans-web.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* استایل فرم پرداخت */
.wc-zarin-payment-form {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.wc-zarin-payment-form:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.wc-zarin-payment-form .payment-title {
    color: #333;
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-family: 'IRANSans', 'Tahoma', sans-serif;
    font-weight: bold;
}

/* استایل اطلاعات بانکی */
.bank-info-container {
    margin-bottom: 20px;
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.bank-info-container:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.bank-logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 10px;
    display: block;
}

.bank-logo img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    margin: 0 auto;
}

.bank-name {
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
    font-family: 'IRANSans', 'Tahoma', sans-serif;
}

.bank-info-row {
    display: flex;
    margin-bottom: 10px;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
}

.bank-info-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.bank-info-label {
    min-width: 100px;
    font-weight: bold;
    color: #666;
    font-family: 'IRANSans', 'Tahoma', sans-serif;
}

.bank-info-value-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-grow: 1;
    justify-content: space-between;
    position: relative;
    padding-left: 80px;
}

.bank-info-value {
    font-size: 16px;
    color: #333;
    font-weight: bold;
    flex-grow: 1;
    direction: rtl;
    text-align: right;
    letter-spacing: 1px;
    font-family: 'IRANSans', 'Tahoma', sans-serif;
}

/* استایل مشترک برای شماره کارت، شماره حساب و شماره شبا */
.card-number, .sheba-number, .account-number {
    font-family: 'Courier New', monospace;
    background: #f0f0f0;
    padding: 5px 10px;
    border-radius: 5px;
    position: relative;
    direction: rtl;
    text-align: right;
    display: inline-block;
    letter-spacing: 1px;
    font-weight: bold;
    border: 1px solid #ddd;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    width: 100%;
}

/* استایل دکمه کپی */
.copy-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    outline: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-family: 'IRANSans', 'Tahoma', sans-serif;
    font-size: 12px;
    transition: all 0.3s ease;
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    user-select: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    
}

.copy-btn:hover {
    background-color: #45a049;
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
}

.copy-btn:active {
    background-color: #3e8e41;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transform: translateY(-50%) scale(0.97);
}

.copy-btn.copied {
    background-color: #28a745;
}

/* استایل بخش آپلود ساده */
.upload-section {
    margin-top: 20px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.upload-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
    font-family: 'IRANSans', 'Tahoma', sans-serif;
}

.simple-upload-box {
    background-color: white;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #ddd;
    position: relative;
}

.upload-hint {
    margin-top: 10px;
    font-size: 12px;
    color: #666;
}

#receipt {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f9f9f9;
    cursor: pointer;
    margin-bottom: 10px;
}

#receipt:hover {
    border-color: #4CAF50;
    background-color: #f0f9f0;
}

#receipt:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
}

/* استایل دکمه آپلود */
.upload-btn {
    display: block;
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'IRANSans', 'Tahoma', sans-serif;
    font-size: 16px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-weight: bold;
}

.upload-btn:hover {
    background-color: #45a049;
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
}

.upload-btn:active {
    background-color: #3e8e41;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transform: scale(0.98);
}

.upload-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.5);
}

.upload-btn:disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    box-shadow: none;
}

/* حذف استایل‌های غیرضروری */
.wc-zarin-payment-form input[type="file"], 
.file-preview,
.file-preview.dragover,
.file-preview.has-file,
.file-preview .drop-text,
.file-preview img,
.file-preview .file-name,
.file-preview .file-size {
    /* استایل‌های حذف شده برای اطمینان از عدم تداخل */
    display: none !important;
}

.upload-icon {
    width: 64px;
    height: 64px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%234CAF50"><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    margin-bottom: 15px;
}

.file-preview.has-file .upload-icon {
    display: none;
}

.drop-instruction {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.file-preview.has-file .drop-instruction {
    display: none;
}

.file-preview img {
    max-width: 100%;
    max-height: 150px;
    border-radius: 4px;
    display: block;
    margin: 0 auto 10px;
}

.file-name {
    display: inline-block;
    margin: 10px 0;
    padding: 8px 15px;
    background-color: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 4px;
    color: #2e7d32;
    font-size: 14px;
    font-weight: bold;
    direction: ltr;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-status {
    margin-top: 5px;
    color: #666;
    font-size: 13px;
}

.upload-instructions {
    margin-top: 10px;
    color: #777;
    font-size: 12px;
    font-style: italic;
}

/* استایل دستورالعمل‌های پرداخت */
.payment-instructions {
    margin-top: 20px;
    padding: 15px;
    background-color: #fff8e1;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    font-family: 'IRANSans', 'Tahoma', sans-serif;
}

.payment-instructions p {
    margin: 0 0 10px;
    color: #5d4037;
}

.payment-instructions p:last-child {
    margin-bottom: 0;
}

/* استایل جدول تراکنش‌ها */
.zarin-transactions-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-family: 'IRANSans', 'Tahoma', sans-serif;
}

.zarin-transactions-table th,
.zarin-transactions-table td {
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

.zarin-transactions-table th {
    background-color: #f5f5f5;
    color: #333;
    font-weight: bold;
}

.zarin-transactions-table tr:hover {
    background-color: #f9f9f9;
}

.zarin-transactions-table .status-pending {
    color: #ff9800;
    font-weight: bold;
}

.zarin-transactions-table .status-completed {
    color: #4caf50;
    font-weight: bold;
}

.zarin-transactions-table .status-failed {
    color: #f44336;
    font-weight: bold;
}

.zarin-transactions-table .receipt-link {
    color: #2196f3;
    text-decoration: none;
}

.zarin-transactions-table .receipt-link:hover {
    text-decoration: underline;
}

/* استایل صفحه مدیریت */
.zarin-admin-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
    font-family: 'IRANSans', 'Tahoma', sans-serif;
    font-weight: bold;
}

.zarin-admin-section {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.zarin-admin-section h2 {
    color: #333;
    font-size: 18px;
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-family: 'IRANSans', 'Tahoma', sans-serif;
}

/* استایل‌های پاسخگو برای موبایل */
@media screen and (max-width: 768px) {
    .wc-zarin-payment-form {
        padding: 15px;
    }
    
    .bank-info-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .bank-info-label {
        margin-bottom: 5px;
        width: 100%;
    }
    
    .bank-info-value-container {
        width: 100%;
        padding-left: 60px;
    }
    
    .copy-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .bank-info-value {
        font-size: 14px;
    }
    
    .card-number, .sheba-number, .account-number {
        font-size: 14px;
        padding: 4px 8px;
    }
    
    .upload-section {
        padding: 12px;
    }
    
    .simple-upload-box {
        padding: 12px;
    }
}

@media screen and (max-width: 480px) {
    .wc-zarin-payment-form {
        padding: 15px;
    }
    
    .bank-name {
        font-size: 16px;
    }
    
    .bank-logo {
        width: 50px;
        height: 50px;
    }
    
    .upload-btn {
        width: 100%;
    }
    
    .zarin-transactions-table th,
    .zarin-transactions-table td {
        padding: 8px 10px;
        font-size: 12px;
    }
}

@media screen and (max-width: 360px) {
    .bank-info-value-container {
        padding: 50px;
    }
    
    .card-number, .sheba-number, .account-number {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .copy-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .bank-info-label {
        font-size: 12px;
    }
    
    .bank-name {
        font-size: 14px;
    }
    
    .bank-logo {
        width: 35px;
        height: 35px;
    }
    
    .wc-zarin-payment-form .payment-title {
        font-size: 15px;
    }
    
    .upload-title {
        font-size: 14px;
    }
    
    .upload-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* اضافه کردن کلاس highlight برای تأکید بصری */
.file-preview.highlight {
    animation: highlight-pulse 1s ease-in-out;
    border-color: #f44336;
    box-shadow: 0 0 15px rgba(244, 67, 54, 0.6);
}

@keyframes highlight-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* استایل آیکون PDF */
.pdf-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 10px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.7;
}

.file-preview.has-file .pdf-icon {
    display: none;
}

.file-preview .drop-text {
    color: #666;
    font-size: 14px;
}

/* بهبود دسترسی‌پذیری */
.copy-btn:focus {
    outline: 2px solid #4CAF50;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.7);
}

#receipt:focus-visible {
    outline: 2px solid #4CAF50;
    border-color: #4CAF50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

/* بهبود تجربه کاربری */
.wc-zarin-payment-form:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.bank-info-container:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* استایل بخش آپلود و وضعیت آپلود */
.upload-status {
    margin-top: 10px;
    padding: 8px;
    border-radius: 4px;
    font-family: 'IRANSans', 'Tahoma', sans-serif;
}

.uploading {
    color: #0c5460;
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.upload-info {
    color: #856404;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 10px;
}

.upload-error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 8px 12px;
    border-radius: 4px;
}

.upload-success {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 8px 12px;
    border-radius: 4px;
}

.selected-file {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
    background-color: #f5f5f5;
    padding: 6px 10px;
    border-radius: 3px;
    border-right: 3px solid #4CAF50;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-left-color: #09f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.file-selected {
    background-color: #f0f9f0;
    border-color: #4CAF50;
}

/* استایل کلی برای فایل انتخاب شده */
.simple-upload-box.file-selected #receipt {
    border-color: #4CAF50;
    background-color: #f0f9f0;
}

/* استایل جدید برای انتخاب فایل */
.hidden-input {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 25px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    margin-bottom: 15px;
}

.upload-label:hover {
    background-color: #eef8ee;
    border-color: #4CAF50;
}

.upload-label:active {
    background-color: #e6f2e6;
}

.upload-text {
    font-family: 'IRANSans', 'Tahoma', sans-serif;
    color: #666;
    font-size: 16px;
    font-weight: bold;
}

.file-info {
    display: none;
    margin-bottom: 15px;
    padding: 12px;
    background-color: #f0f9f0;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    color: #155724;
    font-family: 'IRANSans', 'Tahoma', sans-serif;
}

.file-info.has-file {
    display: block;
}

/* استایل برای drag & drop */
.upload-label.drag-over {
    background-color: #e8f5e9;
    border-color: #2e7d32;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.uploading {
    display: flex;
    align-items: center;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid rgba(0,0,0,0.1);
    border-top-color: #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@media screen and (max-width: 768px) {
    .upload-label {
        padding: 15px 10px;
    }
    
    .upload-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 10px;
    }
    
    .upload-text {
        font-size: 14px;
    }
    
    .upload-btn {
        padding: 10px;
        font-size: 14px;
    }
}

/* استایل‌های صفحه مدیریت */
.zarin-admin-title {
    font-family: 'IRANSans', 'Tahoma', sans-serif;
    color: #333;
    margin-bottom: 20px;
}

.zarin-admin-box {
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.zarin-filter {
    display: flex;
}

.zarin-filter form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.zarin-search-box, .zarin-filter-box {
    margin-left: 15px;
}

.zarin-table {
    font-family: 'IRANSans', 'Tahoma', sans-serif;
    border-collapse: collapse;
    width: 100%;
    table-layout: auto; 
}

.zarin-table th, .zarin-table td {
    padding: 12px 15px;
    text-align: right;
}

.status-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-approved {
    background-color: #d4edda;
    color: #155724;
}

.status-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

/* استایل دکمه‌های عملیات */
.zarin-action-form {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.zarin-btn {
    padding: 4px 8px !important;
    font-size: 12px !important;
    line-height: 1.5 !important;
    height: auto !important;
    text-align: center;
    font-family: 'IRANSans', 'Tahoma', sans-serif !important;
}

.button-delete {
    background-color: #dc3545 !important;
    color: white !important;
    border-color: #dc3545 !important;
}

.button-delete:hover {
    background-color: #c82333 !important;
    border-color: #bd2130 !important;
}

/* استایل مودال نمایش تصویر */
.zarin-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
}

.zarin-modal-content {
    position: relative;
    background-color: #fefefe;
    margin: auto;
    padding: 0;
    max-width: 80%;
    max-height: 80%;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    border-radius: 4px;
}

.zarin-modal-close {
    color: #333;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    background-color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#receipt-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
}

/* استایل دکمه پرداخت و پیام‌ها */
.upload-success {
    background-color: #dff0d8;
    border: 1px solid #d6e9c6;
    color: #3c763d;
    padding: 10px 15px;
    border-radius: 4px;
    margin: 10px 0;
    display: flex;
    align-items: center;
}

.upload-success:before {
    content: '\2713';
    display: inline-block;
    margin-right: 10px;
    font-weight: bold;
    font-size: 16px;
}

.payment-hint {
    background-color: #d9edf7;
    border: 1px solid #bce8f1;
    color: #31708f;
    padding: 10px 15px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 14px;
}

/* استایل برای دکمه پرداخت هایلایت شده */
#place_order.highlighted {
    animation: highlight-button 1s ease-in-out;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.7);
}

@keyframes highlight-button {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(76, 175, 80, 0);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 15px rgba(76, 175, 80, 0.7);
    }
    100% {
        transform: scale(1.05);
        box-shadow: 0 0 15px rgba(76, 175, 80, 0.7);
    }
}

/* استایل دکمه آپلود مجدد */
#upload-receipt-btn {
    transition: all 0.3s ease;
    position: relative;
}

#upload-receipt-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* انیمیشن در حال آپلود */
.uploading {
    display: flex;
    align-items: center;
    margin: 10px 0;
    color: #3498db;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border: 2px solid rgba(52, 152, 219, 0.3);
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
