.watch-partial-loading {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.54);
    backdrop-filter: blur(2px);
    pointer-events: all;
}

.watch-partial-loading.is-active {
    display: flex;
}

.watch-partial-loading__box {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    max-width: min(92vw, 360px);
    padding: 0.85rem 1rem;
    border: 1px solid rgba(182, 0, 0, 0.18);
    border-radius: 999px;
    color: #7f1d1d;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
    font-weight: 700;
    text-align: center;
}

.watch-partial-loading__spinner {
    width: 1.35rem;
    height: 1.35rem;
    flex: 0 0 auto;
    border: 3px solid rgba(182, 0, 0, 0.18);
    border-top-color: #b60000;
    border-radius: 50%;
    animation: watch-partial-loading-spin 0.7s linear infinite;
}

.course-lesson-content-link.is-partial-loading {
    pointer-events: none;
    opacity: 0.72;
}

.course-lesson-content-link.is-partial-loading::after {
    content: "";
    width: 1rem;
    height: 1rem;
    margin-inline-start: 0.5rem;
    flex: 0 0 auto;
    border: 2px solid rgba(182, 0, 0, 0.2);
    border-top-color: #b60000;
    border-radius: 50%;
    animation: watch-partial-loading-spin 0.7s linear infinite;
}

@keyframes watch-partial-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Embedded lesson content: Google Forms, Wordwall, and generic iframe embeds. */
.embed-container {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    background-color: #fdeaea;
    border: 3px solid #b60000;
    border-radius: 10px;
    padding: 8px;
    box-shadow: none;
}

.responsive-iframe {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 6px;
}

.mobile-embed-scroll-host {
    position: relative;
}

.mobile-embed-scroll-guard,
.mobile-page-scroll-rail {
    display: none;
}

@media (max-width: 767.98px) {
    .mobile-embed-scroll-host.mobile-embed-scroll-host--guard-active .mobile-embed-scroll-guard {
        position: absolute;
        inset: 0;
        z-index: 5;
        display: block;
        background: transparent;
        touch-action: pan-y;
    }

    .mobile-embed-scroll-host.mobile-embed-scroll-host--interactive .mobile-embed-scroll-guard {
        pointer-events: none;
    }

    [data-watch-page-root] .mobile-page-scroll-rail {
        display: contents;
    }

    html.watch-mobile-scroll-dragging {
        overscroll-behavior-y: none;
        scroll-behavior: auto !important;
    }

    .mobile-page-scroll-rail__track {
        position: fixed;
        inset-inline-end: 0;
        top: var(--watch-mobile-scroll-rail-top, 3.5rem);
        bottom: env(safe-area-inset-bottom, 0px);
        width: 1.5rem;
        margin: 0;
        padding: 0;
        z-index: 1050;
        pointer-events: auto;
        touch-action: none;
        cursor: grab;
        appearance: none;
        -webkit-appearance: none;
        border: none;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        contain: layout style;
    }

    .mobile-page-scroll-rail__edge {
        position: absolute;
        inset-inline-end: 0;
        top: 0;
        bottom: 0;
        width: 2px;
        margin: 0;
        padding: 0;
        background: #b60000;
        pointer-events: none;
    }

    .mobile-page-scroll-rail__track.is-dragging {
        cursor: grabbing;
    }

    .mobile-page-scroll-rail__track.is-dragging .mobile-page-scroll-rail__grip {
        transform: scale(1.05);
    }

    .mobile-page-scroll-rail__grip {
        position: absolute;
        top: 0;
        inset-inline-end: 2px;
        transform: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.28rem;
        width: 1.35rem;
        padding: 0.7rem 0.15rem;
        background: #b60000;
        border-radius: 0.55rem 0 0 0.55rem;
        box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
        pointer-events: none;
    }

    .mobile-page-scroll-rail__grip-bar {
        display: block;
        width: 0.9rem;
        height: 0.2rem;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.95);
    }
}

.embed-container.embed-wordwall-container {
    width: 100% !important;
    max-width: 100% !important;
    height: 800px !important;
    min-width: 0;
    border: none !important;
    background-color: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.embed-container.embed-wordwall-container .responsive-iframe {
    height: 100%;
}

@media screen and (max-width: 991.98px) {
    .embed-container.embed-wordwall-container {
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media screen and (max-width: 767px) {
    .embed-container.embed-wordwall-container {
        height: 450px !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media screen and (max-width: 575px) {
    .embed-container.embed-wordwall-container {
        height: 500px !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

.embed-container.embed-wordwall {
    position: relative;
    padding-top: 56.25%;
    height: 0;
}

.embed-container.embed-wordwall .responsive-iframe {
    position: absolute;
    inset: 0;
    height: 100%;
}

.embed-container.embed-gform {
    height: auto;
}

.embed-container.embed-gform .responsive-iframe {
    min-height: 1700px;
}

@media (max-width: 768px) {
    .embed-container.embed-gform .responsive-iframe {
        min-height: 1900px;
    }

    [data-watch-page-root]:has(#embeddedForm) .embed-container.embed-gform {
        touch-action: pan-y;
    }
}

.course-view-box.course-view-box--two.box--embed {
    border: none;
    background: transparent;
    padding: 0;
    min-width: 0;
}

/* Watch page layout rules extracted from the Blade template. */
/* زر الدرس الحالي: "الدرس الحالي:" ثابت، واسم الدرس يُقصّ بالـ ... إن طال */
.btn-current-lesson {
    min-width: 0;
    text-align: start;
}
.btn-current-lesson__inner {
    display: flex;
    align-items: center;
    min-width: 0;
    overflow: hidden;
}
.btn-current-lesson__label {
    flex-shrink: 0;
}
.btn-current-lesson__title {
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Watch TTS — مربع نص عريض بارتفاع أوضح، شريط أدوات سطر واحد أسفل (#B60000) */
.watch-tts-box {
    --tts-c: #B60000;
    --tts-c-rgb: 182, 0, 0;
    margin-bottom: 1rem;
    border-radius: 14px;
    border: 1px solid rgba(var(--tts-c-rgb), 0.22);
    background: #fff;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(var(--tts-c-rgb), 0.06);
}
.watch-tts-text-wrap {
    min-height: 380px;
    max-height: 520px;
    overflow-y: auto;
    padding: 1.5rem 1.75rem;
    background: linear-gradient(180deg, #fcfcfc 0%, #f6f6f6 100%);
}
.watch-tts-text-wrap .font-readability {
    font-size: 1.35rem;
    line-height: 1.75;
    color: #2c2c2c;
    transition: font-size 0.2s ease;
}
.watch-tts-text-wrap.watch-tts-zoom-1 .font-readability { font-size: 1.35rem; }
.watch-tts-text-wrap.watch-tts-zoom-2 .font-readability { font-size: 1.55rem; }
.watch-tts-text-wrap.watch-tts-zoom-3 .font-readability { font-size: 1.8rem; }
.watch-tts-text-wrap.watch-tts-zoom-4 .font-readability { font-size: 2.05rem; }
.watch-tts-text-wrap.watch-tts-zoom-5 .font-readability { font-size: 2.4rem; }
.watch-tts-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1.25rem;
    padding: 0.6rem 1.25rem;
    background: linear-gradient(180deg, rgba(var(--tts-c-rgb), 0.12) 0%, rgba(var(--tts-c-rgb), 0.06) 100%);
    border-top: 2px solid rgba(var(--tts-c-rgb), 0.25);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.watch-tts-toolbar__group {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.watch-tts-toolbar__zoom { gap: 0.25rem; }
.watch-tts-toolbar__label {
    font-size: 0.8rem;
    color: #555;
    margin: 0;
    white-space: nowrap;
}
.watch-tts-toolbar__select {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    border: 1px solid rgba(var(--tts-c-rgb), 0.28);
    border-radius: 8px;
    background: #fff;
    color: #333;
    cursor: pointer;
    min-width: 5rem;
}
.watch-tts-toolbar__playback {
    gap: 0.5rem;
}
.watch-tts-tool-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 2px solid rgba(var(--tts-c-rgb), 0.45);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--tts-c);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.watch-tts-tool-btn i { font-size: 1.2rem; }
.watch-tts-tool-btn--stop i { font-size: 1.15rem; }
.watch-tts-tool-btn--play-pause i { font-size: 1.35rem; }
.watch-tts-tool-btn:hover:not(:disabled) {
    background: rgba(var(--tts-c-rgb), 0.1);
    border-color: var(--tts-c);
    color: #8b0000;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(var(--tts-c-rgb), 0.2);
}
.watch-tts-tool-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    color: #888 !important;
    border-color: #ccc !important;
    background: #f5f5f5 !important;
}
.watch-tts-tool-btn--stop.watch-tts-tool-btn--active,
.watch-tts-tool-btn--stop:not(:disabled) {
    color: var(--tts-c) !important;
    border-color: rgba(var(--tts-c-rgb), 0.5) !important;
    background: rgba(255, 255, 255, 0.98) !important;
}
.watch-tts-tool-btn--play-pause {
    position: relative;
}
.watch-tts-tool-btn--play-pause .watch-tts-play-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.watch-tts-tool-btn--play-pause .watch-tts-play-loading {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    align-items: flex-start;
    justify-content: center;
    padding-top: 0.35rem;
    color: var(--tts-c) !important;
}
.watch-tts-tool-btn--play-pause.is-loading .watch-tts-play-icon {
    visibility: hidden;
}
.watch-tts-tool-btn--play-pause.is-loading .watch-tts-play-loading {
    display: flex;
}
.watch-tts-toolbar__highlight {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 600;
    color: #333;
}
.watch-tts-toolbar__highlight .watch-tts-highlight-cb {
    width: 1.35rem;
    height: 1.35rem;
    min-width: 1.35rem;
    min-height: 1.35rem;
    margin: 0;
    cursor: pointer;
    accent-color: var(--tts-c);
}
.watch-tts-toolbar__highlight-label { user-select: none; text-decoration: underline; text-underline-offset: 0.2em; }
.watch-tts-toolbar__highlight-btn-wrap { display: inline-flex; align-items: center; }
.watch-tts-tool-btn--highlight { min-width: auto; padding: 0 0.6rem; }
.watch-tts-tool-btn--highlight .watch-tts-toolbar__highlight-btn-label { margin-left: 0.3rem; font-size: 0.9rem; font-weight: 600; }
.watch-tts-tool-btn.is-active { background: rgba(var(--tts-c-rgb), 0.2); border-color: var(--tts-c); color: var(--tts-c); }
.watch-tts-text { position: relative; }
.watch-tts-text .tts-word { transition: none; }
.watch-tts-text .tts-word.tts-word--active { /* يستخدم للتوصل فقط؛ الخط المرسوم بالشريط أسفل */ }
.watch-tts-underline-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 2px;
    width: 0;
    opacity: 0;
    background: var(--tts-c);
    pointer-events: none;
    transition: left 0.22s ease-out, width 0.22s ease-out, top 0.22s ease-out, opacity 0.2s ease-out;
    border-radius: 1px;
}
@media (max-width: 575px) {
    .watch-tts-toolbar { gap: 0.4rem 0.85rem; padding: 0.5rem 1rem; justify-content: space-between; }
    .watch-tts-text-wrap { min-height: 300px; max-height: 420px; padding: 1.25rem 1rem; }
}

/* الإطار الفاتح لكل الصناديق العادية */
.course-view-box.course-view-box--two {
  border: 2px solid #d46a6a;
  border-radius: 10px;
  background-color: #fff;
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: none;
}

/*  منع قصّ عناصر absolute/fixed داخل الصفحة */
.course-view-page,
.course-view-inner-left,
.main-wrapper {
    overflow: visible !important;
}

@media (max-width: 991.98px) {
  #watchMoreMenu.watch-more-list {
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }
}

/* Clear boundary around the main lesson runtime: video, embeds, games, cards, dictation, and TTS. */
.course-view-inner-left > .course-view-box.course-view-box--two.box--embed,
.course-view-inner-left > .course-view-box.course-view-box--two:has(.video-poster-container),
.course-view-inner-left > .course-view-box.course-view-box--two:has(.course-view-video),
.course-view-inner-left > .video-poster-container,
.course-view-inner-left > #vimeoPlayer,
.course-view-inner-left > #livePlayer,
.course-view-inner-left > #your-video,
.course-view-inner-left > .watch-tts-box,
.course-view-inner-left .dictation-workspace--course-embedded > .course-view-box.course-view-box--two.box--embed {
    box-sizing: border-box;
    border: 3px solid #000;
    border-radius: 12px;
    background: #fff;
    padding: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    min-width: 0;
}

.course-view-inner-left > .course-view-box.course-view-box--two.box--embed > .embed-container {
    margin: 0 auto;
}

/* (اختياري) لو بدك تأثير hover للصناديق العادية فقط */
.course-view-box.course-view-box--two:not(.box--embed):hover {
  border-color: #c44a4a;
}

/* ضبط صندوق وصف الدرس المختلط (عربي + ألماني) */
.course-view-description {
    /* ارتفاع السطر لسهولة القراءة */
    line-height: 1.7; /* زيادة المسافة بين الأسطر */

    /* التأكد أن الكلمات الطويلة لا تخرج خارج الصندوق */
    overflow-wrap: break-word; /* كسر الكلمات الطويلة عند الحاجة */
    word-wrap: break-word;     /* دعم للمتصفحات الأقدم */

    /* مسافة بسيطة من الحواف إذا احتجتها */
    margin-top: 10px; /* مسافة صغيرة فوق الوصف */
}
/* عندما تكون لغة الصفحة عربية، اجعل الاتجاه الافتراضي من اليمين لليسار */
html[lang="ar"] .course-view-description {
    direction: rtl;      /* اتجاه أساسي من اليمين لليسار */
    text-align: right;   /* محاذاة النص إلى اليمين */
}

/* قوائم داخل وصف الدرس – اتجاه يسار لليمين للألماني */
.course-view-description ol,
.course-view-description ul {
    /* السماح للكود أعلاه بتغيير dir، لكن نضبط الهوامش */
    margin-left: 1.5rem;  /* مسافة من اليسار للقوائم الألمانية */
    margin-right: 0;      /* نلغي مسافة اليمين الافتراضية في RTL */
    padding-left: 0.5rem; /* مسافة خفيفة قبل النص */
}


.course-view-video {
    width: 100%;
    height: 570px;
}

#youtubePlayer {
    width: 100%;
    max-width: 900px;
    height: 500px;
}

.course-view-video .vjs-poster img {
    object-fit: cover;
}

.course-view-video .vjs-big-play-button {
    width: 125px;
    height: 125px;
    border: 1px solid hsl(var(--base));
    border-radius: 50%;
    box-shadow: 0px 0px 5px 3px hsl(var(--base));
    background-color: hsl(var(--body-color));
    margin-top: 0px;
    margin-left: 0px;
    transform: translate(-50%, -50%);
}

.course-view-video .vjs-big-play-button:focus,
.course-view-video .vjs-big-play-button:hover {
    border-color: hsl(var(--base));
    background-color: hsl(var(--body-color));
}

@media screen and (max-width: 991px) {
    .course-view-video .vjs-big-play-button {
        width: 70px;
        height: 70px;
    }
}

.course-view-video .vjs-big-play-button .vjs-icon-placeholder::before {
    content: "";
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background-image: var(--watch-video-play-icon);
    background-size: 50%;
    background-position: center;
    background-repeat: no-repeat;
}

.course-view-video:hover .vjs-big-play-button {
    border-color: hsl(var(--base));
    background-color: hsl(var(--body-color));
}

@media screen and (max-width: 1199px) {
    .course-view-video {
        height: 500px;
    }
}

@media screen and (max-width: 991px) {
    .course-view-video {
        height: 480px;
    }
}

@media screen and (max-width: 767px) {
    .course-view-video {
        height: 400px;
    }
}

@media screen and (max-width: 575px) {
    .course-view-video {
        height: 350px;
    }
}

@media screen and (max-width: 424px) {
    .course-view-video {
        height: 204px;
    }
}

html[lang="ar"] .border-start {
    border-left: 0 !important;
    border-right: 3px solid #dee2e6 !important;
}
html[lang="ar"] .ms-4 {
    margin-left: 0 !important;
    margin-right: 1.5rem !important;
}
html[lang="ar"] .ps-3 {
    padding-left: 0 !important;
    padding-right: 1rem !important;
}

.rating-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    direction: ltr !important;
}

.rating-text.high {
    order: 1;
}

.rating-text.low {
    order: -1;
}

.rating-form-group {
    display: flex;
    gap: 5px;
}


.user-avatar {
    font-size: 1.7rem;
    color: #b71c1c;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}
.user-avatar .comment-avatar-img {
    display: block;
    width: 36px;
    height: 36px;
    object-fit: cover;
}
/* Video Poster Styles */
.video-poster-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    height: 500px;
    overflow: hidden;
    background: #000;
    cursor: pointer;
    margin-bottom: 10px;
}

.video-poster-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lesson-title-on-poster {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 14px 18px;
    background: rgba(30, 35, 45, 0.92);
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
    pointer-events: none;
    border-top: 3px solid rgba(183, 28, 28, 0.9);
}

.watch-nav-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}
.watch-nav-current-row {
    display: flex;
    justify-content: center;
    align-items: center;
}
.watch-nav-current-row .btn-current-lesson {
    min-width: 0;
}
/* شاشة كبيرة: سطر واحد السابق | الحالي | التالي | المزيد */
@media (min-width: 768px) {
    .watch-nav-actions-row,
    .watch-nav-current-row {
        display: contents;
    }
    #btnPrevStep { order: 1; }
    .watch-nav-buttons .btn-current-lesson { order: 2; }
    #btnNextStep { order: 3; }
    .watch-nav-buttons .watch-more-wrap { order: 4; }
}
/* موبايل: سطر للدرس الحالي ثم سطر رجوع | More | تالي */
@media (max-width: 767px) {
    .watch-nav-buttons {
        flex-direction: column;
        width: 100%;
    }
    .watch-nav-current-row {
        width: 100%;
        order: -1;
    }
    .watch-nav-current-row .btn-current-lesson {
        width: 100%;
    }
    .watch-nav-actions-row {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
    }
    .watch-nav-actions-row .btn,
    .watch-nav-actions-row .watch-more-wrap {
        flex-grow: 0;
        flex-shrink: 0;
    }
}

.video-poster-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 6px solid #000;
    border-radius: inherit;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.video-poster-container:hover .video-poster-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.video-vimeo-locked-overlay {
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.75);
    padding: 1.5rem;
    text-align: center;
}
.video-vimeo-locked-icon {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.9);
}
.video-vimeo-locked-text {
    color: #fff;
    font-size: 1rem;
    max-width: 420px;
}

.video-play-button {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.video-play-button:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.video-play-button i {
    font-size: 40px;
    color: #b71c1c;
    margin-left: 5px; /* Adjust for play icon centering */
}

/* اسم الكورس والدرس فوق الفيديو */
.watch-video-titles--box {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
}
.watch-video-titles--inline {
    display: flex;
    flex-direction: row-reverse;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 1.05rem;
    line-height: 1.4;
}
.watch-video-titles__course {
    font-weight: 700;
    color: #1a1a1a;
}
.watch-video-titles__lesson {
    font-weight: 500;
    color: #444;
    direction: rtl;
    text-align: right;
}
.watch-video-titles__lesson--parts .watch-video-titles__part {
    unicode-bidi: isolate;
}
.watch-video-titles__lesson--parts .watch-video-titles__sep {
    unicode-bidi: isolate;
}

.video-poster-container.hidden {
    display: none;
}

@media screen and (max-width: 991px) {
    .video-poster-container {
        height: 500px;
    }
    .video-play-button {
        width: 80px;
        height: 80px;
    }
    .video-play-button i {
        font-size: 32px;
    }
}

@media screen and (max-width: 767px) {
    .video-poster-container {
        height: 500px;
    }
    .video-play-button {
        width: 70px;
        height: 70px;
    }
    .video-play-button i {
        font-size: 28px;
    }
}

@media screen and (max-width: 575px) {
    .video-poster-container {
        height: 500px;
    }
}

     /* ============================
 سماعي (نفس course details)
============================ */

     /* تعليق: بادج "سماعي" كنص أخضر */
     .lesson-badge-listening{
 background: transparent;
 border: 0;
 padding: 0;
 display: inline-flex;
 align-items: center;
 font-weight: 600;
 font-size: 13px;
 margin-inline-end: .35rem;
 white-space: nowrap;
 flex-shrink: 0;
 color: #15803d; /* أخضر واضح */
     }

     /* تعليق: كرت السماعي بخلفية خضراء فاتحة */
     .course-lesson-content-item.lesson-listening .course-lesson-content-link{
 background-color: #f0fdf4;
 border-color: #bbf7d0;
 color: #111827;
     }

     /* تعليق: هوفر السماعي */
     .course-lesson-content-item.lesson-listening .course-lesson-content-link:hover{
 background-color: #dcfce7;
 border-color: #86efac;
     }

/* ============================
   1) زر الكورس الخاص (كما هو)
   ============================ */
.course-join-btn.disabled {
    /* شكل الزر لما يكون الكورس خاص ومقفول */
    opacity: 0.6;                /* زر باهت قليلاً */
    cursor: not-allowed;         /* مؤشر ممنوع */
    pointer-events: none;        /* لا يمكن الضغط عليه */
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #fff !important;
}

.course-join-btn.disabled:hover {
    /* يبقى شكله ثابت عند المرور عليه */
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #fff !important;
}

/* ======================================
   2) عنصر السطر الواحد لكل درس في القائمة
   ====================================== */
.course-lesson-content-item {
    /* إزالة النقاط العادية للقوائم + مسافة صغيرة بين الكروت */
    list-style: none;
    margin-bottom: 4px;

    position: relative;  /* لندخل بعالم z-index */
    z-index: 1;          /* نخلي الكرت فوق الخط العمودي */
}
/* 👇 كروت الفرعي: إزاحة البداية (جهة الخط) فقط — النهاية بمحاذاة كرت الدرس */
.course-lesson-content-item.sub-lesson .course-lesson-content-link {
    width: calc(100% - 32px);
    margin-inline-start: 32px;
    margin-inline-end: 0;
}

/* ======================================
   3) الكرت الرئيسي لكل درس (الرابط)
   ====================================== */
.course-lesson-content-link {
    /* نستخدم flex لنجعل النص والمدة في نفس السطر */
    display: flex;
    align-items: flex-start;     /* محاذاة من الأعلى لو العنوان على سطرين */
    justify-content: flex-start;
    width: 100%;
    padding: 15px 20px;          /* حشو داخلي للكرت */
    border-radius: 10px;         /* حواف ناعمة للكرت */
    border: 1px solid #fecaca;   /* افتراضيًا مثل كرت "درس" (أحمر فاتح) */
    background-color: #fff5f5;   /* خلفية أحمر فاتح للدروس العادية */
    font-weight: 500;
    font-size: 16px;
    color: #111827;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    gap: 10px;                   /* مسافة بين النص والمدة */
}

/* تأثير بسيط عند المرور على أي كرت */
.course-lesson-content-link:hover {
    background-color: #ffecec;
    border-color: #fca5a5;
    text-decoration: none;
}

/* هوفر خاص بدروس الاختبار (يبقى رمادي فاتح) */
.course-lesson-content-item.sub-lesson-test .course-lesson-content-link:hover {
  background-color: #e5e5e5;  /* رمادي أغمق قليلاً من العادي */
  border-color: #d4d4d4;      /* إطار رمادي مناسب */
  text-decoration: none;      /* بدون خط تحت النص */
}

/* هوفر خاص بدروس اللعبة (يبقى أصفر فاتح) */
.course-lesson-content-item.sub-lesson-game .course-lesson-content-link:hover {
  background-color: #fef3c7;  /* أصفر أغمق شوي للهوفر */
  border-color: #facc15;      /* نفس لون إطار اللعبة */
  text-decoration: none;      /* بدون خط تحت النص */
}


/* ======================================
   4) حاوية (رقم الدرس + البادج + العنوان)
   ====================================== */
.course-lesson-content-link .icon {
    /* حاوية الرقم + كلمة "درس" + العنوان */
    display: flex;               /* ترتيب العناصر أفقياً */
    align-items: flex-start;     /* محاذاة من الأعلى */
    justify-content: flex-start; /* كل شيء يبدأ من الطرف (يمين في RTL) */
    gap: 8px;                    /* مسافة بين العناصر */
    flex: 1 1 auto;              /* لا تتمدّد، لا تأخذ عرض الكرت كله */
    min-width: 0;                /* يسمح للنص الطويل أن ينكسر على عدة أسطر */
}


/* العنوان – سطران كحد أقصى بدون (...) */
.course-lesson-content-link .icon .text {
    min-width: 0;
    overflow: hidden;
    white-space: normal;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;        /* أقصى شيء سطران */
    -webkit-box-orient: vertical;
    line-height: 1.3;
    max-height: calc(1.3em * 2);  /* يحدد ارتفاع سطرين */
}

/* المدة تظهر في الطرف الآخر من السطر */
.course-lesson-content-link .duration {
    margin-inline-start: auto;  /* تدفع المدة إلى أقصى اليمين/اليسار حسب اللغة */
    white-space: nowrap;
    font-size: 14px;
    color: #666;
}

/* ======================================
   5) دائرة رقم الدرس + أيقونة الإنجاز
   ====================================== */

/* رقم الدرس داخل دائرة صغيرة */
.lesson-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.2em;
    height: 2.2em;
    border-radius: 9999px;        /* دائرة كاملة */
    border: 1px solid #fecaca;    /* إطار أحمر فاتح */
    background: #ffffff;
    font-size: 12px;
    font-weight: 600;
    color: #b91c1c;               /* رقم بلون أحمر هادئ */
    margin-inline-end: .35rem;    /* مسافة بعد الدائرة */
}

/* أيقونة الإكمال: دائماً ظاهرة — رمادي/فارغ غير المشاهد، أخضر المكتمل */
.completed-icon {
    margin-inline-end: .35rem;
    flex-shrink: 0;
    font-size: 1rem;
    line-height: 1;
}
.completed-icon.is-complete {
    color: #16a34a;
}
.completed-icon.is-incomplete {
    color: #d1d5db;
}

/* ======================================
   6) شارات الكلمات (درس / اختبار / لعبة)
      نص فقط بدون خلفية أو دائرة
   ====================================== */
.lesson-badge,
.lesson-badge-lesson,
.lesson-badge-test,
.lesson-badge-game {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    display: inline-flex;        /* نستخدم inline-flex لمحاذاة الكلمة بشكل جميل */
    align-items: center;         /* توسيط عمودي بسيط داخل البادج */
    font-weight: 600;
    font-size: 13px;
    margin-inline-end: .35rem;

    white-space: nowrap;         /* ممنوع تقسيم الكلمة على سطرين (درس / لعبة / اختبار) */
    flex-shrink: 0;              /* لا تصغّر عرض البادج، خليه ثابت والكسر يكون في العنوان فقط */
}


/* ألوان مختلفة لكل كلمة فقط كنص */
.lesson-badge-lesson {
    color: #b91c1c;   /* "درس" أحمر هادئ */
}

.lesson-badge-test {
    color: #4b5563;   /* "اختبار" رمادي متوسط */
}

.lesson-badge-game {
    color: #b45309;   /* "لعبة" برتقالي/بني هادئ */
}

/* ======================================
   7) ألوان الخلفيات لكل نوع كرت
      درس = أحمر فاتح
      اختبار = رمادي فاتح
      لعبة = أصفر فاتح
   ====================================== */

/* كرت درس عادي (ليس اختبار ولا لعبة) */
.course-lesson-content-item:not(.sub-lesson) .course-lesson-content-link {
    background-color: #fff5f5;   /* أحمر فاتح */
    border-color: #fecaca;
    color: #111827;
}

/* كرت اختبار */
.course-lesson-content-item.sub-lesson-test .course-lesson-content-link {
    background-color: #f5f5f5;   /* رمادي فاتح */
    border-color: #e5e7eb;
    color: #111827;
}

/* كرت لعبة */
.course-lesson-content-item.sub-lesson-game .course-lesson-content-link {
    background-color: #fffbeb;   /* أصفر فاتح */
    border-color: #facc15;
    color: #78350f;
}

/* لا نعرض مدة الفيديو في الاختبارات/الألعاب */
.course-lesson-content-item.sub-lesson .course-lesson-content-link .duration {
    display: none;
}

/* ======================================
   8) خط عمودي يربط "اختبار/لعبة" مع الدرس
   ====================================== */


/* ======================================
   9) تحسينات بسيطة للموبايل الصغير
   ====================================== */
@media (max-width: 480px) {
    .course-lesson-content-link {
padding: 12px 14px;   /* تقليل الحشو على الشاشات الصغيرة */
gap: 8px;
    }

    .lesson-index {
min-width: 2em;
height: 2em;
font-size: 11px;
    }

    .course-lesson-content-link .duration {
font-size: 12px;
    }
}
/* جعل قائمة الدروس حاوية للخط العمودي */
.course-lesson-content {
    position: relative;
}
/* عربي: اتجاه RTL حتى يكون right = يسار الشاشة (الخط والمساحة يسار) */
html[lang="ar"] .course-lesson-content {
    direction: rtl;
}
/* ألماني/إنجليزي: اتجاه LTR حتى يكون right = يمين الشاشة (الخط والمساحة يمين) */
html[lang="de"] .course-lesson-content,
html[lang="en"] .course-lesson-content {
    direction: ltr;
}

/* 🔹 الدرس الرئيسي الذي عنده اختبارات/ألعاب تحته – خط عمودي رمادي من أسفل الكرت لآخر فرعي */
.course-lesson-content-item.has-sub-chain {
    position: relative;
}
.course-lesson-content-item.has-sub-chain::before {
    content: none;
    display: none;
    position: absolute;
    right: 18px;
    top: 100%;
    width: 2px;
    height: var(--sub-chain-height);
    background: linear-gradient(to bottom, #e5e7eb, #d4d4d4);
    border-radius: 999px;
    z-index: 0;
}

/* 🔹 آخر عنصر في السلسلة – خط أفقي ناعم (نهاية العمود) */
.course-lesson-content-item.last-sub-chain::after {
    content: none;
    display: none;
    position: absolute;
    top: 50%;
    right: 18px;
    width: 16px;
    height: 3px;
    background: linear-gradient(to left, #e5e7eb, #d4d4d4);
    border-radius: 999px;
    transform: translateY(-50%);
    z-index: 0;
}
/* ❗ ضبط محاذاة نص دروس (لعبة / اختبار) حتى لا يكون في المنتصف */
.course-lesson-content-item.sub-lesson .course-lesson-content-link {
    /* نتأكد أن الكرت نفسه يستخدم flex ومحاذاة من البداية وليس في المنتصف */
    display: flex;               /* نستخدم Flex لصفّ العناصر أفقياً */
    align-items: flex-start;     /* النص يكون من أعلى الكرت، ليس في الوسط عمودياً */
    justify-content: flex-start; /* محاذاة من بداية السطر (يمين في RTL / يسار في LTR) */
    text-align: start;           /* إلغاء أي text-align: center موروث */
}

/* داخل الأيقونة (badge + عنوان) نخلي المحاذاة أيضاً من البداية */
.course-lesson-content-item.sub-lesson .course-lesson-content-link .icon {
    justify-content: flex-start; /* منع تمركز المحتوى داخل span.icon */
    align-items: center;         /* يبقى الـ badge والعنوان على نفس الخط بشكل مرتب */
}
/* تقليل الحشو العمودي في كروت اللعبة/الاختبار */
.course-lesson-content-item.sub-lesson .course-lesson-content-link {
    padding-top: 10px;   /* حشو علوي أقل */
    padding-bottom: 10px;/* حشو سفلي أقل */
}
/* 🔹 أولاً: خلي كل الكروت (درس + لعبة + اختبار) تبدأ من البداية، مو بالنص */
.course-lesson-content-item,
.course-lesson-content-link,
.course-lesson-content-link .icon,
.course-lesson-content-link .icon .text {
    text-align: start; /* في RTL = يمين، في LTR = يسار */
}

/* 🔹 تأكيد أن الـ flex ما يعمل تمركز أفقي */
.course-lesson-content-link {
    justify-content: flex-start;  /* خلي المحتوى من بداية السطر */
    align-items: flex-start;      /* خلي العناصر من أعلى الكرت، مو بالنص عمودياً */
}

/* 🔹 لو في أي تمركز داخل الأيقونة (الرقم + البادج + العنوان) نلغيه */
.course-lesson-content-link .icon {
    justify-content: flex-start;  /* لا تخلّي العناصر تتوسّط داخل span.icon */
}

/* 🔹 كمان للألعاب والاختبارات (sub-lesson) نضمن نفس الشيء */
.course-lesson-content-item.sub-lesson .course-lesson-content-link .icon {
    justify-content: flex-start;  /* نفس المحاذاة حتى للعبة/الاختبار */
}
/* عنوان الدرس – عرض العنوان كامل بدون ... وبدون تحديد بعدد الأسطر */
.course-lesson-content-link .icon .text {
    display: block;           /* عنصر بلوك عادي بدل -webkit-box */
    white-space: normal;      /* السماح بعدة أسطر */
    overflow: visible;        /* لا نخفي أي جزء من النص */
    word-break: break-word;   /* كسر الكلمات الطويلة إذا لزم */
    -webkit-line-clamp: unset;   /* إلغاء تحديد عدد الأسطر */
    -webkit-box-orient: unset;   /* إلغاء وضعية الصندوق */
    max-height: none;            /* لا نحدد ارتفاع أقصى */
}

.course-lesson-content-link .icon {
    display: inline-flex;      /* نخليها تاخذ عرض المحتوى فقط */
    align-items: center;       /* محاذاة عمودية جميلة */
    gap: 8px;                  /* مسافة بين الرقم/البادج والعنوان */
    flex: 1 1 auto !important; /* إلغاء flex: 1 1 auto حتى لا تتمدّد */
    min-width: 0;              /* يسمح للعنوان الطويل ينكسر على أكثر من سطر */
}

/* شكل كرت الدرس الحالي – فقط إطار أغمق + ظل خفيف */
.course-lesson-content-item.current-lesson .course-lesson-content-link {
    position: relative;                          /* حتى نقدر نرسم البادج ::before */
    background-color: #ffc7c7;                   /* خلفية مميزة للدرس الحالي */
    border-color: #b91c1c;                       /* إطار غامق ليُظهر أنه الدرس الحالي */
    box-shadow:
0 0 0 1px rgba(185, 28, 28, 0.15),      /* هالة خفيفة حول الكرت */
0 6px 14px rgba(0, 0, 0, 0.08);         /* ظل بسيط أسفل الكرت */
    z-index: 3;                                  /* نخليه فوق باقي الكروت */
}

/* رقم الدرس داخل الدائرة – نفس اللون لكن بدون خلفية حمراء كاملة */
.course-lesson-content-item.current-lesson .lesson-index {
    border-color: #b91c1c;   /* إطار أغمق للرقم */
    background-color: #ffffff;  /* خلفية بيضاء عادية */
    color: #b91c1c;          /* رقم باللون الأحمر الغامق */
}

/* شارة صغيرة فوق الكرت مكتوب فيها "الدرس الحالي" */
.course-lesson-content-item.current-lesson .course-lesson-content-link::before {
    content: var(--watch-current-lesson-label);
    position: absolute;
    top: -10px;
    inset-inline-start: -15px;
    padding: 2px 10px;
    background-color: #b91c1c;
    color: #ffffff;
    font-size: 11px;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* في النسخة العربية نضيف سماكة بسيطة من اليمين فقط إن أحببت إبقاءها
   يمكنك حذف هذا البلوك إن لا تريد الخط السميك */
html[lang="ar"] .course-lesson-content-item.current-lesson .course-lesson-content-link {
    border-right-width: 3px;      /* خط أوضح من جهة اليمين */
    border-right-color: #b91c1c;
}
/* إجبار الدروس العادية أن تكون محاذاة لبداية السطر (يمين في العربي) */
.course-lesson-content .course-lesson-content-item:not(.sub-lesson) .course-lesson-content-link {
    justify-content: flex-start !important;  /* لا تكون العناصر في الوسط */
    text-align: start !important;            /* محاذاة النص لبداية السطر */
}

/* محاذاة الرقم + كلمة "درس" + العنوان لبداية السطر */
.course-lesson-content .course-lesson-content-item:not(.sub-lesson) .course-lesson-content-link .icon {
    justify-content: flex-start !important;  /* إلغاء أي تمركز أفقي */
}

/* عنوان الدرس نفسه يكون على اليمين في العربي وعلى اليسار في الألماني */
.course-lesson-content .course-lesson-content-item:not(.sub-lesson) .course-lesson-content-link .icon .text {
    text-align: start !important;           /* منع التوسيط داخل العنوان */
    display: inline-block;                  /* يسمح بمحاذاة أوضح للنص */
}


/* جعل كل سكشن (course-lesson) بإطار أحمر فاتح مثل باقي الكروت */
.course-view-inner-right .accordion .accordion-item .course-lesson {
    border: 1px solid #fecaca !important;     /* إطار أحمر فاتح */
    border-radius: 10px;                      /* حواف ناعمة */
    padding: 0;
}
/* منع تداخل قائمة الدروس مع صندوق التقييم عند النزول */
.course-view-inner-right {
    position: relative;
    top: auto;
    bottom: auto;
    height: auto;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
    padding: 0;
    margin-bottom: 0 !important;
}

/* lg+: stretch columns to equal row height; sidebar grows with flex above rating/dialogue (legacy viewport-only caps underrated available column height). */
@media (min-width: 992px) {
    .course-watch-layout-row {
display: flex;
flex-wrap: wrap;
align-items: stretch;
    }
    .course-watch-layout-row > .col-lg-8 {
flex: 0 0 auto;
width: 66.66666667%;
max-width: 66.66666667%;
    }
    .course-watch-layout-row > .col-lg-4 {
flex: 0 0 auto;
width: 33.33333333%;
max-width: 33.33333333%;
display: flex;
flex-direction: column;
min-height: 0;
    }
    .course-view-inner-right {
flex: 1 1 auto;
min-height: 0;
height: auto;
/* 150% of legacy 570px cap (855px); flex fills column up to this limit */
max-height: 855px !important;
overflow-y: auto;
    }
}

/* أبقِ فقط الإطار الخارجي للسايدبار بدون أي حدود/حشوات داخلية إضافية */
.course-view-inner-right .course-lesson > .course-lesson-header,
.course-view-inner-right .course-lesson > .course-lesson-body,
.course-view-inner-right .course-lesson > .collapse > .course-lesson-body,
.course-view-inner-right .course-lesson-content-link {
    border: 0 !important;
    box-shadow: none !important;
}
.watch-quick-tools { margin-bottom: 8px; }
.watch-quick-tools .ph-mini-chart {
    min-width: 140px;
    background: linear-gradient(180deg, #ffffff, #fafafa);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    padding: 0.35rem 0.5rem 0.32rem;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}
.watch-quick-tools .ph-mini-chart__rows {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
}
.watch-quick-tools .ph-mini-chart__row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.watch-quick-tools .ph-mini-chart__row-label {
    flex-shrink: 0;
    font-size: 0.65rem;
    line-height: 1.15;
    color: #475569;
    white-space: nowrap;
}
.watch-quick-tools .ph-mini-chart__pct {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.watch-quick-tools .ph-mini-chart__track {
    flex: 1;
    min-width: 0;
    height: 8px;
    background: rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.10);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.watch-quick-tools .ph-mini-chart__bar {
    height: 100%;
    min-width: 3px;
    border-radius: 999px;
    transition: width .3s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.watch-quick-tools .ph-mini-chart__bar--lessons { background: #2563eb; }
.watch-quick-tools .ph-mini-chart__bar--child { background: #f97316; }
.watch-quick-tools .ph-mini-chart__bar--words { background: #0d9488; }
.watch-quick-tools .ph-mini-chart__bar--streak { background: #7c3aed; }
/* صف واحد مضغوط: عنوان الدرس + أزرار التنقل السريع + بحث الدروس */
.watch-quick-tools__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-top: 6px;
}
.watch-quick-tools__bar .watch-quick-tools__quick-and-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    flex: 2 1 380px;
    min-width: 0;
}
.watch-quick-tools__bar .watch-quick-tools__titles {
    flex: 1 1 160px;
    min-width: 0;
    max-width: 100%;
}
.watch-quick-tools__bar .watch-quick-tools__titles .watch-video-titles--box {
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 0;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
}
.watch-quick-tools__bar .watch-quick-tools__titles .watch-video-titles--inline {
    font-size: 0.9375rem;
    line-height: 1.45;
    gap: 0.45rem;
}
.watch-quick-tools__bar .watch-video-titles__course {
    font-size: 0.95rem;
}
.watch-quick-tools__bar .watch-video-titles__lesson {
    font-size: 0.9rem;
}
.watch-quick-tools__bar .watch-quick-tools__quick-and-search .watch-quick-nav {
    flex: 1 1 200px;
    min-width: min(100%, 180px);
}
.watch-quick-tools__bar .watch-quick-tools__quick-and-search .watch-quick-tools__search {
    flex: 1 1 200px;
    min-width: min(100%, 160px);
    max-width: 100%;
}
.watch-quick-tools__bar .watch-quick-tools__search .course-content-search {
    margin-bottom: 0;
}
/* حقل البحث داخل الشريط: أصغر من النسخة الافتراضية للمكوّن */
.watch-quick-tools__bar .course-content-search__box {
    box-shadow: 0 2px 8px rgba(182, 0, 0, 0.05);
    border-radius: 999px;
}
.watch-quick-tools__bar .course-content-search__icon,
.watch-quick-tools__bar .course-content-search__clear {
    width: 2rem;
    height: 2rem;
}
.watch-quick-tools__bar .course-content-search__icon {
    font-size: 0.95rem;
}
.watch-quick-tools__bar .course-content-search__input {
    padding: 0.4rem 0;
    font-size: 0.78rem;
    font-weight: 600;
}

/* lg+: titles use remaining width; actions column stays readable (no tiny search / giant buttons) */
@media (min-width: 992px) {
    .watch-quick-tools__bar {
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
align-items: center;
gap: 12px clamp(12px, 2vw, 22px);
flex-wrap: unset;
    }
    .watch-quick-tools__bar .watch-quick-tools__titles {
flex: unset;
max-width: none;
min-width: 0;
    }
    .watch-quick-tools__bar .watch-quick-tools__titles .watch-video-titles--inline {
justify-content: flex-start;
gap: 0.55rem 0.85rem;
    }
    .watch-quick-tools__bar .watch-quick-tools__quick-and-search {
flex: unset;
display: flex;
flex-wrap: nowrap;
align-items: stretch;
justify-content: flex-end;
gap: 10px 14px;
width: auto;
max-width: min(720px, 54vw);
min-width: 0;
    }
    .watch-quick-tools__bar .watch-quick-tools__quick-and-search .watch-quick-nav {
flex: 1 1 0;
min-width: min(100%, 14rem);
max-width: none;
    }
    .watch-quick-tools__bar .watch-quick-tools__quick-and-search .watch-quick-tools__search {
flex: 0 0 auto;
width: clamp(11rem, 20vw, 17rem);
min-width: 0;
max-width: 17rem;
    }
}
@media (min-width: 1200px) {
    .watch-quick-tools__bar {
gap: 14px clamp(16px, 2.2vw, 28px);
    }
    .watch-quick-tools__bar .watch-quick-tools__titles .watch-video-titles--box {
padding: 11px 15px;
min-height: 3rem;
    }
    .watch-quick-tools__bar .watch-quick-tools__titles .watch-video-titles--inline {
font-size: 1rem;
line-height: 1.5;
gap: 0.6rem 1rem;
    }
    .watch-quick-tools__bar .watch-video-titles__course {
font-size: 1.02rem;
    }
    .watch-quick-tools__bar .watch-video-titles__lesson {
font-size: 0.96rem;
    }
    .watch-quick-tools__bar .course-content-search__input {
font-size: 0.85rem;
padding: 0.46rem 0;
    }
    .watch-quick-tools__bar .watch-quick-tools__quick-and-search {
max-width: min(760px, 52vw);
    }
    .btn.watch-quick-nav__btn {
font-size: 0.8125rem;
min-height: 44px;
padding: 8px 12px;
    }
}
@media (min-width: 1400px) {
    .watch-quick-tools__bar .watch-quick-tools__quick-and-search {
max-width: min(820px, 50vw);
gap: 12px 18px;
    }
    .watch-quick-tools__bar .watch-quick-tools__quick-and-search .watch-quick-tools__search {
width: clamp(13rem, 17vw, 19rem);
max-width: 19rem;
    }
}

/* lg+: quick-nav matches toolbar row — equal columns, readable multi-line labels (#watchQuickTools mobile caps stay max-width 991 only). */
@media (min-width: 992px) {
    #watchQuickTools .watch-quick-nav {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 8px 12px;
width: 100%;
min-width: 0;
align-items: stretch;
    }
    #watchQuickTools .btn.watch-quick-nav__btn {
min-height: 42px;
height: auto;
align-self: stretch;
padding: 9px 11px;
border-radius: 10px;
font-size: clamp(0.74rem, 0.62rem + 0.45vw, 0.84rem);
font-weight: 700;
line-height: 1.28;
white-space: normal;
gap: 8px;
overflow: hidden;
    }
    #watchQuickTools .btn.watch-quick-nav__btn i {
font-size: 1.05rem;
flex-shrink: 0;
line-height: 1;
    }
    #watchQuickTools .btn.watch-quick-nav__btn span {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
word-break: break-word;
min-width: 0;
line-height: 1.28;
    }
}

.watch-quick-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}
.btn.watch-quick-nav__btn {
    border: 1px solid #b60000;
    border-radius: 9px;
    background: #b60000;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.3;
    min-height: 42px;
    padding: 8px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-start;
    text-align: start;
}
.btn.watch-quick-nav__btn i {
    color: inherit;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.btn.watch-quick-nav__btn:hover:not(:disabled) {
    border-color: #9a0000;
    color: #fff;
    background: #9a0000;
}
.btn.watch-quick-nav__btn:focus-visible {
    outline: 2px solid rgba(182, 0, 0, 0.45);
    outline-offset: 2px;
}
.btn.watch-quick-nav__btn:disabled {
    background: #b60000;
    border-color: #b60000;
    color: #fff;
    opacity: 0.55;
    cursor: not-allowed;
}
/* على الشاشات الصغيرة نلغي أي حد للارتفاع وأي سكروول داخلي */
@media (max-width: 991.98px) {
    .course-view-inner-right {
position: static;
height: auto;
bottom: auto;
max-height: none !important;   /* لا يوجد حد أقصى للارتفاع */
overflow-y: visible !important;/* لا يوجد سكروول داخلي */
    }
    .watch-quick-tools__bar {
flex-direction: column;
align-items: stretch;
gap: 8px 10px;
margin-top: 4px;
    }
    .watch-quick-tools__bar .watch-quick-tools__titles .watch-video-titles--box {
padding: 9px 11px;
min-height: 2.6rem;
    }
    .watch-quick-tools__bar .watch-quick-tools__titles .watch-video-titles--inline {
font-size: 0.875rem;
line-height: 1.4;
    }
}

/* موبايل: بحث مضغوط أكثر */
@media (max-width: 575.98px) {
    .watch-quick-tools__bar .course-content-search__icon,
    .watch-quick-tools__bar .course-content-search__clear {
width: 1.65rem;
height: 1.65rem;
    }
    .watch-quick-tools__bar .course-content-search__icon {
font-size: 0.82rem;
    }
    .watch-quick-tools__bar .course-content-search__input {
padding: 0.28rem 0;
font-size: 0.76rem;
font-weight: 600;
    }
}

/* على الشاشات الكبيرة نجعل الرقم + "درس" فوق بعض داخل عمود صغير */
@media (min-width: 992px) {
    .lesson-index-stack {
display: flex;              /* حاوية فلكس عمودية */
flex-direction: column;     /* ترتيب رأسي (فوق/تحت) */
align-items: center;        /* توسيط أفقي للرقم وكلمة "درس" */
justify-content: flex-start;
flex-shrink: 0;             /* لا تضيق هذه الحاوية عند ضيق المساحة */
margin-inline-end: 0.5rem;  /* مسافة بسيطة بينها وبين عنوان الدرس */
    }

    .lesson-index-stack .lesson-index {
margin-inline-end: 0;       /* لا حاجة لمسافة جانبية هنا */
margin-bottom: 3px;         /* مسافة صغيرة بين الرقم وكلمة "درس" */
    }

    .lesson-index-stack .lesson-badge-lesson {
margin-inline-end: 0;
font-size: 11px;            /* تصغير كلمة "درس" قليلاً لتوفير مساحة */
    }
}
.course-lesson-content-link .icon .text {
    /* نسمح للنص يأخذ أكثر من سطر */
    white-space: normal;          /* ليس سطر واحد فقط */
    word-break: break-word;       /* كسر الكلمات الطويلة عند الحاجة */
    min-width: 0;                 /* مهم مع flex حتى لا يكسر التصميم */

    /* إعدادات قصّ النص بعد سطرين مع ... */
    display: -webkit-box;         /* ضروري مع line-clamp */
    -webkit-box-orient: vertical; /* اتجاه الصندوق عمودي (أسطر تحت بعض) */
    -webkit-line-clamp: 2;        /* أقصى شيء سطران */
    overflow: hidden;             /* إخفاء ما يزيد عن سطرين */
    text-overflow: ellipsis;      /* إظهار ... في نهاية النص المقطوع */

    /* للتحكم في الارتفاع تقريباً (اختياري) */
    line-height: 1.3;             /* ارتفاع السطر */
    max-height: calc(1.3em * 2);  /* ارتفاع سطرين كحد أقصى */
}

/* تخصيص شريط التمرير باللون #b60000 */

/* للمتصفحات WebKit (Chrome, Edge, Safari) */
.course-view-inner-right {
    scrollbar-width: thin;                 /* فايرفوكس: شريط نحيف */
    scrollbar-color: #b60000 #ffe4e4;      /* الإبهام أحمر غامق + خلفية وردية فاتحة */
}

.course-view-inner-right::-webkit-scrollbar {
    width: 8px;                             /* سماكة العمود */
}

.course-view-inner-right::-webkit-scrollbar-track {
    background: #ffe4e4;                    /* الخلفية */
    border-radius: 999px;
}

.course-view-inner-right::-webkit-scrollbar-thumb {
    background-color: #b60000;              /* اللون المطلوب */
    border-radius: 999px;
    border: 2px solid #ffe4e4;              /* فاصل بسيط حول المقبض */
}

.course-view-inner-right::-webkit-scrollbar-thumb:hover {
    background-color: #7d0000;              /* أغمق شوي عند لمس السكروول */
}

.course-lesson-content-link.is-flashing::before {
    animation: badge-run 1.5s linear 1;
}

@keyframes badge-run {
    0%, 10%, 100% {
        top: -10px;
        inset-inline-start: -15px;
        color: #ffffff;
    }
    15%, 85% {
        color: transparent;
    }
    25% {
        top: -10px;
        inset-inline-start: calc(100% - 20px);
    }
    50% {
        top: calc(100% - 10px);
        inset-inline-start: calc(100% - 20px);
    }
    75% {
        top: calc(100% - 10px);
        inset-inline-start: -15px;
    }
}

/* Prevent anchor scroll behind fixed header */
html {
    scroll-padding-top: var(--header-offset, 80px);
}

/* زر المزيد وقائمته – دروب داون مخصص (بدون Bootstrap) */
.watch-more-btn {
    border-radius: 10px;
}
/*  القائمة الافتراضية: تفتح لتحت */
.watch-more-list{
    position: absolute;
    top: 100%;
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 4px !important;   /*  مهم لأن عندك mt-2 من Bootstrap فيه !important */
    margin-bottom: 0 !important;

    z-index: 1060;
    min-width: 240px;

    /*  حتى ما تطلع من الشاشة عرضياً */
    max-width: min(320px, calc(100% - 24px));

    border-radius: 10px;
    border: 2px solid #d46a6a;
    background-color: #fff;
    box-shadow: 0 6px 18px rgba(182, 0, 0, 0.15);
    padding: 8px 0;
    list-style: none;

    display: none;

    /*  لو القائمة طويلة: خليها تسكرول بدل ما تطلع برا */
    overflow-y: auto;
}

/*  لما نقرر تفتح لفوق */
.watch-more-list.open-up{
    top: auto;
    bottom: 100%;
    margin-top: 0 !important;
    margin-bottom: 4px !important;
}

/* كما عندك */
.watch-more-list.is-open{
    display: block !important;
}
html[lang="ar"] .watch-more-list {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}
.watch-more-list .watch-more-item {
    color: #b91c1c;
    font-weight: 500;
    padding: 10px 16px;
    border: none;
    background: transparent;
    width: 100%;
    text-align: inherit;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
}
.watch-more-list .watch-more-item:hover:not(:disabled) {
    background-color: #fee2e2;
    color: #7f1d1d;
}
.watch-more-list .watch-more-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
html[lang="ar"] .watch-more-list .watch-more-item {
    text-align: right;
}
.mt-3.mb-3.text-center,
.course-view-inner-left {
    overflow: visible !important;
}
#watchMoreDropdownWrap {
    position: relative;
    overflow: visible;
}

/*  على الموبايل: المنسدلة تكون fixed حتى ما تنقص بسبب overflow لأي parent */
@media (max-width: 991.98px) {
    #watchMoreMenu.watch-more-list {
        position: fixed !important;     /* تعليق: أهم سطر */
        left: 12px !important;
        right: 12px !important;
        transform: none !important;
        width: auto !important;

        z-index: 999999 !important;     /* تعليق: فوق iframe وفوق أي شيء */
    }
}

/* =========================================================
   Watch tools bar + quick nav: compact only below lg (was global → crushed desktop)
   ========================================================= */

@media (max-width: 991.98px) {
    #watchQuickTools .watch-quick-tools__bar {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 6px !important;
        margin-top: 4px;
        height: auto !important;
        min-height: 0 !important;
    }

    #watchQuickTools .watch-quick-tools__titles,
    #watchQuickTools .watch-quick-nav,
    #watchQuickTools .watch-quick-tools__search {
        flex: 0 0 auto !important;
        width: 100% !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
    }

    #watchQuickTools .watch-quick-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        min-width: 0;
    }

    #watchQuickTools .watch-video-titles--box {
        min-height: 0 !important;
        padding: 7px 10px !important;
        margin: 0 !important;
    }

    #watchQuickTools .watch-video-titles--inline {
        line-height: 1.3 !important;
        gap: 0.25rem !important;
    }

    #watchQuickTools .course-content-search {
        margin: 0 !important;
    }

    #watchQuickTools .btn.watch-quick-nav__btn {
        min-height: 30px !important;
        height: 30px !important;
        max-height: 30px !important;
        padding: 0 8px !important;
        border-radius: 7px;
        display: inline-flex !important;
        align-items: center;
        justify-content: flex-start;
        gap: 4px;
        overflow: hidden;
        font-size: 0.68rem;
        font-weight: 700;
        line-height: 1 !important;
        white-space: nowrap !important;
        text-align: start;
    }

    #watchQuickTools .btn.watch-quick-nav__btn i {
        font-size: 0.9rem !important;
        line-height: 1 !important;
        flex: 0 0 auto;
    }

    #watchQuickTools .btn.watch-quick-nav__btn span {
        display: block !important;
        flex: 1 1 auto;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        line-height: 1 !important;
    }
}

@media (max-width: 420px) {
    #watchQuickTools .watch-quick-nav {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    #watchQuickTools .btn.watch-quick-nav__btn {
        height: 28px !important;
        min-height: 28px !important;
        max-height: 28px !important;
        font-size: 0.64rem;
        padding: 0 7px !important;
    }
}
