/**
 * أنماط إضافة DUA Tests
 */

/* الحاوي الرئيسي */
.dua-test-container, .dua-result-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    direction: rtl;
    text-align: right;
}

.dua-test-container[dir="ltr"], .dua-result-container[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

/* حالات التحميل والأخطاء */
.dua-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.dua-loading p {
    margin: 0;
    font-size: 16px;
}

.dua-error {
    text-align: center;
    padding: 30px 20px;
    background: #fff5f5;
    border: 2px solid #fed7d7;
    border-radius: 8px;
    color: #c53030;
}

.dua-error .error-message {
    margin-bottom: 15px;
    font-weight: 500;
}

.dua-retry-btn {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.dua-retry-btn:hover {
    background: #c53030;
}

/* رأس الاختبار */
.dua-test-header {
    margin-bottom: 30px;
    text-align: center;
}

.dua-test-title {
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: 600;
    color: #2d3748;
}

/* شريط التقدم */
.dua-progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.dua-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4299e1, #3182ce);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.dua-progress-text {
    margin: 0;
    font-size: 14px;
    color: #718096;
    font-weight: 500;
}

/* الأسئلة */
.dua-question {
    margin-bottom: 30px;
    padding: 25px;
    background: #f7fafc;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

.dua-question-text h4 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.5;
}

/* الخيارات */
.dua-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dua-option {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.dua-option:hover {
    border-color: #cbd5e0;
    background: #f7fafc;
}

.dua-option input[type="radio"] {
    margin-left: 12px;
    margin-right: 0;
    transform: scale(1.2);
    accent-color: #3182ce;
}

.dua-option input[type="radio"]:checked + span {
    font-weight: 600;
    color: #3182ce;
}

.dua-option:has(input[type="radio"]:checked) {
    border-color: #3182ce;
    background: #ebf8ff;
}

/* أزرار التنقل */
.dua-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
}

.dua-prev-btn, .dua-next-btn, .dua-submit-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.dua-prev-btn {
    background: #e2e8f0;
    color: #4a5568;
}

.dua-prev-btn:hover {
    background: #cbd5e0;
}

.dua-next-btn, .dua-submit-btn {
    background: #3182ce;
    color: white;
}

.dua-next-btn:hover, .dua-submit-btn:hover {
    background: #2c5282;
}

.dua-submit-btn {
    background: #38a169;
}

.dua-submit-btn:hover {
    background: #2f855a;
}

/* النتائج */
.dua-result {
    text-align: center;
    padding: 30px;
}

.dua-result h3 {
    margin: 0 0 25px 0;
    font-size: 24px;
    font-weight: 600;
    color: #2d3748;
}

.dua-score-percentage {
    margin-bottom: 25px;
}

.score-value {
    display: inline-block;
    font-size: 48px;
    font-weight: 700;
    color: #3182ce;
    background: linear-gradient(135deg, #4299e1, #3182ce);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dua-category {
    margin-bottom: 20px;
    padding: 15px 25px;
    background: #f0fff4;
    border: 2px solid #9ae6b4;
    border-radius: 8px;
    font-size: 16px;
}

.dua-subscales {
    margin-top: 25px;
    text-align: right;
}

.dua-subscales h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
}

.dua-subscales ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dua-subscales li {
    padding: 10px 15px;
    margin-bottom: 8px;
    background: #f7fafc;
    border-radius: 6px;
    border-right: 4px solid #3182ce;
}

/* تحذير الأمان */
.dua-safety-warning {
    margin-top: 25px;
    padding: 20px;
    background: #fff5f5;
    border: 2px solid #feb2b2;
    border-radius: 8px;
    color: #c53030;
    font-weight: 600;
}

/* الاستجابة للشاشات الصغيرة */
@media (max-width: 768px) {
    .dua-test-container, .dua-result-container {
        margin: 10px;
        padding: 15px;
        border-radius: 8px;
    }
    
    .dua-test-title {
        font-size: 20px;
    }
    
    .dua-question {
        padding: 20px 15px;
    }
    
    .dua-question-text h4 {
        font-size: 16px;
    }
    
    .dua-option {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .dua-form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .dua-prev-btn, .dua-next-btn, .dua-submit-btn {
        width: 100%;
        padding: 15px;
    }
    
    .score-value {
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    .dua-options {
        gap: 8px;
    }
    
    .dua-option {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .dua-question-text h4 {
        font-size: 15px;
    }
}

/* أنماط الطباعة */
@media print {
    .dua-test-container, .dua-result-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .dua-form-actions, .dua-retry-btn {
        display: none;
    }
    
    .dua-progress-bar {
        display: none;
    }
}

/* أنماط RTL محسنة */
[dir="rtl"] .dua-option input[type="radio"] {
    margin-right: 12px;
    margin-left: 0;
}

[dir="rtl"] .dua-subscales li {
    border-right: none;
    border-left: 4px solid #3182ce;
}

/* أنماط إضافية للتفاعل */
.dua-option:focus-within {
    outline: 2px solid #3182ce;
    outline-offset: 2px;
}

.dua-prev-btn:focus, .dua-next-btn:focus, .dua-submit-btn:focus {
    outline: 2px solid #3182ce;
    outline-offset: 2px;
}

/* تحسينات الوصولية */
.dua-option input[type="radio"]:focus {
    outline: none;
}

/* أنماط الحالات المختلفة */
.dua-option:has(input[type="radio"]:disabled) {
    opacity: 0.6;
    cursor: not-allowed;
}

.dua-form-actions button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* تحسينات بصرية إضافية */
.dua-test-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4299e1, #3182ce, #38a169);
    border-radius: 12px 12px 0 0;
}

.dua-test-container {
    position: relative;
    overflow: hidden;
}

/* تأثيرات الانتقال */
.dua-question {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
