:root { --primary: #4834d4; --bg: #f8f9fd; }
body { font-family: 'Segoe UI', sans-serif; background: var(--bg); direction: rtl; margin: 0; user-select: none; }
.container { max-width: 500px; margin: 0 auto; padding: 15px; }

/* التعديل الجديد: أيقونة القلم في الزاوية */
.question-item { 
    aspect-ratio: 1/1; background: #fff; border-radius: 20px; display: flex; 
    align-items: center; justify-content: center; font-size: 1.6rem; font-weight: bold; 
    position: relative; border-bottom: 5px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.05); 
}
.q-edit { 
    position: absolute; top: 8px; left: 8px; font-size: 0.9rem; 
    color: var(--primary); background: #f0f0ff; padding: 5px; border-radius: 8px; 
}

/* التعديل الجديد: الحفاظ على تنسيق الأسطر */
.quiz-text-area { 
    line-height: 2.5; font-size: 1.3rem; 
    white-space: pre-wrap; /* هذا السطر هو المسؤول عن إظهار الأسطر كما كتبتها */
    word-wrap: break-word;
}

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

/* بقية التنسيقات المحسنة */
.chips-row { display: flex; gap: 8px; margin: 10px 0; }
.chip-opt, .status-opt { flex: 1; cursor: pointer; }
.chip-opt input, .status-opt input { display: none; }
.chip-opt span, .status-opt span { display: block; padding: 12px 5px; text-align: center; background: #fff; border-radius: 12px; border: 2px solid #eee; font-weight: bold; font-size: 0.85rem; }
.chip-opt input:checked + span { background: var(--primary); color: #fff; border-color: var(--primary); }
.status-opt.green input:checked + span { background: #2ecc71; color: #fff; }
.status-opt.yellow input:checked + span { background: #f1c40f; color: #fff; }
.status-opt.red input:checked + span { background: #e74c3c; color: #fff; }

.word-gap { display: inline-block; min-width: 60px; border-bottom: 2px solid #ccc; margin: 0 5px; color: transparent; background: #eee; border-radius: 4px; height: 1.2em; vertical-align: middle; }
.word-gap.filled { color: var(--primary); border-bottom-color: #2ecc71; background: transparent; font-weight: bold; }

.fab-btn { position: fixed; bottom: 30px; left: 30px; width: 60px; height: 60px; border-radius: 50%; background: var(--primary); color: #fff; border: none; font-size: 1.5rem; box-shadow: 0 10px 20px rgba(0,0,0,0.1); cursor: pointer; z-index: 10; }
.primary-btn { background: var(--primary); color: #fff; border: none; padding: 16px; border-radius: 15px; width: 100%; font-weight: bold; cursor: pointer; margin-top: 10px; }
.hidden { display: none !important; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-content { background: #fff; padding: 25px; border-radius: 20px; width: 85%; }
.color-picker { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 15px 0; }
.c-box span { display: block; width: 35px; height: 35px; border-radius: 50%; border: 3px solid transparent; }
.c-box input:checked + span { border-color: #000; }
