/* المتغيرات والأساسيات */
:root { 
    --primary: #4834d4; 
    --bg: #f8f9fd; 
    --text: #2d3436;
}

body { 
    font-family: 'Segoe UI', Tahoma, sans-serif; 
    background: var(--bg); 
    direction: rtl; 
    margin: 0; 
    user-select: none; /* منع تحديد النص لتحسين تجربة اللمس */
    color: var(--text);
}

.container { max-width: 500px; margin: 0 auto; padding: 15px; }

/* شريط التنقل */
.top-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 25px; padding: 10px 5px; }
.back-circle-btn { width: 40px; height: 40px; border-radius: 50%; border: none; background: #fff; cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
#nav-title { font-weight: bold; font-size: 1.2rem; }
.score-badge { background: var(--primary); color: #fff; padding: 5px 12px; border-radius: 20px; font-weight: bold; font-size: 0.9rem; }

/* واجهة الخيارات الاحترافية (Chips) */
.difficulty-chips, .status-selector { 
    display: flex; 
    gap: 8px; 
    margin: 10px 0 20px 0; 
}
.chip, .status-opt { flex: 1; cursor: pointer; }
.chip input, .status-opt input { display: none; } /* إخفاء زر الراديو التقليدي */

.chip span, .status-opt .opt-content { 
    display: block; 
    padding: 14px 5px; 
    text-align: center; 
    background: #fff; 
    border-radius: 15px; 
    font-weight: bold; 
    border: 2px solid #edf2f7; 
    transition: 0.3s all cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
}

/* تأثيرات الاختيار النشط */
.chip input:checked + span { 
    background: var(--primary); 
    color: #fff; 
    border-color: var(--primary); 
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 52, 212, 0.2);
}

.status-opt.green input:checked + .opt-content { background: #2ecc71; color: #fff; border-color: #2ecc71; }
.status-opt.yellow input:checked + .opt-content { background: #f1c40f; color: #fff; border-color: #f1c40f; }
.status-opt.red input:checked + .opt-content { background: #e74c3c; color: #fff; border-color: #e74c3c; }

/* المربعات الرقمية للأسئلة */
.questions-numbers-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.question-item { 
    aspect-ratio: 1/1; 
    background: #fff; 
    border-radius: 24px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    position: relative; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.04); 
    border-bottom: 5px solid #ddd;
    transition: 0.2s;
}
.question-item:active { transform: scale(0.95); }
.question-item b { font-size: 1.6rem; color: #444; }

/* ألوان الحالة في الأسئلة */
.q-green { border-bottom-color: #2ecc71; }
.q-yellow { border-bottom-color: #f1c40f; }
.q-red { border-bottom-color: #e74c3c; }

/* واجهة التمرين */
.quiz-box { background: #fff; padding: 25px; border-radius: 30px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
.quiz-text-area { line-height: 3; font-size: 1.25rem; margin-top: 15px; }
.word-gap { 
    display: inline-block; 
    min-width: 70px; 
    height: 35px; 
    background: #f1f2f6; 
    border-bottom: 3px solid #ced4da; 
    margin: 0 6px; 
    vertical-align: middle; 
    border-radius: 10px; 
    color: transparent; 
}
.word-gap.filled { 
    color: var(--primary); 
    background: transparent; 
    border-bottom-color: #2ecc71; 
    font-weight: bold; 
    animation: popIn 0.3s ease;
}

/* أزرار الكلمات */
.word-pool-area { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 35px; justify-content: center; }
.word-card { 
    padding: 14px 20px; 
    background: #fff; 
    border: 2px solid #edf2f7; 
    border-radius: 18px; 
    font-weight: bold; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    cursor: pointer;
}

/* زر الحفظ والعناصر العائمة */
.primary-btn { 
    background: var(--primary); 
    color: #fff; 
    border: none; 
    padding: 18px; 
    border-radius: 18px; 
    width: 100%; 
    font-weight: bold; 
    font-size: 1.1rem; 
    cursor: pointer; 
    box-shadow: 0 8px 20px rgba(72, 52, 212, 0.2);
}

.fab-btn { 
    position: fixed; 
    bottom: 30px; 
    left: 30px; 
    width: 65px; 
    height: 65px; 
    border-radius: 50%; 
    background: var(--primary); 
    color: #fff; 
    border: none; 
    font-size: 1.6rem; 
    box-shadow: 0 10px 25px rgba(72, 52, 212, 0.4);
    display: flex; align-items: center; justify-content: center;
}

/* أنيميشن */
@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.hidden { display: none !important; }
