/* Learn Fikra Smart — course window (js/tools/LearnFikra.js). Loaded after the theme files; scoped to .lf-overlay. */

.lf-overlay {
    position: fixed; inset: 0; z-index: 2147483640;
    display: flex; align-items: center; justify-content: center; padding: 16px;
    background: rgba(2, 6, 23, 0.6);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    opacity: 0; transition: opacity .2s ease;
    font-family: 'Outfit', 'Cairo', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}
.lf-overlay[dir="rtl"] { font-family: 'Cairo', 'Outfit', system-ui, sans-serif; }
.lf-overlay.show { opacity: 1; }
.lf-overlay * { box-sizing: border-box; }
.lf-overlay h2, .lf-overlay h3, .lf-overlay h4, .lf-overlay p, .lf-overlay ul { margin: 0; }
.lf-overlay h2, .lf-overlay h3, .lf-overlay h4, .lf-overlay b { -webkit-text-fill-color: currentColor !important; }

.lf-window {
    width: min(1120px, calc(var(--app-vw, 100vw) - 32px));
    height: min(780px, calc(var(--app-vh, 100vh) - 32px));
    display: flex; flex-direction: column; overflow: hidden;
    border-radius: 24px; background: #F8FAFC; color: #0F172A;
    box-shadow: 0 40px 100px rgba(0, 0, 0, .45);
    transform: translateY(16px) scale(.985); transition: transform .28s cubic-bezier(.2, .9, .3, 1.15);
}
.lf-overlay.show .lf-window { transform: none; }

.lf-head {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 16px 20px; background: #fff; border-bottom: 1px solid #E2E8F0;
}
.lf-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lf-brand img { border-radius: 12px; flex: none; }
.lf-brand h2 { font-size: 22px; font-weight: 800; color: #0F172A !important; line-height: 1.15; }
.lf-brand p { font-size: 13px; color: #64748B; }
.lf-head-actions { display: flex; align-items: center; gap: 10px; }
.lf-lang { display: inline-flex; padding: 4px; border-radius: 12px; background: #F1F5F9; border: 1px solid #E2E8F0; }
.lf-lang button { height: 32px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: #475569; font: 700 13px/1 inherit; cursor: pointer; }
.lf-lang button[data-lang="ar"] { font-family: 'Cairo', sans-serif; }
.lf-lang button.on { background: #fff; color: #0F172A; box-shadow: 0 1px 4px rgba(15, 23, 42, .12); }
.lf-close { width: 40px; height: 40px; border-radius: 12px; border: 1px solid #E2E8F0; background: #fff; color: #475569; font-size: 16px; cursor: pointer; }
.lf-close:hover { background: #F1F5F9; }

.lf-hero {
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    margin: 16px 20px 0; padding: 22px 24px; border-radius: 20px;
    color: #fff;
    background:
        radial-gradient(circle at 92% 10%, rgba(255, 0, 51, .45), transparent 45%),
        radial-gradient(circle at 5% 100%, rgba(99, 102, 241, .5), transparent 50%),
        linear-gradient(120deg, #070B1F, #140F35 60%, #2A0B26);
}
.lf-hero-text { min-width: 0; }
.lf-badge { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 99px; background: rgba(255, 0, 51, .18); border: 1px solid rgba(255, 0, 51, .5); color: #FFD1DA; font-size: 12.5px; font-weight: 700; }
.lf-badge i { color: #FF3355; }
.lf-hero h3 { margin-top: 10px; font-size: 24px; font-weight: 800; color: #fff !important; }
.lf-hero p { margin-top: 6px; max-width: 560px; font-size: 14.5px; line-height: 1.5; color: #CBD5E1; }
.lf-hero-actions { display: flex; flex-direction: column; gap: 10px; flex: none; }
.lf-row { display: flex; gap: 10px; }
.lf-primary, .lf-secondary {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 46px; padding: 0 20px; border-radius: 14px; cursor: pointer;
    font: 700 14.5px/1 inherit; text-decoration: none !important; transition: transform .1s, box-shadow .15s, background .15s;
}
.lf-primary { border: 0; color: #fff; background: linear-gradient(90deg, #6366F1, #A855F7); box-shadow: 0 10px 24px rgba(99, 102, 241, .45); }
.lf-primary:hover { box-shadow: 0 12px 30px rgba(99, 102, 241, .6); }
.lf-secondary { flex: 1; border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .06); color: #fff !important; }
.lf-secondary:hover { background: rgba(255, 255, 255, .14); }
.lf-yt { background: #FF0033; border-color: #FF0033; }
.lf-yt:hover { background: #e6002e; }
.lf-primary:active, .lf-secondary:active { transform: scale(.97); }

.lf-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 250px 1fr; gap: 16px; padding: 16px 20px 20px; }
.lf-chapters { display: flex; flex-direction: column; gap: 8px; overflow: auto; }
.lf-chapters button {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: 16px;
    border: 1px solid #E2E8F0; background: #fff; text-align: start; cursor: pointer; color: #0F172A;
    font-family: inherit; transition: border-color .15s, box-shadow .15s, transform .1s;
}
.lf-chapters button:hover { border-color: #CBD5E1; }
.lf-chapters button.on { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.lf-num { flex: none; width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font: 800 16px/1 'Outfit', sans-serif; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); }
.lf-chapters button.on .lf-num { color: #fff; background: var(--c); }
.lf-ch-text { display: flex; flex-direction: column; min-width: 0; }
.lf-ch-text b { font-size: 14.5px; font-weight: 700; line-height: 1.25; }
.lf-ch-text small { font-size: 12px; color: #64748B; }

.lf-lessons { overflow: auto; min-height: 0; padding-inline-end: 4px; }
.lf-ch-head { margin-bottom: 12px; }
.lf-ch-head h4 { font-size: 20px; font-weight: 800; color: #0F172A !important; }
.lf-ch-head p { font-size: 13.5px; color: #64748B; margin-top: 2px; }
.lf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.lf-card { display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: #fff; border: 1px solid #E2E8F0; transition: box-shadow .2s, transform .2s; }
.lf-card:hover { box-shadow: 0 14px 30px rgba(15, 23, 42, .1); transform: translateY(-2px); }
.lf-thumb { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; background: #0F172A; cursor: pointer; overflow: hidden; }
.lf-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.lf-card:hover .lf-thumb img { transform: scale(1.04); }
.lf-play { position: absolute; left: 50%; top: 50%; width: 56px; height: 40px; margin: -20px 0 0 -28px; border-radius: 12px; background: #FF0033; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; box-shadow: 0 8px 18px rgba(0, 0, 0, .35); }
.lf-dur { position: absolute; bottom: 8px; inset-inline-end: 8px; padding: 3px 7px; border-radius: 6px; background: rgba(2, 6, 23, .78); color: #fff; font: 700 11.5px/1.2 'Inter', sans-serif; }
.lf-card-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; flex: 1; }
.lf-card-body small { font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--c); }
.lf-card-body b { font-size: 16px; font-weight: 800; line-height: 1.25; color: #0F172A; }
.lf-card-body ul { margin: 4px 0 0; padding-inline-start: 18px; font-size: 13px; line-height: 1.45; color: #475569; }
.lf-card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 10px; }
.lf-watch, .lf-slide { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; border-radius: 10px; font: 700 13px/1 inherit; cursor: pointer; transition: background .15s; }
.lf-watch { border: 0; background: #FF0033; color: #fff; }
.lf-watch:hover { background: #e6002e; }
.lf-slide { border: 1px solid #E2E8F0; background: #fff; color: #334155; }
.lf-slide:hover { background: #F1F5F9; }

@media (max-width: 820px) {
    .lf-hero { flex-direction: column; align-items: stretch; }
    .lf-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .lf-chapters { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
    .lf-chapters button { flex: none; width: auto; }
    .lf-ch-text small { display: none; }
}
@media (max-width: 520px) {
    .lf-hero p, .lf-brand p { display: none; }
    .lf-head { padding: 12px; }
    .lf-hero { margin: 12px 12px 0; padding: 16px; }
    .lf-body { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .lf-overlay, .lf-window, .lf-card, .lf-thumb img { transition: none; }
}
/* themes set their own heading fonts (e.g. a serif): keep ours */
.lf-overlay h1, .lf-overlay h2, .lf-overlay h3, .lf-overlay h4, .lf-overlay b, .lf-overlay button, .lf-overlay a { font-family: inherit !important; letter-spacing: normal; }
.lf-overlay .lf-num { font-family: 'Outfit', sans-serif !important; }
.lf-overlay .lf-lang button[data-lang="ar"] { font-family: 'Cairo', sans-serif !important; }
html body .lf-overlay.lf-overlay :is(h1, h2, h3, h4, b, button, a) { font-family: inherit !important; letter-spacing: normal !important; }
html body .lf-overlay.lf-overlay .lf-hero h3 { color: #fff !important; -webkit-text-fill-color: #fff !important; }
html body .lf-overlay.lf-overlay :is(.lf-brand h2, .lf-ch-head h4, .lf-card-body b) { color: #0F172A !important; -webkit-text-fill-color: #0F172A !important; }
html body .lf-overlay.lf-overlay .lf-lang button[data-lang="ar"] { font-family: 'Cairo', sans-serif !important; }
html body .lf-overlay.lf-overlay .lf-num { font-family: 'Outfit', sans-serif !important; }

/* ---------- Built-in "Learn Fikra Smart" class in the Library (NavigationManager) ---------- */
html body #onenote-nav.lib-drawer .lib-learn-chip .lib-chip-initial {
    background: linear-gradient(135deg, #6366F1, #A855F7) !important; color: #fff !important; -webkit-text-fill-color: #fff !important;
}
html body #onenote-nav.lib-drawer .lib-learn-chip { --chip-accent: #8B5CF6; }
/* read-only: no class tools, no chapter / lesson editing */
html body #onenote-nav.lib-drawer.lib-virtual :is(.lib-classbar-actions, #btn-lib-select-chapters, #btn-add-chapter, #btn-lib-select-lessons, .lib-lesson-actions, .lib-sort) { display: none !important; }
html body #onenote-nav.lib-drawer .lib-learn-row .lib-row-meta .fa-youtube { color: #FF0033; }
html body #onenote-nav.lib-drawer .lib-learn-watch {
    flex: none; width: 34px; height: 34px; margin-inline-start: 6px; border-radius: 10px; border: 0;
    background: #FF0033; color: #fff; display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; cursor: pointer; box-shadow: 0 4px 10px rgba(255, 0, 51, .25); transition: transform .1s, background .15s;
}
html body #onenote-nav.lib-drawer .lib-learn-watch:hover { background: #e6002e; }
html body #onenote-nav.lib-drawer .lib-learn-watch:active { transform: scale(.93); }
