/**
 * Rahkar Ticket - Duplicate Prevention Styles
 * 
 * CSS styles for duplicate prevention UI elements
 * شیوه‌های CSS برای عناصر رابط کاربری جلوگیری از تکرار
 *
 * @package RahkarTicket
 * @since 1.1.0
 */
/**
 * Full Page Loading Overlay
 * پوشش لودینگ کل صفحه
 */

/* Full page overlay */
/* پوشش کل صفحه */
.rt-page-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    transition: opacity 0.3s ease;
}

/* Loading content container */
/* کانتینر محتوای لودینگ */
.rt-loading-content {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid #e1e5e9;
    max-width: 400px;
    width: 90%;
}

/* Large spinner */
/* اسپینر بزرگ */
.rt-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: rt-spin 1s linear infinite;
    margin: 0 auto 20px;
}

/* Spinner animation */
/* انیمیشن اسپینر */
@keyframes rt-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading text */
/* متن لودینگ */
.rt-loading-text {
    font-size: 18px;
    font-weight: 600;
    color: #1e1e1e;
    margin: 0 0 10px;
    line-height: 1.4;
}

/* Loading description */
/* توضیحات لودینگ */
.rt-loading-description {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* Progress bar */
/* نوار پیشرفت */
.rt-progress-bar {
    width: 100%;
    height: 4px;
    background: #f0f0f0;
    border-radius: 2px;
    overflow: hidden;
    margin: 20px 0 10px;
}

.rt-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0073aa, #00a0d2);
    border-radius: 2px;
    animation: rt-progress 2s ease-in-out infinite;
}

@keyframes rt-progress {
    0% { width: 0%; transform: translateX(0%); }
    50% { width: 100%; transform: translateX(0%); }
    100% { width: 100%; transform: translateX(100%); }
}

/* Dark theme support */
/* پشتیبانی تم تیره */
@media (prefers-color-scheme: dark) {
    .rt-page-loading-overlay {
        background: rgba(0, 0, 0, 0.9);
    }
    
    .rt-loading-content {
        background: #1e1e1e;
        border-color: #333;
        color: white;
    }
    
    .rt-loading-spinner {
        border-color: #333;
        border-top-color: #0073aa;
    }
    
    .rt-loading-text {
        color: white;
    }
    
    .rt-loading-description {
        color: #ccc;
    }
}

/* Mobile responsive */
/* واکنش‌گرا برای موبایل */
@media (max-width: 768px) {
    .rt-loading-content {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .rt-loading-spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
    
    .rt-loading-text {
        font-size: 16px;
    }
    
    .rt-loading-description {
        font-size: 13px;
    }
}

/* RTL Support */
/* پشتیبانی راست به چپ */
body.rtl .rt-loading-content {
    text-align: center; /* Center is same for both directions */
}

/* Accessibility */
/* دسترسی‌پذیری */
@media (prefers-reduced-motion: reduce) {
    .rt-loading-spinner,
    .rt-progress-fill {
        animation: none;
    }
    
    .rt-page-loading-overlay {
        transition: none;
    }
}

/* Print styles */
/* استایل چاپ */
@media print {
    .rt-page-loading-overlay {
        display: none !important;
    }
}
/* Form Overlay Styles */
/* شیوه‌های Overlay فرم */
.rt-form-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.rt-overlay-content {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #ddd;
}

.rt-overlay-content p {
    margin: 10px 0 0;
    color: #666;
    font-size: 14px;
}

/* Spinner Animation */
/* انیمیشن Spinner */
.rt-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: rt-spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes rt-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Submit Button States */
/* حالت‌های دکمه ارسال */
.rt-button.rt-submitting,
button.rt-submitting,
input.rt-submitting {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
    position: relative;
}

.rt-button.rt-submitting:hover,
button.rt-submitting:hover,
input.rt-submitting:hover {
    background-color: inherit !important;
}

.rt-loading-icon {
    display: inline-block;
    animation: rt-pulse 1.5s ease-in-out infinite;
}

@keyframes rt-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Progress Indicator */
/* نشانگر پیشرفت */
#rt-progress-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid #ddd;
    min-width: 250px;
    text-align: center;
}

.rt-progress-content p {
    margin: 15px 0 0;
    color: #666;
    font-size: 14px;
}

.rt-progress-bar {
    width: 100%;
    height: 4px;
    background: #f3f3f3;
    border-radius: 2px;
    overflow: hidden;
    margin: 10px 0;
}

.rt-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0073aa, #00a0d2);
    border-radius: 2px;
    animation: rt-progress 2s ease-in-out infinite;
}

@keyframes rt-progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Message Styles */
/* شیوه‌های پیام */
.rt-message {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    padding: 12px 20px;
    border-radius: 4px;
    max-width: 400px;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid;
}

.rt-message-info {
    background: #e7f3ff;
    color: #0073aa;
    border-left-color: #0073aa;
}

.rt-message-warning {
    background: #fff8e5;
    color: #b47e00;
    border-left-color: #ffb900;
}

.rt-message-error {
    background: #ffeaea;
    color: #d63638;
    border-left-color: #d63638;
}

.rt-message-success {
    background: #e8f5e8;
    color: #00a32a;
    border-left-color: #00a32a;
}

/* Form Field States */
/* حالت‌های فیلد فرم */
.rt-form-row input:disabled,
.rt-form-row select:disabled,
.rt-form-row textarea:disabled,
form input:disabled,
form select:disabled,
form textarea:disabled {
    background-color: #f5f5f5 !important;
    color: #666 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.rt-form-row.rt-processing,
form.rt-processing {
    opacity: 0.7;
    pointer-events: none;
}

/* File Upload States */
/* حالت‌های آپلود فایل */
.rt-file-input:disabled,
input[type="file"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.rt-file-preview.rt-processing {
    opacity: 0.5;
    position: relative;
}

.rt-file-preview.rt-processing::after {
    content: "در حال پردازش...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
}

/* Button Styles Enhancement */
/* بهبود شیوه‌های دکمه */
button[name="submit_ticket"]:disabled,
input[name="submit_ticket"]:disabled,
.rt-button:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    background-color: #ccc !important;
    border-color: #ccc !important;
}

/* Form Enhancement */
/* بهبود فرم */
form[data-rt-ticket-form] {
    position: relative;
}

form.rt-submitting {
    pointer-events: none;
    opacity: 0.8;
}

/* Responsive Design */
/* طراحی واکنش‌گرا */
@media (max-width: 768px) {
    #rt-progress-indicator {
        left: 10px;
        right: 10px;
        transform: translateY(-50%);
        min-width: auto;
        padding: 20px;
    }
    
    .rt-message {
        left: 10px;
        right: 10px;
        max-width: none;
    }
    
    .rt-form-overlay {
        border-radius: 0;
    }
    
    .rt-overlay-content {
        padding: 15px;
    }
}

/* RTL Support */
/* پشتیبانی RTL */
body.rtl .rt-message {
    right: auto;
    left: 20px;
}

body.rtl .rt-loading-icon {
    margin-right: 0;
    margin-left: 5px;
}

/* Accessibility Improvements */
/* بهبودهای دسترسی‌پذیری */
.rt-button:focus,
button:focus,
input[type="submit"]:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.rt-button.rt-submitting:focus,
button.rt-submitting:focus {
    outline-color: #666;
}

/* High Contrast Mode Support */
/* پشتیبانی از حالت کنترست بالا */
@media (prefers-contrast: high) {
    .rt-form-overlay {
        background: rgba(0, 0, 0, 0.8);
        color: white;
    }
    
    .rt-overlay-content {
        background: black;
        color: white;
        border-color: white;
    }
    
    .rt-spinner {
        border-color: #ccc;
        border-top-color: white;
    }
    
    .rt-message {
        border-width: 2px;
    }
}

/* Reduced Motion Support */
/* پشتیبانی از حرکت کاهش یافته */
@media (prefers-reduced-motion: reduce) {
    .rt-spinner,
    .rt-loading-icon,
    .rt-progress-fill {
        animation: none;
    }
    
    .rt-message {
        transition: none;
    }
    
    #rt-progress-indicator {
        transition: none;
    }
}

/* Print Styles */
/* شیوه‌های چاپ */
@media print {
    .rt-form-overlay,
    #rt-progress-indicator,
    .rt-message {
        display: none !important;
    }
}

/* Integration with existing themes */
/* ادغام با تم‌های موجود */
.wp-block-button .rt-button.rt-submitting,
.wp-block-button button.rt-submitting {
    opacity: 0.6 !important;
}

/* Ensure compatibility with common form plugins */
/* اطمینان از سازگاری با پلاگین‌های فرم رایج */
.wpcf7-form button.rt-submitting,
.gform_wrapper button.rt-submitting,
.elementor-form button.rt-submitting {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}
/**
 * Field Validation Styles
 * استایل‌های اعتبارسنجی فیلد
 */

/* Error field styling */
/* استایل فیلد خطا */
.rt-field-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
    background-color: #fff5f5 !important;
}

.rt-field-error:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* Validation error messages */
/* پیام‌های خطای اعتبارسنجی */
.rt-validation-errors {
    animation: rt-shake 0.5s ease-in-out;
}

@keyframes rt-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Required field indicator */
/* نشانگر فیلد اجباری */
.rt-form-row.required label::after,
label.required::after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
}