/* QBank Professional Modern Stylesheet 
   Clean, Professional, and Medical-App Oriented
*/

/* 1. Base Container & Typography */
#qbank-app-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    max-width: 1100px;
    margin: 20px auto;
    direction: ltr; /* English Orientation */
    text-align: left;
    color: #374151;
}

.hidden-view {
    display: none !important;
}

/* 2. Selection View (Initial Screen) */
.qb-view h2 {
    font-weight: 500;
    color: #111827;
    margin-bottom: 25px;
}

.qb-system-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.qb-system-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    padding: 15px 20px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.qb-system-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.qb-question-input {
    width: 65px;
    padding: 6px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    text-align: center;
    font-size: 0.9rem;
}

/* 3. Quiz View & Main Layout */
#qb-quiz-view {
    position: relative;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    min-height: 600px;
    display: flex;
    flex-direction: column;
}

/* Top & Bottom Bars */
#qb-header-top, #qb-footer-bottom {
    background: #ffffff;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

#qb-header-top { border-bottom: 1px solid #f3f4f6; }
#qb-footer-bottom { border-top: 1px solid #f3f4f6; }

/* 4. Sidebars */
.qb-sidebar {
    position: absolute;
    top: 0;
    width: 300px;
    height: 100%;
    background: #ffffff;
    z-index: 100;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 24px;
    overflow-y: auto;
}

/* Sidebar Directions for LTR */
#qb-left-sidebar { left: 0; transform: translateX(-100%); border-right: 1px solid #eee; }
#qb-left-sidebar.open { transform: translateX(0); }

#qb-right-sidebar { right: 0; transform: translateX(100%); border-left: 1px solid #eee; }
#qb-right-sidebar.open { transform: translateX(0); }

/* Navigation List in Sidebar */
#qb-question-nav-list ul {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 0;
    list-style: none;
}

#qb-question-nav-list li {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: 0.2s;
}

#qb-question-nav-list li.current { background: #3b82f6; color: white; }
#qb-question-nav-list li.answered-correct { background: #d1fae5; color: #065f46; }
#qb-question-nav-list li.answered-wrong { background: #fee2e2; color: #991b1b; }
#qb-question-nav-list li.flagged-item { border: 2px solid #ef4444; }

/* 5. Question Body & Options */
#qb-question-body {
    padding: 40px;
    flex-grow: 1;
    background: #ffffff;
}

#qb-question-text {
    font-size: 1.2rem;
    font-weight: 400; /* Modern, non-bold */
    line-height: 1.7;
    color: #111827;
    margin-bottom: 30px;
}

.qb-option {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    padding: 16px 20px;
    margin-bottom: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 400;
    color: #4b5563;
}

.qb-option:hover {
    border-color: #3b82f6;
    background: #f9fafb;
}

/* Option Coloring Logic */
.qb-option.correct-key, .qb-option.selected-correct {
    background-color: #ecfdf5 !important;
    border-color: #10b981 !important;
    color: #065f46 !important;
}

.qb-option.selected-wrong {
    background-color: #fef2f2 !important;
    border-color: #ef4444 !important;
    color: #991b1b !important;
}

/* 6. Icons & Buttons */
.qb-icon-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #6b7280;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
}

.dashicons-flag.flagged {
    color: #ef4444 !important;
}

.qb-nav-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.qb-nav-btn:hover { background: #2563eb; }

.qb-danger-btn {
    background: #ffffff;
    color: #ef4444;
    border: 1px solid #fecaca;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
}

.qb-danger-btn:hover { background: #fef2f2; }

/* Explanation Area */
#qb-explanation-area {
    margin-top: 25px;
    background: #eff6ff;
    padding: 20px;
    border-left: 4px solid #3b82f6;
    border-radius: 8px;
    color: #1e40af;
    font-size: 0.95rem;
}
/* تنسيق أيقونة العلم */
.dashicons.dashicons-flag {
    font-family: dashicons;
    display: inline-block;
    width: 20px;
    height: 20px;
    font-size: 24px; /* تكبير الأيقونة قليلاً */
    line-height: 1;
    color: #9ca3af; /* لون رمادي هادئ */
    transition: color 0.2s ease;
    vertical-align: middle;
}

/* لون العلم عندما يكون مفعل (Flagged) */
.dashicons.dashicons-flag.flagged {
    color: #ef4444 !important; /* اللون الأحمر */
}
/* 7. Question Image Styling (Added for Medical Images) */

/* الحاوية التي تضمن توسيط الصورة وعدم خروجها عن الإطار */
/* 7. Question Image Styling - Centered & Professional */

#qb-question-image-wrapper {
    max-width: 500px;         /* يمكنك تقليله لـ 400px لو أردتها أصغر */
    margin: 20px auto 30px auto; /* auto من اليمين واليسار تضمن التوسط */
    display: block;           /* التأكد أن الحاوية تعامل كـ block ليعمل التوسط */
    overflow: hidden;         
    border-radius: 12px;      
    border: 1px solid #e5e7eb;
    background-color: #f9fafb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

#qb-question-img {
    width: 100%;              
    height: 300px;            /* الارتفاع للـ Crop */
    object-fit: cover;        
    object-position: center;  
    display: block;           /* يمنع وجود مسافات فارغة تحت الصورة */
    margin: 0 auto;           /* تأكيد التوسط داخل الحاوية */
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

#qb-question-img:hover {
    transform: scale(1.05);
}


/* استجابة الشاشات الصغيرة (Mobile) */
@media (max-width: 600px) {
    #qb-question-img {
        height: 250px;        /* تقليل الارتفاع في الموبايل لترك مساحة للخيارات */
    }
}

#qb-timer {
    font-family: 'Courier New', Courier, monospace; /* خط رقمي */
    font-weight: bold;
    color: #ef4444; /* لون أحمر لينتبه الطالب للوقت */
    background: #fef2f2;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #fecaca;
}
.lab-section {
    margin-bottom: 20px;
}

.lab-section-title {
    background: #f3f4f6;
    padding: 5px 10px;
    font-size: 14px;
    font-weight: bold;
    color: #1f2937;
    border-radius: 4px;
    margin-bottom: 8px;
    border-left: 3px solid #3b82f6;
}

.lab-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    font-size: 13px;
    border-bottom: 1px solid #f9fafb;
    transition: background 0.2s;
}

.lab-item:hover {
    background: #eff6ff;
}

.lab-item span:last-child {
    font-weight: 500;
    color: #4b5563;
}

/* شريط البحث */
#qb-lab-search:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.qb-results-grid div {
    transition: transform 0.3s ease;
}

.qb-results-grid div:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

#qb-end-view h2 {
    font-size: 2.5rem;
    background: linear-gradient(to right, #3b82f6, #1d4ed8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* جعل الزر لا يظهر خلفية عند الضغط */
/* الطبقة المظلمة التي تظهر عند الضغط */