/**
 * استایل‌های فرم کمک مالی
 */

.sdf-donation-form-wrapper {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
}

.sdf-donation-form-container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sdf-form-title {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 24px;
}

.sdf-message {
    padding: 15px 20px;
    margin-bottom: 25px;
    border-radius: 6px;
    border-right: 4px solid;
    font-size: 14px;
    font-weight: 500;
    animation: slideDown 0.3s ease-out;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sdf-message-success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.sdf-message-error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.sdf-message-info {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

.sdf-form-group {
    margin-bottom: 20px;
}

.sdf-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.sdf-form-group .required {
    color: #dc3545;
}

.sdf-form-input,
.sdf-form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #adb5bd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    font-family: inherit;
}

.sdf-form-input:hover,
.sdf-form-textarea:hover {
    border-color: #868e96;
}

.sdf-form-input:focus,
.sdf-form-textarea:focus {
    border-color: #1E3A5F;
    border-width: 2px;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(30, 58, 95, 0.25);
}

/* استایل textarea */
.sdf-form-textarea {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}


.sdf-form-help {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.sdf-captcha-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sdf-captcha-question {
    font-size: 18px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
    min-width: 100px;
    text-align: center;
}

.sdf-captcha-input {
    width: 100px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.sdf-captcha-refresh {
    padding: 10px 15px;
    background: #007cba;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.sdf-captcha-refresh:hover {
    background: #005a87;
}

.sdf-submit-btn {
    width: 100%;
    padding: 15px;
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.sdf-submit-btn:hover {
    background: #218838;
}

.sdf-submit-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.sdf-form-messages {
    margin-top: 15px;
}

.sdf-form-messages .sdf-error {
    color: #dc3545;
    padding: 10px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* استایل‌های پنل ادمین */
.sdf-dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.sdf-stat-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
}

.sdf-stat-box h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
}

.sdf-stat-number {
    font-size: 32px;
    font-weight: bold;
    margin: 0;
    color: #333;
}

.sdf-stat-success .sdf-stat-number {
    color: #28a745;
}

.sdf-stat-pending .sdf-stat-number {
    color: #ffc107;
}

.sdf-stat-failed .sdf-stat-number {
    color: #dc3545;
}

.sdf-stat-amount .sdf-stat-number {
    color: #007cba;
}

.sdf-status {
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

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

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

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

.sdf-filters {
    margin: 20px 0;
}

.sdf-filters select {
    margin-right: 10px;
}

/* استایل‌های فرم چند مرحله‌ای */
.sdf-multistep-form .sdf-form-step {
    display: none;
}

.sdf-multistep-form .sdf-form-step[data-step="1"] {
    display: block;
}

.sdf-step-title {
    font-size: 20px;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007cba;
    color: #333;
}

.sdf-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sdf-radio-label {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.sdf-radio-label:hover {
    background: #f5f5f5;
    border-color: #007cba;
}

.sdf-radio-label input[type="radio"] {
    margin-left: 10px;
    cursor: pointer;
}

.sdf-radio-label input[type="radio"]:checked + span {
    font-weight: 600;
    color: #007cba;
}

.sdf-radio-label:has(input[type="radio"]:checked) {
    background: #e7f3ff;
    border-color: #007cba;
}

/* برای مرورگرهایی که :has را پشتیبانی نمی‌کنند */
.sdf-radio-label input[type="radio"]:checked ~ span {
    font-weight: 600;
    color: #007cba;
}

.sdf-label-required::after {
    content: ' *';
    color: #dc3545;
}

.sdf-intention-header {
    margin-bottom: 15px;
}

.sdf-intention-description {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
    line-height: 1.6;
}

.sdf-amount-display {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    direction: rtl;
}

.sdf-amount-rial,
.sdf-amount-toman {
    font-size: 16px;
    direction: rtl;
    display: flex;
    align-items: center;
    gap: 5px;
}

.sdf-amount-rial strong,
.sdf-amount-toman strong {
    color: #333;
    order: 2; /* کلمه ریال/تومان بعد از عدد */
}

.sdf-amount-rial span,
.sdf-amount-toman span {
    order: 1; /* عدد قبل از کلمه */
    font-weight: 600;
    color: #007cba;
}

.sdf-form-actions {
    display: flex;
    gap: 15px;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.sdf-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit; /* استفاده از فونت فرم */
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sdf-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.sdf-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sdf-btn-primary {
    background: #28a745;
    color: #fff;
}

.sdf-btn-primary:hover {
    background: #218838;
}

.sdf-btn-secondary {
    background: #6c757d;
    color: #fff;
}

.sdf-btn-secondary:hover {
    background: #5a6268;
}

.sdf-form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #adb5bd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    font-family: inherit;
}

.sdf-form-select:hover {
    border-color: #868e96;
}

.sdf-form-select:focus {
    border-color: #1E3A5F;
    border-width: 2px;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(30, 58, 95, 0.25);
}

.sdf-error-field {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1) !important;
}

/* Select2 RTL - بهبود استایل */
.select2-container {
    direction: rtl;
    width: 100% !important;
    min-width: 200px;
    z-index: 9999;
}

.select2-container--default .select2-selection--single {
    height: 42px;
    border: 1.5px solid #adb5bd !important;
    border-radius: 4px;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.select2-container--default .select2-selection--single:hover {
    border-color: #868e96 !important;
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #1E3A5F !important;
    border-width: 2px !important;
    box-shadow: 0 0 0 0.2rem rgba(30, 58, 95, 0.25);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 42px;
    padding-right: 20px;
    padding-left: 40px;
    color: #333;
    font-size: 13px;
}

/* حذف دکمه ضربدر وقتی dropdown بسته است و مقدار انتخاب نشده */
.select2-container--default .select2-selection--single .select2-selection__clear {
    display: none;
}

/* نمایش دکمه ضربدر فقط وقتی مقدار انتخاب شده است */
.select2-container--default .select2-selection--single[aria-expanded="false"] .select2-selection__clear {
    display: none;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
    right: 10px;
    left: auto;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #666 transparent transparent transparent;
    border-style: solid;
    border-width: 5px 4px 0 4px;
    height: 0;
    left: 50%;
    margin-left: -4px;
    margin-top: -2px;
    position: absolute;
    top: 50%;
    width: 0;
}

.select2-dropdown {
    direction: rtl;
    border: 1px solid #ced4da;
    border-radius: 4px;
    z-index: 10000 !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 8px;
    direction: rtl;
    font-size: 13px;
}

/* کوچک کردن فونت placeholder */
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #6c757d;
    font-size: 13px;
    line-height: 42px;
}

/* بهبود استایل option ها */
.select2-results__option {
    padding: 8px 12px;
    font-size: 13px;
    direction: rtl;
}

.select2-results__option--highlighted {
    background-color: #1E3A5F;
    color: #fff;
}

/* ایمیل LTR */
input[type="email"],
input[name="receipt_email"] {
    direction: ltr;
    text-align: left;
}

/* کپچای ریاضی LTR */
.sdf-captcha-question {
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: bidi-override;
    font-family: 'Courier New', monospace;
    font-size: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    min-width: 150px;
    text-align: center;
}

/* پیام‌های خطای مرحله - نمایش در ابتدای مرحله فعلی */
.sdf-step-errors {
    margin-bottom: 20px;
    padding: 12px 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-right: 4px solid #ff9800;
    border-radius: 4px;
    display: none;
    position: relative;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sdf-error-message {
    color: #856404;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 500;
}

.sdf-error-message:last-child {
    margin-bottom: 0;
}

/* پیغام validation در بالای فیلد مربوطه */
.sdf-field-error {
    display: block;
    margin-top: 5px;
    padding: 6px 10px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    font-size: 12px;
    font-weight: 500;
}

.sdf-radio-group.sdf-error-field {
    border: 2px solid #dc3545;
    border-radius: 4px;
    padding: 10px;
    background: #fff5f5;
}

/* Responsive */
@media (max-width: 768px) {
    .sdf-donation-form-wrapper {
        padding: 10px;
    }
    
    .sdf-donation-form-container {
        padding: 20px;
    }
    
    .sdf-captcha-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sdf-captcha-input {
        width: 100%;
    }
    
    .sdf-form-actions {
        flex-direction: column;
    }
    
    .sdf-btn {
        width: 100%;
    }
    
    .sdf-amount-display {
        flex-direction: column;
        gap: 10px;
    }
}

