/* تنسيقات عامة */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    padding: 20px;
    direction: rtl;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    margin-bottom: 10px;
    font-size: 2.2rem;
}

header p {
    opacity: 0.9;
    font-size: 1.1rem;
}

/* قائمة الاختبارات */
.tests-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 30px;
}

.test-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
    border-top: 4px solid #3498db;
    text-align: center;
}

.test-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.test-card h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.test-card p {
    color: #7f8c8d;
    margin-bottom: 20px;
}

.start-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
    width: 100%;
}

.start-btn:hover {
    background-color: #2980b9;
}

/* منطقة الاختبار */
#quiz-container {
    padding: 20px;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.quiz-header h2 {
    color: #2c3e50;
}

.progress-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    width: 200px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background-color: #ecf0f1;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    background-color: #3498db;
    width: 0%;
    transition: width 0.3s;
}

#progress-text {
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* منطقة السؤال */
.question-container {
    background-color: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-right: 4px solid #3498db;
}

.question-number {
    font-weight: bold;
    color: #3498db;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.question-text {
    font-size: 1.2rem;
    margin-bottom: 20px;
    line-height: 1.8;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option {
    padding: 15px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.option:hover {
    background-color: #f0f8ff;
    border-color: #3498db;
}

.option.selected {
    background-color: #d4edff;
    border-color: #3498db;
}

.option.correct {
    background-color: #d4f8d4;
    border-color: #28a745;
}

.option.incorrect {
    background-color: #f8d4d4;
    border-color: #dc3545;
}

.option input {
    margin-left: 10px;
}

/* أزرار التحكم */
.quiz-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.control-btn {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.control-btn:hover {
    background-color: #2980b9;
}

.control-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.submit-btn {
    background-color: #e74c3c;
}

.submit-btn:hover {
    background-color: #c0392b;
}

/* منطقة النتائج */
#results-container {
    padding: 30px;
    text-align: center;
}

.results-header {
    margin-bottom: 30px;
}

.results-header h2 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(#2ecc71 0%, #ecf0f1 0%);
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    background-color: white;
    border-radius: 50%;
}

.score-text {
    position: relative;
    z-index: 1;
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
}

.results-details {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.result-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    min-width: 120px;
}

.result-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.result-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.feedback {
    text-align: right;
    margin-bottom: 30px;
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.feedback-item {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
}

.feedback-item.correct {
    background-color: #d4f8d4;
    border-right: 3px solid #28a745;
}

.feedback-item.incorrect {
    background-color: #f8d4d4;
    border-right: 3px solid #dc3545;
}

.results-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* فئات مساعدة */
.hidden {
    display: none;
}

/* تصميم متجاوب */
@media (max-width: 768px) {
    .tests-list {
        grid-template-columns: 1fr;
    }
    
    .quiz-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .progress-container {
        width: 100%;
        margin-top: 15px;
    }
    
    .quiz-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .control-btn {
        width: 100%;
    }
    
    .results-details {
        flex-direction: column;
        align-items: center;
    }
}