/* إعدادات عامة */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans Arabic', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    direction: rtl;
    text-align: right;
    color: #333;
    overflow-x: hidden;
}

.container {
    position: relative;
    width: 100%;
    min-height: 100vh;
}

/* شاشات البرنامج */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.5s ease-in-out;
}

.screen.active {
    opacity: 1;
    transform: translateX(0);
}

/* شاشة البداية */
#start-screen .welcome-content {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 600px;
    backdrop-filter: blur(10px);
}

#start-screen h1 {
    color: #4a5568;
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

#start-screen h2 {
    color: #667eea;
    font-size: 1.5em;
    margin-bottom: 20px;
}

#start-screen p {
    font-size: 1.2em;
    line-height: 1.6;
    margin-bottom: 30px;
    color: #666;
}

.instructions {
    background: #f7fafc;
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    border-right: 4px solid #667eea;
}

.instructions h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.instructions ul {
    list-style: none;
    padding-right: 20px;
}

.instructions li {
    margin-bottom: 10px;
    font-size: 1.1em;
    color: #666;
    position: relative;
}

.instructions li::before {
    content: "✓";
    position: absolute;
    right: -20px;
    color: #48bb78;
    font-weight: bold;
}

/* الأزرار */
.btn {
    padding: 15px 30px;
    font-size: 1.2em;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans Arabic', Arial, sans-serif;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

/* شاشة اللعبة */
#game-screen {
    padding: 20px;
    flex-direction: column;
}

.game-header {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.progress-container {
    flex: 1;
    margin-left: 20px;
}

.progress-bar {
    background: #e2e8f0;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    background: linear-gradient(45deg, #48bb78, #38a169);
    height: 100%;
    width: 0%;
    transition: width 0.5s ease;
}

.question-counter {
    font-size: 1.1em;
    font-weight: 600;
    color: #4a5568;
}

.score-display {
    font-size: 1.2em;
    font-weight: 600;
    color: #667eea;
}

/* محتوى السؤال */
.question-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    max-width: 800px;
    width: 100%;
}

.image-container {
    text-align: center;
    margin-bottom: 30px;
}

#question-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    object-fit: cover;
}

.question-content h3 {
    font-size: 1.4em;
    margin-bottom: 20px;
    color: #4a5568;
    text-align: center;
}

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

.option-btn {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: #f7fafc;
    border: 3px solid #e2e8f0;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans Arabic', Arial, sans-serif;
    font-size: 1.1em;
    text-align: right;
}

.option-btn:hover {
    background: #edf2f7;
    border-color: #667eea;
    transform: translateX(-5px);
}

.option-btn.selected {
    background: #667eea;
    color: white;
    border-color: #5a67d8;
}

.option-btn.correct {
    background: #48bb78;
    color: white;
    border-color: #38a169;
}

.option-btn.incorrect {
    background: #f56565;
    color: white;
    border-color: #e53e3e;
}

.option-letter {
    background: #667eea;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 15px;
    font-weight: bold;
}

.option-btn.selected .option-letter,
.option-btn.correct .option-letter {
    background: rgba(255, 255, 255, 0.2);
}

.option-text {
    flex: 1;
}

/* شاشة المراجعة */
.feedback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.feedback-overlay.show {
    opacity: 1;
    visibility: visible;
}

.feedback-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.feedback-overlay.show .feedback-content {
    transform: scale(1);
}

.feedback-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.feedback-content h3 {
    font-size: 2em;
    margin-bottom: 15px;
    color: #4a5568;
}

.feedback-content p {
    font-size: 1.2em;
    line-height: 1.6;
    color: #666;
    margin-bottom: 30px;
}

.hidden {
    display: none;
}

/* شاشة النتائج */
#result-screen .result-content {
    background: rgba(255, 255, 255, 0.95);
    padding: 50px;
    border-radius: 25px;
    text-align: center;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.result-icon {
    font-size: 5em;
    margin-bottom: 20px;
}

#result-title {
    font-size: 2.5em;
    margin-bottom: 30px;
    color: #4a5568;
}

.result-stats {
    display: flex;
    justify-content: space-around;
    margin: 40px 0;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 3em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 1.2em;
    color: #666;
}

.result-message {
    font-size: 1.3em;
    line-height: 1.6;
    color: #4a5568;
    margin-bottom: 30px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 15px;
}

/* تصميم متجاوب */
@media (max-width: 768px) {
    .screen {
        padding: 15px;
    }
    
    #start-screen .welcome-content {
        padding: 30px 20px;
        margin: 10px;
    }
    
    #start-screen h1 {
        font-size: 2em;
    }
    
    .game-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .progress-container {
        margin-left: 0;
        width: 100%;
    }
    
    .question-container {
        padding: 20px;
        margin: 10px;
    }
    
    #question-image {
        max-height: 200px;
    }
    
    .result-stats {
        flex-direction: column;
        gap: 20px;
    }
    
    .feedback-content {
        padding: 30px 20px;
        margin: 20px;
    }
    
    #result-screen .result-content {
        padding: 30px 20px;
        margin: 10px;
    }
}

@media (max-width: 480px) {
    #start-screen h1 {
        font-size: 1.8em;
    }
    
    #start-screen h2 {
        font-size: 1.2em;
    }
    
    .question-content h3 {
        font-size: 1.2em;
    }
    
    .option-btn {
        padding: 12px 15px;
        font-size: 1em;
    }
    
    .btn {
        padding: 12px 25px;
        font-size: 1.1em;
    }
}