/* ===== Go SVT Maroc - تحسينات ===== */
:root { --gs-green: #2d5a27; }

/* بطاقات الملفات */
.content-card { position: relative; }
.content-card .file-icon { font-size: 2.2rem; line-height: 1; margin: .5rem 0; }
.content-card .file-name { font-size: .8rem; opacity: .7; word-break: break-word; }
.new-badge {
    display: inline-block; margin-inline-start: .4rem; padding: .15rem .6rem;
    border-radius: 999px; background: #e63946; color: #fff;
    font-size: .75rem; font-weight: 700; animation: gs-pulse 2s infinite;
}
@keyframes gs-pulse { 50% { opacity: .6; } }
.card-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }
.preview-btn {
    cursor: pointer; padding: .5rem 1rem; border-radius: 8px;
    border: 2px solid var(--gs-green); background: transparent;
    color: var(--gs-green); font: inherit; font-weight: 600;
}
.preview-btn:hover { background: var(--gs-green); color: #fff; }
.files-count { grid-column: 1 / -1; margin: 0 0 1rem; font-weight: 600; color: var(--gs-green); }

/* الأزرار العائمة */
.gs-fab-group {
    position: fixed; bottom: 20px; left: 20px; z-index: 900;
    display: flex; flex-direction: column; gap: 10px;
}
.gs-fab {
    width: 50px; height: 50px; border-radius: 50%; border: none;
    background: var(--gs-green); color: #fff; font-size: 1.3rem; cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,.25); transition: transform .2s;
}
.gs-fab:hover { transform: scale(1.08); }
.gs-fab[hidden] { display: none; }

/* النوافذ (البحث والمعاينة) */
.gs-modal {
    position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.6);
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.gs-modal[hidden] { display: none; }
.gs-modal-box {
    background: #fff; color: #222; width: 100%; max-width: 950px; max-height: 92vh;
    border-radius: 14px; display: flex; flex-direction: column; overflow: hidden;
}
.gs-modal-head {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border-bottom: 1px solid #e5e5e5;
}
.gs-modal-title { flex: 1; margin: 0; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-close { border: none; background: #eee; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1rem; flex-shrink: 0; }
.gs-open-tab { color: var(--gs-green); font-weight: 600; text-decoration: none; white-space: nowrap; }
.gs-modal-body { flex: 1; min-height: 0; }
.gs-modal-body iframe { width: 100%; height: 80vh; border: 0; display: block; }
.gs-modal-body img { max-width: 100%; max-height: 80vh; display: block; margin: auto; }
#gs-search-input {
    flex: 1; padding: 12px 14px; font: inherit; font-size: 1rem;
    border: 2px solid var(--gs-green); border-radius: 10px; outline: none;
}
#gs-search-results {
    overflow-y: auto; padding: 16px; display: grid; gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.gs-search-hint { grid-column: 1 / -1; text-align: center; opacity: .7; }
body.gs-no-scroll { overflow: hidden; }

/* الوضع الليلي */
html.gs-dark { background: #fff; filter: invert(1) hue-rotate(180deg); }
html.gs-dark img, html.gs-dark video, html.gs-dark iframe { filter: invert(1) hue-rotate(180deg); }

/* الهاتف */
@media (max-width: 768px) {
    .content-card h3 { font-size: 1rem; }
    .gs-fab { width: 44px; height: 44px; font-size: 1.1rem; }
    .gs-modal { padding: 0; }
    .gs-modal-box { max-height: 100vh; height: 100%; border-radius: 0; }
    .gs-modal-body iframe { height: calc(100vh - 62px); }
}
/* ===== الدفعة 2 ===== */
.gs-group-title {
    grid-column: 1 / -1; width: 100%;
    margin: 1.5rem 0 .5rem; padding-bottom: .4rem;
    border-bottom: 2px solid var(--gs-green); color: var(--gs-green);
}
.gs-exam-session-title {
    grid-column: 1 / -1;
    width: 100%;
    margin: .65rem 0 .25rem;
    padding: .45rem .75rem;
    border-inline-start: 3px solid var(--gs-green);
    border-radius: 0 6px 6px 0;
    background: color-mix(in srgb, var(--gs-green) 8%, transparent);
    color: var(--gs-text, inherit);
    font-size: .95rem;
    font-weight: 700;
}
.gs-latest { padding: 2rem 0 3rem; }
.gs-latest[hidden] { display: none; }
.section-intro { text-align: center; opacity: .8; margin: 0 0 1.5rem; }
.contact-item a { color: inherit; }
/* ===== إصلاح رأس الصفحة ===== */
.header .logo h1 {
    white-space: nowrap; line-height: 1.2; margin: 0;
    font-size: clamp(1.3rem, 2vw, 1.8rem);
}
.header .logo p { margin: .2rem 0 0; font-size: .85rem; line-height: 1.4; }
.section { scroll-margin-top: 90px; }

@media (min-width: 769px) {
    .header .container { display: flex; align-items: center; gap: .5rem 1rem; }
    .header .logo { flex: 0 0 auto; max-width: 260px; }
    .main-nav { flex: 1 1 auto; min-width: 0; }
    .main-nav ul { flex-wrap: wrap; gap: .2rem; }
    .main-nav a { padding: .45rem .75rem; font-size: .95rem; }
    .header-actions { flex: 0 0 auto; }
}

/* ===== زر التحميل ===== */
.card-actions .download-btn {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .5rem 1rem; border-radius: 8px; border: 2px solid var(--gs-green);
    background: var(--gs-green); color: #fff; text-decoration: none; font-weight: 600;
}
.card-actions .download-btn:hover { opacity: .9; }

/* حرف كبير في بداية العناوين */
.content-card h3::first-letter { text-transform: uppercase; }
/* ===== إصلاح الأزرار العائمة ===== */
.gs-fab-group {
    left: auto; right: auto;
    inset-inline-end: 16px;
    bottom: 16px;
}
.gs-fab {
    width: 46px; height: 46px; font-size: 1.15rem;
    opacity: .85;
}
.gs-fab:hover, .gs-fab:focus-visible { opacity: 1; }

/* مساحة في أسفل الصفحة حتى لا تغطي الأزرار آخر بطاقة */
main { padding-bottom: 80px; }

/* الوصف تحت الشعار في سطر واحد على الشاشات الكبيرة */
@media (min-width: 1200px) {
    .header .logo { max-width: none; }
    .header .logo p { white-space: nowrap; }
}
/* =========================================
   الدفعة 3: إصلاحات + الهاتف + الوضع الليلي
   ========================================= */

/* ----- إصلاحات عامة ----- */
.content-grid { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.content-grid > .no-files,
.content-grid > .loading,
.content-grid > .error { grid-column: 1 / -1; text-align: center; padding: 2rem 1rem; }
.content-grid > .no-files { color: var(--light-text); font-style: italic; }
.content-grid > .loading { color: var(--primary-color); font-weight: 600; }
.content-grid > .error { color: #dc3545; font-weight: 600; }

.card-actions { align-items: center; }
.card-actions .download-btn { margin-top: 0; }
.card-actions .download-btn:hover { text-decoration: none; }
.social-links { flex-wrap: wrap; }

/* ----- زر القائمة يتحول إلى ✕ ----- */
.mobile-menu-btn span { transform-origin: center; }
.header:has(.main-nav.active) .mobile-menu-btn span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.header:has(.main-nav.active) .mobile-menu-btn span:nth-child(2) { opacity: 0; }
.header:has(.main-nav.active) .mobile-menu-btn span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ----- الهاتف والأجهزة اللوحية ----- */
@media (max-width: 768px) {
    .header { padding: .6rem 0; }
    .header .logo h1 { font-size: 1.25rem; }
    .header .logo p { font-size: .75rem; }
    .header-actions { gap: .5rem; }
    .lang-switcher { padding: .4rem .9rem; font-size: .85rem; }

    .main-nav {
        max-height: calc(100vh - 70px); overflow-y: auto;
        padding: .8rem; box-shadow: 0 10px 20px rgba(0,0,0,.25);
    }
    .main-nav ul { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
    .main-nav a {
        display: block; text-align: center; padding: .7rem .5rem;
        background: rgba(255,255,255,.1);
    }
    .main-nav a.active { background: rgba(255,255,255,.3); }

    .section { padding: 1.5rem 0; min-height: auto; }
    .section-title { font-size: 1.6rem; margin-bottom: 1rem; }
    .hero { padding: 2.5rem 0; }
    .features { padding: 2rem 0; }
    .feature-grid { gap: 1rem; }
    .feature-card { padding: 1.2rem; }
    .subject-tabs, .level-tabs { gap: .5rem; margin-bottom: 1rem; }
    .tab-btn, .level-tab-btn { padding: .55rem 1.2rem; }
}

@media (max-width: 480px) {
    .subject-tabs, .level-tabs { flex-direction: row; flex-wrap: nowrap; }
    .tab-btn, .level-tab-btn { width: auto; flex: 1; padding: .55rem .4rem; }
    .hero-buttons { flex-direction: column; }
    .hero-buttons .btn { width: 100%; }
    .content-card { padding: 1.1rem; }
    .card-actions > * { flex: 1; justify-content: center; text-align: center; }
}

@media (max-width: 380px) {
    .header .logo p { display: none; }
}

/* ----- الوضع الليلي بألوان مصممة ----- */
html.gs-dark, html.gs-dark img, html.gs-dark video, html.gs-dark iframe { filter: none; }
html.gs-dark { color-scheme: dark; background: #0f1a12; }
html.gs-dark body { background: #0f1a12; color: #e4ece5; }

html.gs-dark .header,
html.gs-dark .hero { background: linear-gradient(135deg, #1a3a1b, #3d5e2b); }
html.gs-dark .features { background: #132017; }
html.gs-dark .footer { background: #0a130c; }

html.gs-dark .feature-card,
html.gs-dark .content-card,
html.gs-dark .contact-form,
html.gs-dark .gs-modal-box {
    background: #1a2a1e; color: #e4ece5; box-shadow: 0 2px 12px rgba(0,0,0,.45);
}
html.gs-dark .content-card { border-color: #5fa35a; }

html.gs-dark .section-title,
html.gs-dark .feature-card h3,
html.gs-dark .content-card h3,
html.gs-dark .contact-info h3,
html.gs-dark .contact-form h3,
html.gs-dark .files-count,
html.gs-dark .gs-group-title,
html.gs-dark .content-grid > .loading { color: #9fd89a; }
html.gs-dark .gs-group-title { border-color: #3f7a3a; }

html.gs-dark .content-card p,
html.gs-dark .feature-card p,
html.gs-dark .section-intro,
html.gs-dark .content-grid > .no-files { color: #a9b8ac; }
html.gs-dark .content-card .level-badge { background: #4d6b32; }

html.gs-dark .tab-btn,
html.gs-dark .level-tab-btn,
html.gs-dark .preview-btn { background: transparent; color: #9fd89a; border-color: #4f8a4a; }
html.gs-dark .tab-btn:hover,
html.gs-dark .tab-btn.active,
html.gs-dark .level-tab-btn:hover,
html.gs-dark .level-tab-btn.active,
html.gs-dark .preview-btn:hover { background: #3f7a3a; border-color: #3f7a3a; color: #fff; }

html.gs-dark .card-actions .download-btn,
html.gs-dark .gs-fab { background: #3f7a3a; border-color: #3f7a3a; }
html.gs-dark .btn-primary { color: #1b1b1b; }
html.gs-dark .btn-secondary { background: #1a2a1e; color: #9fd89a; }

html.gs-dark .form-group label { color: #e4ece5; }
html.gs-dark .form-group input,
html.gs-dark .form-group textarea,
html.gs-dark #gs-search-input { background: #0f1a12; color: #e4ece5; border-color: #2f4a35; }
html.gs-dark .form-group input:focus,
html.gs-dark .form-group textarea:focus,
html.gs-dark #gs-search-input:focus { border-color: #5fa35a; }

html.gs-dark .gs-modal-head { border-color: #2f4a35; }
html.gs-dark .gs-close { background: #2f4a35; color: #e4ece5; }
html.gs-dark .gs-open-tab,
html.gs-dark .contact-item a { color: #9fd89a; }

@media (max-width: 768px) {
    html.gs-dark .main-nav { background: #1a3a1b; }
}
/* ===== قائمة "المزيد" المنسدلة ===== */
.nav-more { position: relative; }
.nav-more-btn {
    background: none; border: none; cursor: pointer; color: var(--white);
    font: inherit; font-weight: 600; padding: .45rem .75rem;
    border-radius: var(--border-radius); transition: var(--transition);
}
.nav-more-btn:hover,
.nav-more.open > .nav-more-btn,
.nav-more:has(a.active) > .nav-more-btn { background: rgba(255,255,255,.2); }

.main-nav .nav-submenu {
    display: none; position: absolute; top: 100%; inset-inline-start: 0; z-index: 1001;
    flex-direction: column; gap: .2rem; min-width: 190px; padding: .4rem;
    background: #fff; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.nav-more.open > .nav-submenu { display: flex; }
@media (hover: hover) and (min-width: 769px) {
    .nav-more:hover > .nav-submenu { display: flex; }
}
.main-nav .nav-submenu a {
    display: block; color: var(--primary-color); white-space: nowrap; padding: .5rem .8rem;
}
.main-nav .nav-submenu a:hover,
.main-nav .nav-submenu a.active { background: #e8f2e3; }

/* على الهاتف: تظهر الأقسام مباشرة داخل قائمة ☰ */
@media (max-width: 768px) {
    .nav-more, .main-nav .nav-submenu { display: contents; }
    .nav-more-btn { display: none; }
    .main-nav .nav-submenu a {
        color: var(--white); background: rgba(255,255,255,.1);
        text-align: center; white-space: normal;
    }
    .main-nav .nav-submenu a.active { background: rgba(255,255,255,.3); }
}

/* الوضع الليلي */
html.gs-dark .main-nav .nav-submenu { background: #1a2a1e; }
html.gs-dark .main-nav .nav-submenu a { color: #9fd89a; }
html.gs-dark .main-nav .nav-submenu a:hover,
html.gs-dark .main-nav .nav-submenu a.active { background: #2f4a35; }
/* ===== الدفعة 4: أدوات المراجعة ===== */
.gs-tools {
    display: flex; gap: .4rem; flex-wrap: wrap;
    margin-top: .8rem; padding-top: .6rem; border-top: 1px dashed #dfe7dc;
}
.gs-tool {
    width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
    border: 1px solid #cfdccb; background: #f4f8f2; font-size: 1.05rem; line-height: 1;
}
.gs-tool:hover { background: #e3efde; }
.gs-tool.on { background: #fff4cc; border-color: #e0b400; }
.gs-tool:disabled { opacity: .5; cursor: wait; }
.gs-fav { color: #c99a00; font-size: 1.25rem; }

.content-card .gs-note-preview {
    margin: .6rem 0 0; padding: .5rem .7rem; border-radius: 6px;
    background: #fffbe6; border-inline-start: 3px solid #e0b400;
    color: #555; font-size: .9rem; white-space: pre-wrap;
}

/* نافذة الملاحظات */
#gs-note-modal .gs-modal-box { max-width: 600px; }
.gs-note-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
#gs-note-text {
    width: 100%; min-height: 180px; padding: 12px; resize: vertical;
    font: inherit; border: 2px solid var(--gs-green); border-radius: 10px; outline: none;
}
.gs-note-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.gs-btn {
    padding: .55rem 1.2rem; border-radius: 8px; cursor: pointer;
    border: 2px solid var(--gs-green); font: inherit; font-weight: 600;
}
.gs-btn-main { background: var(--gs-green); color: #fff; }
.gs-btn-ghost { background: transparent; color: var(--gs-green); }
.gs-note-hint { margin: 0; font-size: .8rem; opacity: .7; }

/* فلاتر البحث */
.gs-search-filters {
    display: flex; gap: .5rem; flex-wrap: wrap;
    padding: 10px 16px; border-bottom: 1px solid #e5e5e5;
}
.gs-search-filters select {
    flex: 1 1 140px; padding: .5rem; font: inherit;
    border: 1px solid #cfdccb; border-radius: 8px; background: #fff;
}

/* شريط "نفس المستوى" */
.gs-related {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: .5rem; margin: -.5rem 0 1.5rem;
}
.gs-related:empty { display: none; }
.gs-related span { opacity: .7; font-weight: 600; }
.gs-related a {
    padding: .3rem .8rem; border-radius: 999px; text-decoration: none;
    background: #e8f2e3; color: var(--primary-color); font-size: .9rem; font-weight: 600;
}
.gs-related a:hover { background: var(--primary-color); color: #fff; }

/* العد التنازلي */
.gs-countdown {
    display: inline-block; margin-top: 1.5rem; padding: .6rem 1.2rem;
    border-radius: 999px; background: rgba(255,255,255,.18); font-size: 1.05rem;
}
.gs-countdown[hidden] { display: none; }
.gs-countdown strong { font-size: 1.3rem; color: #ffe082; }

/* زر مشاركة الموقع */
.gs-share-site {
    display: block; margin: 0 auto 1.5rem; padding: .7rem 1.5rem; cursor: pointer;
    border: 2px solid #fff; border-radius: 999px; background: transparent;
    color: #fff; font: inherit; font-weight: 600;
}
.gs-share-site:hover { background: #fff; color: var(--primary-color); }

/* الرسائل القصيرة */
#gs-toast {
    position: fixed; bottom: 24px; left: 50%; z-index: 1100;
    transform: translate(-50%, 200%); transition: transform .3s;
    max-width: 90vw; padding: .7rem 1.2rem; border-radius: 10px; text-align: center;
    background: #1f3a20; color: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.3);
}
#gs-toast.show { transform: translate(-50%, 0); }

/* الوضع الليلي */
html.gs-dark .gs-tools { border-color: #2f4a35; }
html.gs-dark .gs-tool { background: #0f1a12; border-color: #2f4a35; }
html.gs-dark .gs-tool.on { background: #3d3410; border-color: #b8930a; }
html.gs-dark .content-card .gs-note-preview { background: #2a2610; color: #e4ece5; }
html.gs-dark #gs-note-text,
html.gs-dark .gs-search-filters select { background: #0f1a12; color: #e4ece5; border-color: #2f4a35; }
html.gs-dark .gs-search-filters { border-color: #2f4a35; }
html.gs-dark .gs-related a { background: #1a2a1e; color: #9fd89a; }
html.gs-dark .gs-related a:hover { background: #3f7a3a; color: #fff; }
html.gs-dark .gs-btn-main { background: #3f7a3a; border-color: #3f7a3a; }
html.gs-dark .gs-btn-ghost { color: #9fd89a; border-color: #4f8a4a; }
/* ===== الدفعة 5: الاختبارات والفيديوهات ===== */
.gs-quiz-badge {
    display: inline-block; margin-inline-start: .4rem; padding: .15rem .6rem; border-radius: 999px;
    background: #fff4cc; color: #8a6d00; font-size: .75rem; font-weight: 700;
}
.gs-quiz-badge.good { background: #d9f2d4; color: #1f6b1a; }

#gs-quiz-modal .gs-modal-box { max-width: 720px; }
.gs-quiz-body { padding: 18px; overflow-y: auto; flex: 1; min-height: 0; }
.gs-quiz-progress { height: 8px; border-radius: 999px; background: #e5ece3; overflow: hidden; }
.gs-quiz-progress span { display: block; height: 100%; background: var(--gs-green); transition: width .3s; }
.gs-quiz-count { margin: .6rem 0 .2rem; font-size: .85rem; opacity: .7; }
.gs-quiz-question { font-size: 1.15rem; margin: 0 0 1rem; line-height: 1.6; }
.gs-quiz-img { display: block; max-width: 100%; max-height: 45vh; margin: 0 auto 1rem; border-radius: 8px; }
.gs-quiz-choices { display: grid; gap: .6rem; }
.gs-quiz-choice {
    text-align: start; padding: .8rem 1rem; border: 2px solid #cfdccb; border-radius: 10px;
    background: #fff; color: inherit; font: inherit; cursor: pointer; transition: background .2s, border-color .2s;
}
.gs-quiz-choice:hover:not(:disabled) { border-color: var(--gs-green); background: #f4f8f2; }
.gs-quiz-choice:disabled { cursor: default; }
.gs-quiz-choice.correct { border-color: #2e9d3a; background: #e3f6e5; }
.gs-quiz-choice.wrong { border-color: #d93848; background: #fdeaea; }
.gs-quiz-feedback { margin-top: 1rem; padding: .8rem 1rem; border-radius: 10px; }
.gs-quiz-feedback.ok { background: #e3f6e5; }
.gs-quiz-feedback.ko { background: #fdeaea; }
.gs-quiz-feedback p { margin: .4rem 0 0; }
.gs-quiz-nav { margin-top: 1rem; display: flex; justify-content: flex-end; }
.gs-quiz-result { text-align: center; padding: 1rem 0; }
.gs-quiz-score { font-size: 3rem; font-weight: 700; color: var(--gs-green); line-height: 1.2; }
.gs-quiz-pct { font-size: 1.3rem; font-weight: 600; margin: 0 0 .5rem; }
.gs-quiz-best { opacity: .7; font-size: .9rem; }
.gs-quiz-end { justify-content: center; margin-top: 1rem; }
.gs-quiz-review-title { margin: 1.5rem 0 .6rem; color: var(--gs-green); }
.gs-quiz-review {
    padding: .8rem 1rem; margin-bottom: .6rem; border-radius: 10px;
    background: #f7f9f7; border-inline-start: 4px solid #d93848;
}
.gs-quiz-review p { margin: .25rem 0; }
.gs-quiz-review .ko { color: #b3261e; }
.gs-quiz-review .ok { color: #1f6b1a; }
.gs-quiz-expl { font-size: .9rem; opacity: .85; }

/* الفيديو */
.gs-video-btn {
    cursor: pointer; padding: .5rem 1rem; border-radius: 8px; border: 2px solid #c4302b;
    background: transparent; color: #c4302b; font: inherit; font-weight: 600;
}
.gs-video-btn:hover { background: #c4302b; color: #fff; }
.gs-modal-body .gs-video-wrap { width: 100%; aspect-ratio: 16 / 9; background: #000; }
.gs-modal-body .gs-video-wrap iframe { width: 100%; height: 100%; }
.gs-video-parts { display: flex; gap: .4rem; flex-wrap: wrap; padding: 10px 16px; }
.gs-video-part {
    cursor: pointer; padding: .3rem .9rem; border-radius: 999px; border: none;
    background: #e8f2e3; color: var(--primary-color); font: inherit; font-weight: 600;
}
.gs-video-part.active { background: var(--primary-color); color: #fff; }

/* الوضع الليلي */
html.gs-dark .gs-quiz-choice { background: #0f1a12; border-color: #2f4a35; }
html.gs-dark .gs-quiz-choice:hover:not(:disabled) { background: #1f3324; }
html.gs-dark .gs-quiz-choice.correct,
html.gs-dark .gs-quiz-feedback.ok { background: #173d1c; border-color: #3fa34a; }
html.gs-dark .gs-quiz-choice.wrong,
html.gs-dark .gs-quiz-feedback.ko { background: #3d1719; border-color: #c0434f; }
html.gs-dark .gs-quiz-progress { background: #2f4a35; }
html.gs-dark .gs-quiz-review { background: #132017; }
html.gs-dark .gs-quiz-review .ko { color: #f28b82; }
html.gs-dark .gs-quiz-review .ok,
html.gs-dark .gs-quiz-score,
html.gs-dark .gs-quiz-review-title { color: #9fd89a; }
html.gs-dark .gs-video-part { background: #1a2a1e; color: #9fd89a; }
html.gs-dark .gs-video-part.active { background: #3f7a3a; color: #fff; }


/* ===== المرحلة 2: أزرار الشعبة (pathways.js) — نفس ألوان أزرار المستوى ===== */
.gs-track-tabs { display: flex; gap: .5rem; justify-content: center; align-items: center; flex-wrap: wrap; margin-bottom: 1.5rem; }
.gs-track-label { font-weight: 700; color: var(--primary-color); font-size: .95rem; }
.gs-track-btn { padding: .45rem 1.1rem; border: 2px solid var(--primary-color); background-color: var(--white); color: var(--primary-color); border-radius: var(--border-radius); cursor: pointer; font-weight: 600; font-family: 'Cairo', sans-serif; font-size: .9rem; transition: var(--transition); }
.gs-track-btn:hover, .gs-track-btn.active { background-color: var(--primary-color); color: var(--white); }
.gs-track-btn.is-empty:not(.active) { opacity: .6; border-style: dashed; }
.gs-track-n { font-weight: 400; opacity: .85; }
.gs-doc-tag { display: inline-block; margin-bottom: .4rem; padding: .1rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 700; background: #e8f5e9; color: var(--primary-color); }
@media (max-width: 480px) { .gs-track-btn { padding: .4rem .8rem; font-size: .85rem; } }
html.gs-dark .gs-track-label { color: #9fd89a; }
html.gs-dark .gs-track-btn { background: transparent; color: #9fd89a; border-color: #4f8a4a; }
html.gs-dark .gs-track-btn:hover, html.gs-dark .gs-track-btn.active { background: #3f7a3a; border-color: #3f7a3a; color: #fff; }
html.gs-dark .gs-doc-tag { background: #24402a; color: #9fd89a; }


/* ===== حسابات التلاميذ (student-account.js) — نفس ألوان الموقع ===== */
.gs-auth { max-width: 460px; margin: 0 auto; padding: 2rem 1.5rem; background: var(--white); border-radius: var(--border-radius); box-shadow: var(--shadow); text-align: center; }
.gs-auth-icon { font-size: 2.6rem; }
.gs-auth h3 { color: var(--primary-color); margin: .3rem 0 .5rem; }
.gs-auth-lead, .gs-auth-hint { color: #555; font-size: .95rem; margin-bottom: 1rem; }
.gs-auth-note { color: #777; font-size: .82rem; margin-top: 1rem; }
.gs-auth-tabs { display: flex; gap: .5rem; justify-content: center; margin-bottom: 1.2rem; }
.gs-auth-tab { flex: 1; padding: .5rem 1rem; border: 2px solid var(--primary-color); background: var(--white); color: var(--primary-color); border-radius: var(--border-radius); cursor: pointer; font-weight: 600; font-family: 'Cairo', sans-serif; transition: var(--transition); }
.gs-auth-tab:hover, .gs-auth-tab.active { background: var(--primary-color); color: var(--white); }
.gs-auth-form { display: flex; flex-direction: column; gap: .8rem; text-align: start; }
.gs-auth-field { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; color: var(--primary-color); font-size: .9rem; }
.gs-auth-field input, .gs-auth-field select { padding: .6rem .8rem; border: 2px solid #cfd8cf; border-radius: var(--border-radius); font-family: 'Cairo', sans-serif; font-size: 1rem; background: var(--white); color: #222; }
.gs-auth-field input:focus, .gs-auth-field select:focus { outline: none; border-color: var(--primary-color); }
.gs-auth-check { display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: #444; cursor: pointer; }
.gs-auth-msg { min-height: 1.2em; margin: 0; color: #c0392b; font-weight: 600; font-size: .88rem; }
.gs-auth-submit { padding: .65rem 1rem; border: none; border-radius: var(--border-radius); background: var(--primary-color); color: var(--white); font-weight: 700; font-family: 'Cairo', sans-serif; font-size: 1rem; cursor: pointer; transition: var(--transition); }
.gs-auth-submit:hover:not(:disabled) { opacity: .9; }
.gs-auth-submit:disabled { opacity: .5; cursor: not-allowed; }
.gs-auth-link { background: none; border: none; color: var(--primary-color); text-decoration: underline; cursor: pointer; font-family: 'Cairo', sans-serif; font-size: .9rem; padding: .2rem; }
.gs-auth-modal { position: fixed; inset: 0; z-index: 10000; background: rgba(0, 0, 0, .55); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.gs-auth-modal-box { background: var(--white); max-width: 440px; width: 100%; border-radius: var(--border-radius); padding: 1.5rem; text-align: center; display: flex; flex-direction: column; gap: .8rem; }
.gs-auth-modal-box h3 { color: var(--primary-color); margin: 0; }
.gs-auth-code { font-family: monospace; font-size: 1.5rem; font-weight: 700; letter-spacing: .08em; padding: .8rem; background: #f2f7f2; border: 2px dashed var(--primary-color); border-radius: var(--border-radius); user-select: all; }
.gs-acc-wrap { display: flex; flex-direction: column; gap: .6rem; flex: 1 1 100%; }
.gs-acc-bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; }
.gs-acc-who { color: var(--primary-color); font-size: 1.05rem; }
.gs-acc-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.gs-acc-btn { padding: .4rem .9rem; border: 2px solid var(--primary-color); background: var(--white); color: var(--primary-color); border-radius: var(--border-radius); cursor: pointer; font-weight: 600; font-family: 'Cairo', sans-serif; font-size: .85rem; transition: var(--transition); }
.gs-acc-btn:hover { background: var(--primary-color); color: var(--white); }
.gs-acc-panel { display: flex; flex-direction: column; gap: .6rem; max-width: 360px; padding: 1rem; border: 1px solid #dfe8df; border-radius: var(--border-radius); }
.gs-acc-panel[hidden] { display: none; }
html.gs-dark .gs-auth, html.gs-dark .gs-auth-modal-box { background: #1b261c; }
html.gs-dark .gs-auth h3, html.gs-dark .gs-auth-field, html.gs-dark .gs-auth-modal-box h3, html.gs-dark .gs-acc-who, html.gs-dark .gs-auth-link { color: #9fd89a; }
html.gs-dark .gs-auth-lead, html.gs-dark .gs-auth-hint, html.gs-dark .gs-auth-check, html.gs-dark .gs-auth-note, html.gs-dark .gs-auth-modal-box p { color: #c5d3c5; }
html.gs-dark .gs-auth-field input, html.gs-dark .gs-auth-field select { background: #121b13; color: #e8f1e8; border-color: #3d5a3e; }
html.gs-dark .gs-auth-tab, html.gs-dark .gs-acc-btn { background: transparent; color: #9fd89a; border-color: #4f8a4a; }
html.gs-dark .gs-auth-tab:hover, html.gs-dark .gs-auth-tab.active, html.gs-dark .gs-acc-btn:hover { background: #3f7a3a; border-color: #3f7a3a; color: #fff; }
html.gs-dark .gs-auth-code { background: #121b13; border-color: #4f8a4a; color: #e8f1e8; }
html.gs-dark .gs-acc-panel { border-color: #3d5a3e; }
html.gs-dark .gs-auth-msg { color: #ff8a80; }


/* Continue-learning dashboard card */
.gs-continue-card{margin:1rem 0 1.35rem;padding:1.2rem;border:1px solid #dce9d8;border-radius:18px;background:linear-gradient(145deg,#f8fbf6,#fff);box-shadow:0 5px 18px rgba(24,57,37,.05);color:#294d36}
.gs-continue-heading{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:.8rem}
.gs-continue-heading h3{margin:.25rem 0;color:#244d37;font-size:1.12rem}
.gs-continue-eyebrow{font-size:.7rem;font-weight:800;letter-spacing:.06em;color:#638c5e}
.gs-continue-mark{display:grid;place-items:center;width:44px;height:44px;border-radius:13px;background:#eaf4e7;font-size:1.5rem}
.gs-continue-item,.gs-continue-next{display:flex;align-items:center;gap:.8rem;padding:.9rem;margin:.6rem 0;border:1px solid #e5ece2;border-radius:13px;background:#fff}
.gs-continue-icon{font-size:1.5rem}
.gs-continue-copy,.gs-continue-next>div{display:flex;flex:1;min-width:0;flex-direction:column;gap:.2rem}
.gs-continue-copy small,.gs-continue-next small{color:#718074;font-size:.75rem}
.gs-continue-copy strong,.gs-continue-next strong{line-height:1.5;overflow-wrap:anywhere}
.gs-continue-copy span,.gs-continue-next span{color:#788579;font-size:.78rem}
.gs-continue-action,.gs-continue-next>a,.gs-continue-empty>a{flex:0 0 auto;padding:.65rem .85rem;border-radius:10px;background:#236b43;color:#fff!important;text-decoration:none;font-weight:700;font-size:.83rem}
.gs-continue-next>span{font-size:1.4rem}
.gs-continue-empty{display:flex;align-items:center;gap:.8rem;padding:.9rem;border:1px dashed #d9e6d5;border-radius:13px}
.gs-continue-empty>span{font-size:1.5rem}
.gs-continue-empty p{flex:1;margin:0;color:#68796b;line-height:1.7}
.gs-continue-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) 2fr;gap:.6rem;margin-top:.8rem}
.gs-continue-stats>div{display:flex;flex-direction:column;gap:.2rem;padding:.7rem;border-radius:11px;background:#f1f6ee}
.gs-continue-stats>div>strong{font-size:1.2rem;color:#236b43}
.gs-continue-stats>div>span{font-size:.72rem;color:#68796b}
.gs-continue-progress>div{display:flex;justify-content:space-between;gap:.4rem}
.gs-continue-progress i{height:7px;margin-top:.55rem;overflow:hidden;border-radius:8px;background:#dfe9dc}
.gs-continue-progress i b{display:block;height:100%;border-radius:8px;background:#5d9a58}
@media(max-width:650px){.gs-continue-stats{grid-template-columns:repeat(3,minmax(0,1fr))}.gs-continue-progress{grid-column:1/-1}.gs-continue-item,.gs-continue-next{align-items:flex-start;flex-wrap:wrap}.gs-continue-action,.gs-continue-next>a{margin-inline-start:auto}.gs-continue-empty{flex-wrap:wrap}}
html.gs-dark .gs-continue-card{background:#1b2a20;border-color:#3d5a3e;color:#e5efe4}
html.gs-dark .gs-continue-heading h3,html.gs-dark .gs-continue-copy strong,html.gs-dark .gs-continue-next strong{color:#d9efcf}
html.gs-dark .gs-continue-item,html.gs-dark .gs-continue-next{background:#17231b;border-color:#3d5a3e}
html.gs-dark .gs-continue-stats>div{background:#24372a}


/* Academic path lock: hide other levels and tracks for signed-in students. */
.gs-academic-locked .level-tab-btn[hidden],
.gs-academic-locked .gs-track-btn[hidden],
.gs-academic-locked .gs-track-label[hidden] {
    display: none !important;
}
.gs-academic-profile {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem .7rem;
    margin: .85rem 0 1rem;
    padding: .8rem 1rem;
    border: 1px solid #d8e8d3;
    border-inline-start: 4px solid #2d7a43;
    border-radius: 12px;
    background: #f3f8f0;
    color: #294d36;
}
.gs-academic-profile span { font-weight: 700; }
.gs-academic-profile strong { color: #236b43; }
.gs-academic-profile small { opacity: .8; }
.gs-academic-notice {
    padding: .9rem 1rem;
    border: 1px solid #e7c875;
    border-radius: 10px;
    background: #fff8e6;
    color: #674d13;
    line-height: 1.7;
}
html.gs-dark .gs-academic-profile {
    background: #1b2a20;
    border-color: #3d5a3e;
    color: #e5efe4;
}
html.gs-dark .gs-academic-profile strong { color: #9fd89a; }
html.gs-dark .gs-academic-notice {
    background: #382e17;
    border-color: #80672a;
    color: #f5df9b;
}


/* ===== تحسينات الوصول وتجربة الهاتف لمساحة التلميذ ===== */
/* إبراز واضح للتنقل بلوحة المفاتيح دون التأثير على النقر العادي */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid #e0a526;
    outline-offset: 3px;
}
:where(a, button, input, select, textarea) {
    scroll-margin-block: 6rem;
}
#student-space-content button,
#student-space-content a,
#student-space-content input,
#student-space-content select {
    -webkit-tap-highlight-color: rgba(45, 90, 39, .16);
}
#student-space-content button,
#student-space-content .gs-tool,
#student-space-content .gs-acc-btn,
#student-space-content .gs-auth-tab {
    touch-action: manipulation;
}
.gs-continue-card {
    min-width: 0;
    overflow-wrap: anywhere;
}
.gs-continue-action,
.gs-continue-next > a,
.gs-continue-empty > a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
@media (max-width: 520px) {
    .gs-continue-card { padding: .9rem; border-radius: 14px; }
    .gs-continue-heading { align-items: flex-start; }
    .gs-continue-heading h3 { font-size: 1rem; line-height: 1.6; }
    .gs-continue-mark { width: 38px; height: 38px; flex: 0 0 auto; }
    .gs-continue-item,
    .gs-continue-next { gap: .65rem; padding: .75rem; }
    .gs-continue-copy,
    .gs-continue-next > div { flex: 1 1 calc(100% - 2.5rem); }
    .gs-continue-action,
    .gs-continue-next > a { width: 100%; margin: .2rem 0 0; }
    .gs-continue-stats { gap: .4rem; }
    .gs-continue-stats > div { padding: .55rem .4rem; text-align: center; }
    .gs-continue-stats > div > strong { font-size: 1.05rem; }
    .gs-continue-stats > div > span { font-size: .68rem; line-height: 1.45; }
}
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
html.gs-dark :where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline-color: #f4c95d;
}


/* Prevent the previous student's workspace from flashing or accepting input
   while Supabase switches to another authenticated account. */
body.gs-account-switching #student-space-content {
    visibility: hidden !important;
    pointer-events: none !important;
}


/* ===== Dashboard cards: compact mobile layout and accessible actions ===== */
#student-space-content .gs-continue-card,
#student-space-content .gs-performance-analytics {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
#student-space-content .gs-continue-card *,
#student-space-content .gs-performance-analytics * {
    box-sizing: border-box;
}
#student-space-content .gs-continue-progress i {
    display: block;
    width: 100%;
}
#student-space-content .gs-pa-chart-wrap {
    max-width: 100%;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}
#student-space-content .gs-pa-chart { height: auto; }
#student-space-content .gs-pa-review {
    min-height: 44px;
    padding: .65rem .85rem;
}
@media (max-width: 520px) {
    #student-space-content .gs-continue-item,
    #student-space-content .gs-continue-next { min-width: 0; }
    #student-space-content .gs-continue-copy,
    #student-space-content .gs-continue-next > div,
    #student-space-content .gs-pa-focus-copy { overflow-wrap: anywhere; }
    #student-space-content .gs-continue-empty p { min-width: 0; }
    #student-space-content .gs-pa-heading { gap: .65rem; }
    #student-space-content .gs-pa-icon {
        flex-basis: 40px;
        width: 40px;
        height: 40px;
    }
    #student-space-content .gs-pa-metrics > div {
        min-width: 0;
        padding: .7rem;
    }
    #student-space-content .gs-pa-metrics strong {
        font-size: clamp(1.15rem, 6vw, 1.45rem);
    }
    #student-space-content .gs-pa-focus-item {
        min-width: 0;
        gap: .55rem;
    }
    #student-space-content .gs-pa-review {
        width: 100%;
        margin: .25rem 0 0;
        white-space: normal;
    }
    #student-space-content .gs-pa-no-focus {
        align-items: flex-start;
        flex-wrap: wrap;
    }
    #student-space-content .gs-pa-no-focus p {
        min-width: 0;
        flex: 1 1 calc(100% - 2.5rem);
    }
    #student-space-content .gs-pa-no-focus a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}
@media (max-width: 360px) {
    #student-space-content .gs-continue-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    #student-space-content .gs-continue-progress { grid-column: 1 / -1; }
    #student-space-content .gs-continue-stats > div > span { font-size: .72rem; }
}
html.gs-dark #student-space-content .gs-pa-review {
    background: #34794b;
    color: #fff;
}


/* Private manager registry inside the authenticated Mon espace account */
.gs-manager-space{max-width:1100px;margin:0 auto;padding:12px 0 30px}
.gs-manager-hero{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:26px;border-radius:22px;background:linear-gradient(125deg,#153f36,#24745a);color:#fff;margin-bottom:20px;box-shadow:0 12px 32px rgba(20,65,52,.16)}
.gs-manager-kicker{font-size:.72rem;letter-spacing:.12em;font-weight:800;opacity:.8}
.gs-manager-hero h3{color:#fff;margin:8px 0;font-size:1.55rem}
.gs-manager-hero p{margin:0;opacity:.88}
.gs-manager-icon{font-size:3rem;background:rgba(255,255,255,.13);border-radius:18px;padding:12px}
.gs-manager-card{background:var(--card-bg,#fff);border:1px solid rgba(100,130,120,.2);border-radius:20px;padding:22px;box-shadow:0 8px 24px rgba(30,60,50,.07)}
.gs-manager-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}
.gs-manager-heading h4{margin:0 0 5px;font-size:1.2rem}.gs-manager-heading p{margin:0;color:var(--text-muted,#718078);font-size:.9rem}
.gs-manager-refresh{border:0;border-radius:12px;padding:10px 15px;background:#e7f3ed;color:#18543e;font-weight:700;cursor:pointer}
.gs-manager-stats{display:flex;gap:12px;margin:20px 0}
.gs-manager-stats>div{flex:1;padding:14px;border-radius:14px;background:rgba(45,120,85,.08);display:flex;flex-direction:column;gap:3px}
.gs-manager-stats strong{font-size:1.6rem;color:#23734f}.gs-manager-stats span,.gs-manager-status{font-size:.86rem;color:var(--text-muted,#718078)}
.gs-manager-tools{display:grid;grid-template-columns:2fr 1fr;gap:10px;margin:14px 0}
.gs-manager-tools input,.gs-manager-tools select{width:100%;min-width:0;padding:12px;border:1px solid #d7e2dc;border-radius:12px;background:var(--card-bg,#fff);color:inherit;font:inherit}
.gs-manager-list{display:grid;gap:10px}
.gs-manager-student{display:flex;justify-content:space-between;gap:18px;padding:15px;border:1px solid rgba(110,140,125,.2);border-radius:14px}
.gs-manager-identity,.gs-manager-academic{display:flex;flex-direction:column;gap:5px;min-width:0}
.gs-manager-identity a{overflow-wrap:anywhere;color:#287653}.gs-manager-student small{font-size:.78rem;color:var(--text-muted,#718078)}
.gs-manager-academic{align-items:flex-end;text-align:end}.gs-manager-academic span{font-weight:700;font-size:.9rem}
.gs-manager-academic .is-confirmed{color:#23834e}.gs-manager-academic .is-pending{color:#a36b16}
.gs-manager-empty{padding:18px;text-align:center;color:var(--text-muted,#718078)}
@media(max-width:650px){.gs-manager-hero{padding:18px}.gs-manager-hero h3{font-size:1.2rem}.gs-manager-icon{font-size:2rem}.gs-manager-tools{grid-template-columns:1fr}.gs-manager-student{flex-direction:column}.gs-manager-academic{align-items:flex-start;text-align:start}.gs-manager-heading{align-items:flex-start}}


.gs-quiz-image-fallback {
    margin: .75rem 0 1rem;
    padding: .8rem 1rem;
    border: 1px dashed #b8c9bb;
    border-radius: 12px;
    background: #f3f7f3;
    color: #53675a;
    text-align: center;
    line-height: 1.6;
}


/* Metadata labels for national exam resources */
.exam-metadata{display:flex;flex-wrap:wrap;gap:.4rem;margin:.55rem 0 .7rem}
.exam-meta-badge{display:inline-flex;align-items:center;padding:.28rem .62rem;border:1px solid #dce7df;border-radius:999px;background:#f4f8f4;color:#365b43;font-size:.76rem;font-weight:700;line-height:1.45}
.exam-meta-badge.exam-year{background:#eef3fa;border-color:#d8e2f1;color:#385879;font-variant-numeric:tabular-nums}
.exam-meta-badge.exam-session{background:#f6f2e9;border-color:#e9dfc8;color:#765b24}
.exam-meta-badge.exam-subject{background:#edf6ef;border-color:#d5e8d9;color:#28633c}
.exam-meta-badge.exam-correction{background:#f1eff8;border-color:#dfd9ef;color:#5b4b86}
html.gs-dark .exam-meta-badge{background:#26352c;border-color:#405648;color:#d9eadc}
html.gs-dark .exam-meta-badge.exam-year{background:#263448;border-color:#3d5574;color:#d5e4f8}
html.gs-dark .exam-meta-badge.exam-session{background:#403824;border-color:#645638;color:#f0dfb5}
html.gs-dark .exam-meta-badge.exam-subject{background:#233b2b;border-color:#3d6548;color:#d1ecd7}
html.gs-dark .exam-meta-badge.exam-correction{background:#332d45;border-color:#51456e;color:#e0d8f5}


/* Exam library filters */
.gs-exam-filters{display:flex;align-items:end;flex-wrap:wrap;gap:.7rem;padding:1rem;margin:.8rem 0 1rem;border:1px solid #dce8dc;border-radius:15px;background:#f7faf6}
.gs-exam-filter{display:flex;flex:1 1 150px;min-width:130px;flex-direction:column;gap:.3rem;color:#355b40;font-size:.82rem;font-weight:700}
.gs-exam-filter select{width:100%;min-height:42px;padding:.55rem .7rem;border:1px solid #cbdacb;border-radius:9px;background:#fff;color:#263b2b;font:inherit}
.gs-exam-reset{min-height:42px;padding:.55rem .9rem;border:1px solid #39764a;border-radius:9px;background:#fff;color:#28633c;font:inherit;font-weight:700;cursor:pointer}
.gs-exam-reset:hover{background:#28633c;color:#fff}
.gs-exam-filter-empty{padding:1rem;border:1px dashed #d3dfd2;border-radius:12px;color:#68796b;text-align:center}
.file-resource-card[hidden],.track-content-group[hidden]{display:none!important}
html.gs-dark .gs-exam-filters{background:#1b2a20;border-color:#3d5a3e}
html.gs-dark .gs-exam-filter{color:#cce5c9}
html.gs-dark .gs-exam-filter select{background:#142018;border-color:#49634d;color:#e6f1e5}
html.gs-dark .gs-exam-reset{background:#1b2a20;color:#b9e3b3;border-color:#56845b}
html.gs-dark .gs-exam-reset:hover{background:#34794b;color:#fff}
html.gs-dark .gs-exam-filter-empty{border-color:#49634d;color:#c5d3c5}
@media(max-width:520px){.gs-exam-filters{align-items:stretch;gap:.55rem;padding:.75rem}.gs-exam-filter{flex-basis:100%}.gs-exam-reset{width:100%}}


/* Student dashboard: compact quick-access shortcuts */
.gs-student-quick-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.75rem;margin:1rem 0 1.25rem}
.gs-student-quick-actions a{display:flex;align-items:center;justify-content:center;gap:.55rem;min-height:54px;padding:.75rem 1rem;border:1px solid #d9e8d8;border-radius:14px;background:linear-gradient(135deg,#f8fbf7,#edf6ed);color:#285b36;text-decoration:none;font-weight:700;transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease}
.gs-student-quick-actions a:hover{transform:translateY(-2px);border-color:#91bd91;box-shadow:0 6px 18px rgba(40,91,54,.09)}
.gs-student-quick-actions a:focus-visible{outline:3px solid #7db3e8;outline-offset:3px}
.gs-student-quick-actions a span{font-size:1.25rem}
.gs-student-quick-actions a strong{font-size:.9rem}
html[dir="ltr"] .gs-student-quick-actions a{flex-direction:row}
html.gs-dark .gs-student-quick-actions a{background:linear-gradient(135deg,#203328,#263e2d);border-color:#405d45;color:#d9f0d9}
@media(max-width:640px){.gs-student-quick-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:.6rem}.gs-student-quick-actions a{min-height:48px;padding:.6rem}}


/* Student dashboard: guided next learning step */
.gs-next-step-card{display:flex;align-items:flex-start;gap:.9rem;margin:.85rem 0;padding:1rem;border:1px solid #cfe2cf;border-radius:16px;background:linear-gradient(135deg,#f5fbf5,#eaf5ed);color:#284b31}
.gs-next-step-icon{display:grid;place-items:center;flex:0 0 46px;width:46px;height:46px;border-radius:13px;background:#dcefe0;font-size:1.45rem}
.gs-next-step-copy{min-width:0;flex:1}
.gs-next-step-copy strong{display:block;font-size:1rem}
.gs-next-step-copy p{margin:.35rem 0 .65rem;line-height:1.6;color:#506a54}
.gs-next-step-copy a{display:inline-flex;align-items:center;gap:.35rem;font-weight:700;color:#24613a;text-decoration:none}
.gs-next-step-copy a:hover{text-decoration:underline}
html.gs-dark .gs-next-step-card{background:linear-gradient(135deg,#203328,#263e2d);border-color:#405d45;color:#d9f0d9}
html.gs-dark .gs-next-step-icon{background:#344d3b}
html.gs-dark .gs-next-step-copy p{color:#c0d5c2}
html.gs-dark .gs-next-step-copy a{color:#bce5bd}
@media(max-width:520px){.gs-next-step-card{gap:.7rem;padding:.85rem}.gs-next-step-icon{flex-basis:40px;width:40px;height:40px}}


/* Exam library: distinguish subjects from corrections */
.gs-exam-kind-title{
    grid-column:1 / -1;
    width:100%;
    margin:.45rem 0 .15rem;
    padding:.35rem .7rem;
    border-inline-start:2px solid var(--gs-green,#39764a);
    color:var(--gs-green,#39764a);
    font-size:.88rem;
    font-weight:700;
    line-height:1.5;
}
html.gs-dark .gs-exam-kind-title{color:#b9dfbd;border-inline-start-color:#78ad7e}


/* البحث بالكلمات المفتاحية داخل مكتبة الامتحانات */
.gs-exam-filters {
    display: flex; align-items: end; flex-wrap: wrap; gap: .75rem;
    grid-column: 1 / -1; margin: 0 0 1rem; padding: 1rem;
    border: 1px solid rgba(45,90,39,.2); border-radius: 12px;
    background: rgba(45,90,39,.045);
}
.gs-exam-search {
    display: flex; flex: 1 1 260px; flex-direction: column; gap: .35rem;
    min-width: min(100%, 220px); font-weight: 600;
}
.gs-exam-search input, .gs-exam-filter select {
    min-height: 42px; width: 100%; padding: .55rem .7rem;
    border: 1px solid #9aaa96; border-radius: 8px;
    background: #fff; color: #222; font: inherit;
}
.gs-exam-filter { display: flex; flex: 0 1 150px; flex-direction: column; gap: .35rem; }
.gs-exam-filter span { font-weight: 600; }
.gs-exam-reset {
    min-height: 42px; padding: .55rem .9rem; border: 1px solid var(--gs-green);
    border-radius: 8px; background: var(--gs-green); color: #fff;
    font: inherit; font-weight: 600; cursor: pointer;
}
.gs-exam-reset:hover { filter: brightness(.92); }
.gs-exam-filter-empty { grid-column: 1 / -1; padding: 1rem; text-align: center; opacity: .75; }
html.gs-dark .gs-exam-filters { background: #17271b; border-color: #35583a; }
html.gs-dark .gs-exam-search input, html.gs-dark .gs-exam-filter select {
    background: #0f1a12; color: #e4ece5; border-color: #426348;
}
@media (max-width: 600px) {
    .gs-exam-filters { align-items: stretch; }
    .gs-exam-search, .gs-exam-filter { flex: 1 1 100%; }
    .gs-exam-reset { width: 100%; }
}
