@charset "UTF-8";
/* ============================================================
   Mobile app shell — phones only (loaded with media="(max-width: 767.98px)").
   Same colour system as the web theme; the layout is app-native.
   ============================================================ */

:root {
    --tabbar-h: 60px;
    --appbar-h: 56px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);
}

body {
    padding-bottom: calc(var(--tabbar-h) + var(--safe-b));
    background: var(--surface-2);
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: contain;
}

/* ---------- 1. App bar ---------- */
.navbar.navbar-expand {
    min-height: var(--appbar-h);
    padding-top: var(--safe-t);
    background: rgba(255,255,255,.92) !important;
    border-bottom: 1px solid var(--line) !important;
}
.navbar .container { min-height: var(--appbar-h); gap: .25rem; padding-inline: 14px; }
.navbar-brand img { height: 30px; }
.navbar-brand { margin-inline-end: 0; }

/* the desktop action cluster lives in the tab bar / overlay menu now */
.navbar .navbar-btn,
.navbar .nav-item .btn[href$="/login"],
.navbar .nav-item .btn[href$="/register"],
.navbar .main-menu { display: none !important; }

/* keep language + notifications reachable, push them to the end */
.navbar .navbar-nav.ms-auto,
.navbar .user-navbar { margin-inline-start: auto !important; }

.burger-btn.d-block, .navbar .burger-btn.d-block {
    width: 40px; height: 40px; margin-inline-end: .15rem;
}

/* a search affordance that opens the overlay (which holds the field) */
.appbar-search {
    display: inline-flex !important;
    align-items: center; justify-content: center;
    width: 40px; height: 40px;
    border-radius: 50%;
    color: var(--ink-2);
    flex: 0 0 auto;
}
.appbar-search:active { background: var(--surface-3); }

/* ---------- 2. Bottom tab bar ---------- */
.mobile-tabbar {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 1040;
    display: flex;
    align-items: stretch;
    height: calc(var(--tabbar-h) + var(--safe-b));
    padding-bottom: var(--safe-b);
    background: rgba(255,255,255,.93);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -1px 12px rgba(14,21,36,.05);
}
.mobile-tab {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--muted);
    font-size: .6875rem;
    font-weight: 600;
    text-decoration: none;
    position: relative;
    min-width: 0;
    transition: color .18s var(--ease);
}
.mobile-tab .bi { font-size: 1.32rem; line-height: 1; }
.mobile-tab .mobile-tab-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-inline: 2px;
}
.mobile-tab:active { color: var(--brand); }
.mobile-tab.is-active { color: var(--brand); }
/* active pill indicator */
.mobile-tab.is-active::before {
    content: "";
    position: absolute;
    top: 6px;
    width: 34px; height: 26px;
    border-radius: var(--r-full);
    background: var(--brand-50);
    z-index: -1;
}
.mobile-tab-avatar {
    width: 24px; height: 24px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color .18s var(--ease);
}
.mobile-tab-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mobile-tab.is-active .mobile-tab-avatar { border-color: var(--brand); }

/* the overlay menu must clear the tab bar */
#sidebar { z-index: 2000; }

/* ---------- 3. Screen rhythm ---------- */
.container, .container-fluid, .masaqy-container { padding-inline: 16px; }
.masaqy-container { padding-block: 1.25rem; }
.primary-section, .light-section { padding-block: 1.75rem; }
.primary-section { background: var(--surface-2); }
.light-section { background: var(--surface); }

/* ---------- 4. Hero as an app header card ---------- */
.masaqy-intro .intro-bg { padding-block: 1.75rem 2rem; }
.masaqy-intro h3 {
    font-size: 1.5rem;
    line-height: 1.35;
    max-width: none;
    margin-block-end: .6rem;
}
.masaqy-intro p {
    font-size: .9375rem;
    line-height: 1.75;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-actions { margin-block-start: 1.35rem; gap: .6rem; }
.hero-actions .btn { flex: 1 1 auto; padding: .8rem 1rem; font-size: .9375rem; }
.hero-stats {
    margin-block-start: 1.5rem; padding-block-start: 1.25rem;
    gap: 0;
    justify-content: space-between;
}
.hero-stat { flex: 1 1 0; text-align: center; }
.hero-stat .hero-stat-num { font-size: 1.25rem; }
.hero-stat .hero-stat-label { font-size: .72rem; }

/* ---------- 5. Section headers ---------- */
.section-title {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem;
    margin-block-end: 1rem;
}
.section-title h1 { font-size: 1.1875rem; }
.section-title .section-sub { display: none; }
.section-title .section-link { font-size: .8125rem; }

/* ---------- 6. Horizontal rails instead of stacked grids ---------- */
.courses-group > .row,
.articles-group > .row,
.categories-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-inline-start: 16px;
    -webkit-overflow-scrolling: touch;
    margin-inline: -16px;
    padding-inline: 16px;
    padding-block-end: .35rem;
    scrollbar-width: none;
    --bs-gutter-x: .85rem;
}
.courses-group > .row::-webkit-scrollbar,
.articles-group > .row::-webkit-scrollbar,
.categories-row::-webkit-scrollbar { display: none; }

.courses-group > .row > [class*="col-"],
.articles-group > .row > [class*="col-"],
.categories-row > [class*="col-"] {
    flex: 0 0 auto;
    width: 76%;
    max-width: 280px;
    scroll-snap-align: start;
}
.categories-row > [class*="col-"] { width: 62%; max-width: 220px; }

/* a single-item rail should not look like a broken grid */
.courses-group > .row > [class*="col-"]:only-child,
.articles-group > .row > [class*="col-"]:only-child { width: 76%; }

/* ---------- 7. Cards ---------- */
.courses-group .course-card,
.articles-group .article-card,
.category-block {
    border-radius: var(--r-lg);
    box-shadow: var(--sh-sm);
    border-color: var(--line-2);
}
.courses-group .course-card:active,
.articles-group .article-card:active,
.category-block:active { transform: scale(.985); }
.courses-group .course-card:hover,
.articles-group .article-card:hover,
.category-block:hover { transform: none; box-shadow: var(--sh-sm); }
.courses-group .course-card .course-title { font-size: .95rem; min-height: 2.8em; }
.category-block .category-cover { height: 130px; }

/* ---------- 8. Listing pages ---------- */
.page-heading { padding-block: 1.25rem 1.1rem; }
.page-heading h1 { font-size: 1.375rem; }
.page-heading .sub-title {
    font-size: .875rem; line-height: 1.7;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* the filter sidebar is an offcanvas on phones — the toolbar becomes the control */
.course-group-head {
    position: sticky;
    top: var(--appbar-h);
    z-index: 5;
    flex-direction: row;
    align-items: center;
    border-radius: var(--r);
    padding: .6rem .75rem;
    margin-bottom: 1rem;
}
/* results stack full width on listing pages, not a rail */
.masaqy-container .courses-group > .row {
    flex-wrap: wrap;
    overflow: visible;
    margin-inline: 0;
    padding-inline: 0;
    --bs-gutter-x: .85rem;
    --bs-gutter-y: .85rem;
}
.masaqy-container .courses-group > .row > [class*="col-"] { width: 100%; max-width: none; }

/* ---------- 9. Course detail ---------- */
.course-heading { padding-block: 1.5rem 1.75rem; min-height: 0; }
.course-heading h1 { font-size: 1.375rem; max-width: none; }
.course-heading .sub-title { font-size: .9375rem; }
.course-sidebar { margin-top: 1rem; border-radius: var(--r-lg); }
.course-navbar { top: var(--appbar-h); }
.course-navbar .navbar-nav {
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
    flex-wrap: nowrap;
}
.course-navbar .navbar-nav::-webkit-scrollbar { display: none; }
.course-navbar .navbar-nav .nav-link { padding: .8rem .7rem; font-size: .875rem; white-space: nowrap; }
.course-details .card-body { padding: 1.1rem; }
.course-details ul.course-outputs-list li { width: 100%; }

/* sticky enrol bar, docked above the tab bar */
.course-sidebar .btn.btn-outline-primary {
    position: fixed;
    inset-inline: 12px;
    bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px);
    z-index: 1035;
    width: auto;
    box-shadow: 0 8px 24px rgba(14,21,36,.18);
    padding-block: .85rem;
}
body:has(.course-sidebar) { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 72px); }

/* ---------- 10. Forms & auth screens ---------- */
.card { border-radius: var(--r-lg); }
.auth-card, .login-card { padding: 1.5rem 1.25rem; border-radius: var(--r-lg); }
/* 16px minimum stops iOS zooming the viewport on focus */
.form-control, .form-select { font-size: 1rem; padding: .8rem .95rem; border-radius: var(--r); }
.form-control-lg { font-size: 1rem; }
.btn { padding: .7rem 1.1rem; }
.btn-lg { padding: .85rem 1.25rem; }

/* ---------- 11. Settings / profile as grouped rows ---------- */
.side-navigation {
    position: static;
    padding: .35rem;
    margin-bottom: 1rem;
    border-radius: var(--r-lg);
}
.side-navigation .nav-link { padding: .85rem .8rem; font-size: 1rem; }
.side-navigation .nav-link .bi { font-size: 1.15rem; }

.profile-stats { margin-inline-end: 1.5rem; }
.profile-stats .profile-stats-number { font-size: 1.15rem; }

.flex-table-cell { padding: .75rem .85rem; font-size: .875rem; }

/* ---------- 12. Footer collapses to a slim strip — the tab bar is the nav ---------- */
.footer { padding-block: 1.5rem 0; text-align: center; }
.footer .row { --bs-gutter-y: 0; }
.footer .row > [class*="col-"] { margin-bottom: 0; }
/* the brand block, description and section titles all duplicate the app chrome */
.footer .footer-logo,
.footer .footer-contact,
.footer .footer-about,
.footer .footer-title,
.footer .social-media-icons { display: none; }
.footer .footer-links {
    flex-direction: row; flex-wrap: wrap; justify-content: center;
    gap: .5rem 1.1rem; margin-bottom: .35rem;
}
.footer .footer-links li { font-size: .8125rem; }
.footer .footer-links li a { color: rgba(255,255,255,.62); }
.footer .footer-bottom {
    flex-direction: column; align-items: center; gap: .25rem;
    margin-block-start: 1.1rem; padding-block: 1rem;
}
.footer .copyright { font-size: .75rem; text-align: center; }

/* ---------- 13. Touch behaviour ---------- */
a, button, .btn, .nav-link, .sidebar-link, .mobile-tab { -webkit-tap-highlight-color: transparent; }
.dropdown-menu { border-radius: var(--r); }
.empty-state { padding: 2.25rem 1rem; }

.navbar.navbar-expand{z-index:1060;}
.navbar .dropdown-menu{z-index:1065;}

/* hero copy on phones: first paragraph + tagline only, the rest stays for larger screens */
.masaqy-intro .hero-copy { margin-block-end: 1.25rem; }
.masaqy-intro .hero-copy p + p:not(.hero-tagline) { display: none; }
.masaqy-intro .hero-copy .hero-tagline { -webkit-line-clamp: 2; font-size: 1rem; margin-block-start: .85rem; }

/* cookie notice sits above the tab bar */
.cookie-consent { inset-inline: .75rem; width: auto; max-width: none; bottom: calc(var(--tabbar-h) + var(--safe-b) + .75rem); padding: 1rem; }
