/* ===== أفكار القدرات — Sidebar ===== */

/* ── هيكلة الـ sidebar ── */
.lms-topic-sidebar-data {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* ── الجزء الثابت ── */
.aq-sidebar-fixed {
    flex-shrink: 0;
    background: var(--bb-sidebar-bg, #fff);
    border-bottom: 1px solid rgba(0,0,0,0.07);
    z-index: 20;
}

/* ── الجزء المتغير يـ scroll ── */
.lms-lessions-list,
.lms-course-quizzes-list,
.lms-course-members-list,
.ld-sidebar-widgets {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* ── إخفاء المستطيل الرصاصي (course navigation القديم) ── */
.lms-topic-sidebar-course-navigation {
    display: none !important;
}

/* ── أدوات الهيدر ── */
.bb-elementor-header-items {
    padding: 6px 12px 2px;
}

/* ── رابط الرئيسية ── */
.aq-home-link-wrap {
    padding: 2px 14px 2px;
}

.aq-home-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #666;
    font-family: 'Tajawal', sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s;
}

.aq-home-link:hover {
    color: #2ABFAB;
    text-decoration: none;
}

/* ── Switcher ── */
#aq-ld-switcher {
    padding: 4px 12px 4px;
}

.aq-sw-row {
    display: flex;
    gap: 0;
    margin-bottom: 5px;
    background: #f0f0f0;
    border-radius: 22px;
    padding: 3px;
}

.aq-sw-row:last-child {
    margin-bottom: 0;
}

.aq-sw-btn {
    flex: 1;
    display: block;
    padding: 6px 10px;
    border-radius: 20px;
    background: transparent;
    color: #777;
    font-family: 'Tajawal', sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
    transition: all 0.18s ease;
    cursor: pointer;
    border: none;
    outline: none;
}

.aq-sw-btn:hover { color: #444; }

.aq-sw-btn--active {
    background: #fff;
    color: #2ABFAB;
    font-weight: 700;
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
    pointer-events: none;
}

.aq-sw-btn--loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ── معلومات الدورة (اسم + تقدم + نشاط) ── */
.aq-course-info-wrap {
    padding: 4px 14px 4px;
    border-top: 1px solid rgba(0,0,0,0.06);
    margin-top: 4px;
}

#aq-course-title {
    display: block;
    font-family: 'Tajawal', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #444;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

/* تقليص مسافات شريط التقدم */
#aq-course-progress .course-progress-wrap {
    margin: 0 !important;
    padding: 0 !important;
}

#aq-course-progress .bb-progress-wrap,
#aq-course-progress .ld-progress {
    margin: 2px 0 !important;
}

/* ── آخر نشاط ── */
.aq-last-activity {
    font-family: 'Tajawal', sans-serif;
    font-size: 11px;
    color: #999;
    margin-top: 1px;
}

/* ── skeleton loading ── */
.aq-nav-loading {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.aq-nav-loading-item {
    height: 36px;
    background: linear-gradient(90deg,#f0f0f0 25%,#e8e8e8 50%,#f0f0f0 75%);
    background-size: 200% 100%;
    border-radius: 8px;
    animation: aq-shimmer 1.2s infinite;
}

@keyframes aq-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── هيدر LearnDash Focus Mode فقط ── */
.ld-in-focus-mode #masthead,
.ld-in-focus-mode .site-header {
    height: 56px !important;
    min-height: 56px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.ld-in-focus-mode #masthead .site-logo img,
.ld-in-focus-mode .site-header .site-logo img,
.ld-in-focus-mode #masthead .custom-logo {
    max-height: 34px !important;
    width: auto !important;
}

.ld-in-focus-mode .lms-topic-sidebar-data {
    top: 56px !important;
    max-height: calc(100vh - 56px) !important;
}

.ld-in-focus-mode .lms-topic-sidebar-wrapper,
.ld-in-focus-mode #learndash-page-content {
    top: 56px !important;
    height: calc(100vh - 56px) !important;
}

/* ── Dark Mode ── */
.bb-dark-theme .aq-sidebar-fixed,
[data-bb-theme-dark-mode="on"] .aq-sidebar-fixed {
    background: #1e1e1e;
    border-bottom-color: rgba(255,255,255,0.08);
}

.bb-dark-theme .aq-sw-row,
[data-bb-theme-dark-mode="on"] .aq-sw-row {
    background: rgba(255,255,255,0.08);
}

.bb-dark-theme .aq-sw-btn,
[data-bb-theme-dark-mode="on"] .aq-sw-btn { color: #999; }

.bb-dark-theme .aq-sw-btn--active,
[data-bb-theme-dark-mode="on"] .aq-sw-btn--active {
    background: rgba(255,255,255,0.12);
    color: #2ABFAB;
    box-shadow: none;
}

.bb-dark-theme #aq-course-title,
[data-bb-theme-dark-mode="on"] #aq-course-title { color: #bbb; }

.bb-dark-theme .aq-home-link,
[data-bb-theme-dark-mode="on"] .aq-home-link { color: #999; }

/* ── Mobile ── */
@media (max-width: 768px) {
    .aq-sw-btn { font-size: 12px; padding: 5px 8px; }
    .aq-home-link { font-size: 12px; }
}


/* =======================================================
   أفكار القدرات — هوية القائمة الجانبية v1.6
   CSS بصري فقط — لا يمس JS أو localStorage أو روابط
   ======================================================= */


/* ── Scrollbar ── */
.lms-lessions-list::-webkit-scrollbar,
.lms-course-quizzes-list::-webkit-scrollbar        { width: 5px; }
.lms-lessions-list::-webkit-scrollbar-track,
.lms-course-quizzes-list::-webkit-scrollbar-track   { background: #f5f5f5; }
.lms-lessions-list::-webkit-scrollbar-thumb,
.lms-course-quizzes-list::-webkit-scrollbar-thumb   { background: #2ABFAB; border-radius: 4px; }
.lms-lessions-list::-webkit-scrollbar-thumb:hover,
.lms-course-quizzes-list::-webkit-scrollbar-thumb:hover { background: #1a9e8d; }


/* ══════════════════════════════════════════════════════
   عناوين الأقسام — المشكلة الجذرية:
   section heading يُدرج داخل <li class="lms-lesson-item">
   أي أن الـ <li> نفسه يعطي padding وخلفية بيضاء حول العنوان.
   الحل: نصفّر الـ <li> الحاوي للـ section heading كلياً،
   ثم نطبق الهوية مباشرة على section heading وعناصره.
   ══════════════════════════════════════════════════════ */

/* ── حذف النقطة الرصاصية من القائمة كاملاً ── */
.bb-lessons-list,
.bb-lessons-list ol,
.bb-lessons-list ul {
    list-style: none !important;
    padding-right: 0 !important;
    margin: 0 !important;
}
.bb-lessons-list .lms-lesson-item {
    list-style: none !important;
}
.bb-lessons-list .lms-lesson-item::before,
.bb-lessons-list .lms-lesson-item::after,
.bb-lessons-list ol::before,
.bb-lessons-list ol::after {
    display: none !important;
    content: none !important;
}

/* ── تصفير الـ <li> الحاوي لعنوان القسم ──
   بدلاً من :has() نستهدف الـ li الذي ليس فيه .bb-lesson-head
   لأن الدروس العادية دائماً تحتوي .bb-lesson-head
   بينما الـ li الحاوي للـ section heading لا يحتويه */
.bb-lessons-list .lms-lesson-item:not(:has(.bb-lesson-head)) {
    background: transparent !important;
    border-bottom: none !important;
    border-top: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    margin-top: 14px !important;
}

/* ── الحاوية الخارجية للعنوان — هوية كاملة ── */
.bb-lessons-list .ld-lesson-section-heading,
.bb-lessons-list .ld-item-list-section-heading {
    background: #F3FBFA !important;
    color: #149C90 !important;
    border-right: 3px solid #2ABFAB !important;
    border-top: 1px solid #d0eeea !important;
    border-bottom: 1px solid #d0eeea !important;
    border-left: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    margin: 0 !important;
    /* margin-top سالب يغطي border-bottom الدرس السابق ويحذفه بصرياً */
    margin-top: -1px !important;
    padding: 0 !important;
    display: block !important;
}

/* 3. تصفير الـ div الداخلي — هنا مصدر المربع */
.bb-lessons-list .ld-lesson-section-heading > *,
.bb-lessons-list .ld-item-list-section-heading > * {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 8px 14px !important;
    display: block !important;
}

/* 4. تصفير pseudo-elements — سبب آخر للمربع */
.bb-lessons-list .ld-lesson-section-heading *::before,
.bb-lessons-list .ld-lesson-section-heading *::after,
.bb-lessons-list .ld-item-list-section-heading *::before,
.bb-lessons-list .ld-item-list-section-heading *::after {
    display: none !important;
}

/* 5. نص العنوان */
.bb-lessons-list .ld-lesson-section-heading * ,
.bb-lessons-list .ld-item-list-section-heading * {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #149C90 !important;
    background: transparent !important;
    border: none !important;
    font-family: 'Tajawal', sans-serif !important;
    letter-spacing: 0.3px;
}

/* ── لفظي: عكس الألوان ── */
.aq-verbal .bb-lessons-list .ld-lesson-section-heading,
.aq-verbal .bb-lessons-list .ld-item-list-section-heading {
    background: #FFF5F1 !important;
    border-right-color: #E8674A !important;
    border-top-color: #f5d5cd !important;
    border-bottom-color: #f5d5cd !important;
}

.aq-verbal .bb-lessons-list .ld-lesson-section-heading *,
.aq-verbal .bb-lessons-list .ld-item-list-section-heading * {
    color: #D06A4D !important;
}


/* ══════════════════════════════════════════════════════
   المستوى الثاني — الدرس (كمّي ولفظي: أبيض)
   ══════════════════════════════════════════════════════ */

.bb-lessons-list .lms-lesson-item {
    background: #ffffff !important;
    border-bottom: 1px solid #eeeeee !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.bb-lessons-list .lms-lesson-item .bb-lesson-head {
    padding: 10px 14px 10px 16px;
    background: #ffffff;
    transition: background 0.15s;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.bb-lessons-list .lms-lesson-item .bb-lesson-head:hover {
    background: #f9f9f9;
    text-decoration: none;
}

.bb-lessons-list .bb-lesson-title {
    font-size: 13px;
    font-weight: 600;
    color: #4B5563;
    font-family: 'Tajawal', sans-serif;
    transition: color 0.15s;
}

.bb-lessons-list .lms-lesson-item .bb-lesson-head:hover .bb-lesson-title {
    color: #374151;
}

.bb-lesson-head .bb-lesson-topics-count {
    font-size: 11px;
    color: #9CA3AF;
    font-family: 'Tajawal', sans-serif;
}

/* هامش جانبي للآيباد وضيق الشاشة */
@media (max-width: 1024px) {
    .bb-lessons-list {
        padding-inline: 10px;
    }
}

/* هامش خفيف يمين القائمة على كل الشاشات */
.bb-lessons-list {
    padding-right: 10px;
    box-sizing: border-box;
}


/* ══════════════════════════════════════════════════════
   المستوى الثالث — الموضوع (محايد خفيف)
   ══════════════════════════════════════════════════════ */

.lms-lesson-content {
    background: #F7F8FA;
}

.lms-lesson-content li {
    border-bottom: 1px solid #ebedf0 !important;
    background: #F7F8FA !important;
    margin: 0 !important;
}

.lms-lesson-content li:last-child {
    border-bottom: none !important;
}

.lms-topic-item a.bb-lms-title-wrap,
.lms-topic-item .bb-lms-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px 9px 16px;
    padding-right: 28px;
    font-size: 12px;
    font-weight: 500;
    color: #75808E;
    text-decoration: none;
    border-right: 3px solid transparent;
    transition: background 0.15s, color 0.15s, border-right-color 0.15s;
    font-family: 'Tajawal', sans-serif;
}

.lms-topic-item a.bb-lms-title-wrap:hover,
.lms-topic-item .bb-lms-title-wrap:hover {
    background: #EEF2F3;
    color: #4B5563;
    text-decoration: none;
}


/* ══════════════════════════════════════════════════════
   العنصر الحالي (current)
   ══════════════════════════════════════════════════════ */

.lms-topic-item.current {
    border: none !important;
    border-radius: 0 !important;
    outline: none !important;
    box-shadow: none !important;
}

/* كمّي: برتقالي فاتح */
.lms-topic-item.current a.bb-lms-title-wrap,
.lms-topic-item.current .bb-lms-title-wrap {
    background: #FFF4F0 !important;
    color: #D06A4D !important;
    border-right: 3px solid #E8674A !important;
    font-weight: 600 !important;
}

/* لفظي: تركواز فاتح */
.aq-verbal .lms-topic-item.current a.bb-lms-title-wrap,
.aq-verbal .lms-topic-item.current .bb-lms-title-wrap {
    background: #F3FBFA !important;
    color: #149C90 !important;
    border-right-color: #2ABFAB !important;
}


/* ══════════════════════════════════════════════════════
   الدرس الحالي — aq-last-visited (يضيفه JS)
   ══════════════════════════════════════════════════════ */

/* كمّي */
.bb-lessons-list .aq-last-visited {
    background: #FFF4F0 !important;
    border-right: 3px solid #E8674A !important;
}
.bb-lessons-list .aq-last-visited .bb-lesson-title {
    color: #D06A4D !important;
    font-weight: 700 !important;
}

/* لفظي */
.aq-verbal .bb-lessons-list .aq-last-visited {
    background: #F3FBFA !important;
    border-right-color: #2ABFAB !important;
}
.aq-verbal .bb-lessons-list .aq-last-visited .bb-lesson-title {
    color: #149C90 !important;
}

/* ── سهم الدرس: transition ناعم عند الفتح/الإغلاق ── */
.lms-toggle-lesson i {
    display: inline-block;
    transition: transform 0.25s ease;
}
.lms-toggle-lesson.is-open i {
    transform: rotate(180deg);
}
