/* 
 * استایل‌های محاسبه‌گر کارمزد دستگاه کارتخوان
 * نسخه: 1.0.0
 */

/* فونت‌ها */
.crfc-container {
    /* font-family: 'IRANSans', 'Tahoma', Arial, sans-serif; */
    direction: rtl;
    text-align: right;
}

/* متغیرهای CSS */
:root {
    --crfc-primary: #00C1A4;
    --crfc-primary-light: #E5F7F4;
    --crfc-primary-dark: #009982;
    --crfc-secondary: #f8f9fa;
    --crfc-text: #333333;
    --crfc-text-light: #666666;
    --crfc-border: #e0e0e0;
    --crfc-error: #dc3545;
    --crfc-success: #28a745;
    --crfc-white: #ffffff;
    --crfc-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --crfc-radius: 8px;
}

/* کانتینر اصلی */
.crfc-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    font-size: 14px;
    line-height: 1.6;
    background: var(--crfc-white);
    border-radius: var(--crfc-radius);
    box-shadow: var(--crfc-shadow);
}

/* هدر */
.crfc-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--crfc-primary-light);
}

.crfc-title {
    font-size: 24px;
    font-weight: bold;
    color: var(--crfc-text);
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.crfc-subtitle {
    color: var(--crfc-text-light);
    margin: 0;
    font-size: 14px;
}

.crfc-icon {
    font-size: 1.2em;
}

/* بخش محاسبه‌گر */
.crfc-calculator-section {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

@media (min-width: 768px) {
    .crfc-calculator-section {
        grid-template-columns: 1fr 1fr;
    }
}

/* کارت‌ها */
.crfc-card {
    background: var(--crfc-white);
    border: 1px solid var(--crfc-border);
    border-radius: var(--crfc-radius);
    padding: 20px;
    box-shadow: var(--crfc-shadow);
    margin-bottom: 20px;
}

.crfc-calculator-card {
    border-color: var(--crfc-primary);
    background: var(--crfc-primary-light);
}

.crfc-card-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--crfc-text);
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--crfc-border);
}

/* فرم ورودی */
.crfc-input-group {
    margin-bottom: 20px;
}

.crfc-label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--crfc-text);
}

.crfc-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--crfc-border);
    border-radius: var(--crfc-radius);
    font-size: 16px;
    font-family: 'IRANSans', monospace;
    text-align: center;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.crfc-input:focus {
    outline: none;
    border-color: var(--crfc-primary);
    box-shadow: 0 0 0 3px rgba(0, 193, 164, 0.1);
}

.crfc-input::placeholder {
    color: var(--crfc-text-light);
    font-style: italic;
}

/* پیام خطا */
.crfc-error {
    background: #ffe6e6;
    color: var(--crfc-error);
    padding: 12px 15px;
    border-radius: var(--crfc-radius);
    border: 1px solid var(--crfc-error);
    margin-top: 10px;
    font-weight: bold;
    text-align: center;
}

/* نتیجه */
.crfc-result {
    background: var(--crfc-primary-light);
    border: 2px solid var(--crfc-primary);
    border-radius: var(--crfc-radius);
    padding: 20px;
    margin-top: 20px;
    text-align: center;
    animation: fadeIn 0.5s ease-in-out;
}

.crfc-result-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.crfc-result-label {
    color: var(--crfc-text-light);
    margin: 0;
    font-size: 14px;
}

.crfc-result-amount {
    color: var(--crfc-primary-dark);
    font-size: 24px;
    font-weight: bold;
    margin: 0;
    font-family: 'IRANSans', monospace;
}

.crfc-result-note {
    color: var(--crfc-text-light);
    font-size: 12px;
    margin: 0;
    font-style: italic;
}

/* قوانین */
.crfc-rules {
    margin-bottom: 20px;
}

.crfc-rule {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: var(--crfc-secondary);
    border-radius: var(--crfc-radius);
    margin-bottom: 10px;
}

.crfc-rule-number {
    background: var(--crfc-primary);
    color: var(--crfc-white);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.crfc-rule-content h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: var(--crfc-text);
}
table.crfc-table th {
    background-color: #00C1A4 !important;
}
.crfc-rule-content p {
    margin: 0;
    color: var(--crfc-text-light);
    font-size: 14px;
}

.crfc-important-note {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    border-radius: var(--crfc-radius);
    font-size: 14px;
    text-align: center;
}

/* جدول */
.crfc-table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
	direction: ltr;
	text-align-last: center;
}

.crfc-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--crfc-white);
    border-radius: var(--crfc-radius);
    overflow: hidden;
    box-shadow: var(--crfc-shadow);
}

.crfc-table th,
.crfc-table td {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid var(--crfc-border);
}

.crfc-table th {
    background: var(--crfc-primary);
    color: var(--crfc-white);
    font-weight: bold;
    font-size: 14px;
}

.crfc-table td {
    font-size: 13px;
    color: var(--crfc-text);
}

.crfc-table tbody tr:hover {
    background: var(--crfc-primary-light);
}

.crfc-table tbody tr:last-child td {
    border-bottom: none;
}

.crfc-fee-cell {
    color: var(--crfc-primary-dark);
    font-weight: bold;
}

/* معافیت‌ها */
.crfc-exemptions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.crfc-exemption {
    background: var(--crfc-secondary);
    padding: 10px 15px;
    border-radius: var(--crfc-radius);
    color: var(--crfc-text);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.crfc-exemption::before {
    content: "•";
    color: var(--crfc-primary);
    font-weight: bold;
    font-size: 16px;
}

/* انیمیشن‌ها */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.crfc-card {
    animation: fadeIn 0.5s ease-in-out;
}

/* حالت واکنش‌گرا */
@media (max-width: 767px) {
    .crfc-container {
        margin: 10px;
        padding: 15px;
    }
    
    .crfc-title {
        font-size: 20px;
        flex-direction: column;
        gap: 5px;
    }
    
    .crfc-card {
        padding: 15px;
    }
    
    .crfc-card-title {
        font-size: 16px;
    }
    
    .crfc-result-amount {
        font-size: 20px;
    }
    
    .crfc-table th,
    .crfc-table td {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .crfc-exemptions {
        grid-template-columns: 1fr;
    }
}

/* سازگاری با تم‌های مختلف وردپرس */
.widget .crfc-container {
    margin: 0;
    box-shadow: none;
    border: none;
    background: transparent;
}

.sidebar .crfc-card {
    margin-bottom: 15px;
}

.sidebar .crfc-calculator-section {
    grid-template-columns: 1fr;
}

/* حالت تیره */
@media (prefers-color-scheme: dark) {
    :root {
        --crfc-text: #e0e0e0;
        --crfc-text-light: #b0b0b0;
        --crfc-secondary: #2a2a2a;
        --crfc-border: #404040;
        --crfc-white: #1a1a1a;
    }
}

/* تنظیمات چاپ */
@media print {
    .crfc-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .crfc-input {
        border: 1px solid #000;
    }
    
    .crfc-result {
        border: 2px solid #000;
    }
}