/* MP1 "My Progress": scoped eg-mp classes only, loaded after the main + UI1 stylesheets. Edugen dashboard palette:
   page #050726, surface #101340, card glow #019bfd, accent #0061EF, icon #0186EB, muted #9498B5, gold #FECE00, amber #FF921F.
   Logical properties throughout, so Arabic (rtl) and English (ltr) mirror correctly. */
.eg-mp { --mp-bg: #050726; --mp-surface: #101340; --mp-card: #141852; --mp-line: rgba(255,255,255,.09); --mp-muted: #9498b5;
  --mp-blue: #0061ef; --mp-sky: #019bfd; --mp-icon: #0186eb; --mp-gold: #fece00; --mp-amber: #ff921f; --mp-green: #22c55e; --mp-red: #ff6b6b;
  --mp-test: #3d8bff; --mp-game: #ff921f; --mp-lesson: #2ed3a0; --mp-class: #b48cff;
  color: #fff; font-family: inherit; min-width: 0; }
.eg-mp *, .eg-mp *::before, .eg-mp *::after { box-sizing: border-box; }
.eg-mp-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eg-mp-ic { width: 1.15em; height: 1.15em; flex: none; }

/* headings */
.eg-mp-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-block-end: 12px; }
.eg-mp-h2 { margin: 0; font-size: clamp(1.15rem, 1rem + .8vw, 1.6rem); font-weight: 700; letter-spacing: -.01em; }
.eg-mp-h2sub { color: var(--mp-muted); font-size: .9rem; }

/* slot card in the dashboard grid (replaces the attendance card) */
.eg-mp-slot { display: flex; flex-direction: column; height: 100%; border-radius: 18px; padding: 16px; min-height: 0;
  background: radial-gradient(120% 70% at 50% 120%, rgba(1,155,253,.55), rgba(1,34,226,0) 70%), var(--mp-surface); }
.eg-mp-slot__body { display: grid; gap: 12px; flex: 1; align-content: start; }
@media (min-width: 768px) { .eg-mp-slot { padding: 20px 24px; } }

/* full section */
.eg-mp-section { margin: 24px 12px 0; padding: 18px 14px 20px; border-radius: 18px; background: var(--mp-surface);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
@media (min-width: 768px) { .eg-mp-section { margin: 32px 23px 0; padding: 24px; } }
.eg-mp-body.is-refreshing { opacity: .55; transition: opacity .2s; }

/* cards */
.eg-mp-card { position: relative; min-width: 0; border-radius: 16px; padding: 14px; background: linear-gradient(160deg, rgba(1,155,253,.10), rgba(1,155,253,0) 55%), var(--mp-card);
  border: 1px solid var(--mp-line); display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 768px) { .eg-mp-card { padding: 18px; } }
.eg-mp-card__head { display: flex; align-items: center; gap: 10px; }
.eg-mp-card__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff; font-size: 18px;
  background: linear-gradient(135deg, var(--mp-sky), var(--mp-blue)); box-shadow: 0 6px 16px rgba(0,97,239,.35); }
.eg-mp-card__title { margin: 0; font-size: 1rem; font-weight: 700; }
.eg-mp-muted { margin: 0; color: var(--mp-muted); font-size: .8rem; line-height: 1.45; }
.eg-mp-note { display: flex; gap: 6px; align-items: flex-start; }
.eg-mp-nodata { margin: 0; padding: 14px 0; color: var(--mp-muted); font-size: .9rem; }
.eg-mp-grid3 { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .eg-mp-grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .eg-mp-grid3 > :last-child:nth-child(odd) { grid-column: 1 / -1; } }
@media (min-width: 1200px) { .eg-mp-grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .eg-mp-grid3 > :last-child:nth-child(odd) { grid-column: auto; } }
.eg-mp-body > * + * { margin-block-start: 12px; }

/* stats */
.eg-mp-big { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.eg-mp-big > span { font-size: clamp(1.8rem, 1.4rem + 1.4vw, 2.4rem); font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.eg-mp-big small { color: var(--mp-muted); font-size: .85rem; }
.eg-mp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; }
.eg-mp-stat { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.04); min-width: 0; }
.eg-mp-stat__v { font-weight: 700; font-size: 1.05rem; display: inline-flex; align-items: center; gap: 2px; }
.eg-mp-stat__v--gold { color: var(--mp-gold); }
.eg-mp-stat__k { color: var(--mp-muted); font-size: .72rem; }
.eg-mp-stat__s { color: var(--mp-amber); font-size: .7rem; }
.eg-mp-bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.eg-mp-bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--mp-blue), var(--mp-sky)); }
[dir="rtl"] .eg-mp-bar > span { background: linear-gradient(270deg, var(--mp-blue), var(--mp-sky)); }
.eg-mp-trend { display: inline-flex; align-items: center; gap: 2px; }
.eg-mp-trend.is-up { color: var(--mp-green); } .eg-mp-trend.is-down { color: var(--mp-red); }
.eg-mp-unavail { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; border: 1px dashed rgba(148,152,181,.45); color: var(--mp-muted); }
.eg-mp-unavail strong { color: #fff; display: block; margin-block-end: 2px; }
.eg-mp-unavail p { margin: 0; font-size: .85rem; }

/* streak */
.eg-mp-streak__main { display: flex; align-items: center; gap: 14px; }
.eg-mp-flame { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; font-size: 32px; color: #6b6f95; background: rgba(255,255,255,.05); flex: none; }
.eg-mp-flame.is-on { color: var(--mp-gold); background: radial-gradient(circle at 50% 70%, rgba(255,146,31,.45), rgba(255,146,31,.08)); }
.eg-mp-streak__n { margin: 0; font-size: 2rem; font-weight: 800; line-height: 1; }
.eg-mp-streak__n small { font-size: 1rem; font-weight: 600; }
.eg-mp-streak__msg { margin: 4px 0 0; color: var(--mp-muted); font-size: .82rem; }
.eg-mp-dots { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 4px; }
.eg-mp-dot { aspect-ratio: 1; border-radius: 6px; background: rgba(255,255,255,.08); max-height: 22px; }
.eg-mp-dot.is-on { background: linear-gradient(135deg, var(--mp-gold), var(--mp-amber)); }

/* overall */
.eg-mp-overall__row { display: flex; align-items: center; gap: 14px; }
.eg-mp-overall__stats { display: grid; gap: 8px; flex: 1; min-width: 0; }
.eg-mp-ring { position: relative; width: 84px; height: 84px; flex: none; display: grid; place-items: center; }
.eg-mp-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.eg-mp-ring__track { fill: none; stroke: rgba(255,255,255,.1); stroke-width: 8; }
.eg-mp-ring__val { fill: none; stroke: var(--mp-sky); stroke-width: 8; stroke-linecap: round; }
.eg-mp-ring__txt { font-weight: 800; font-size: 1.1rem; }
.eg-mp-ring--na { border-radius: 50%; border: 6px solid rgba(255,255,255,.08); }
.eg-mp-ring__txt--sm { font-size: .68rem; color: var(--mp-muted); text-align: center; font-weight: 600; }
.eg-mp-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.eg-mp-mini > div { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 10px; background: rgba(255,255,255,.04); }
.eg-mp-mini strong { font-size: 1.1rem; } .eg-mp-mini span { color: var(--mp-muted); font-size: .72rem; text-align: center; }

/* level (games) */
.eg-mp-level { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; color: var(--mp-gold);
  background: linear-gradient(90deg, rgba(254,206,0,.14), rgba(254,206,0,.02)); font-size: 20px; }
.eg-mp-level strong { display: block; color: #fff; font-size: .95rem; } .eg-mp-level span { color: var(--mp-muted); font-size: .76rem; }

/* course list */
.eg-mp-courses { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; }
.eg-mp-courses__row { display: flex; justify-content: space-between; gap: 8px; font-size: .82rem; margin-block-end: 4px; }
.eg-mp-courses__t { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* filters */
.eg-mp-filters { display: flex; flex-direction: column; gap: 8px; margin-block-end: 12px; }
.eg-mp-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-block-end: 2px; }
.eg-mp-chips::-webkit-scrollbar { display: none; }
.eg-mp-chip { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 36px; padding: 6px 14px; border-radius: 99px; border: 1px solid var(--mp-line);
  background: #2b2d56; color: #fff; font: inherit; font-size: .82rem; cursor: pointer; transition: background .15s, color .15s; }
.eg-mp-chip:hover { background: #363a72; }
.eg-mp-chip.is-on { background: #e6e7ec; color: #101340; border-color: transparent; font-weight: 700; }
.eg-mp-chip:focus-visible, .eg-mp-pill:focus-visible, .eg-mp-btn:focus-visible, .eg-mp-colbtn:focus-visible { outline: 2px solid var(--mp-sky); outline-offset: 2px; }
.eg-mp-partial { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 12px; border-radius: 10px; font-size: .8rem; color: #ffd9a8; background: rgba(255,146,31,.12); }

/* chart */
.eg-mp-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.eg-mp-seg-toggle { display: inline-flex; padding: 3px; border-radius: 99px; background: rgba(255,255,255,.06); }
.eg-mp-pill { min-height: 32px; padding: 4px 14px; border: 0; border-radius: 99px; background: transparent; color: var(--mp-muted); font: inherit; font-size: .8rem; cursor: pointer; }
.eg-mp-pill.is-on { background: linear-gradient(135deg, var(--mp-sky), var(--mp-blue)); color: #fff; font-weight: 700; }
.eg-mp-pill--ghost.is-on { background: #e6e7ec; color: #101340; }
.eg-mp-chart { position: relative; display: flex; gap: 6px; height: 220px; margin-block-start: 6px; }
@media (min-width: 768px) { .eg-mp-chart { height: 260px; } }
.eg-mp-axis { display: flex; flex-direction: column; justify-content: space-between; padding-block-end: 24px; color: var(--mp-muted); font-size: .68rem; min-width: 22px; text-align: end; }
.eg-mp-plot { position: relative; flex: 1; display: flex; align-items: stretch; gap: clamp(3px, 1.2vw, 12px); min-width: 0; }
.eg-mp-grid { position: absolute; inset: 0 0 24px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.eg-mp-grid i { border-top: 1px dashed rgba(255,255,255,.08); }
.eg-mp-col { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.eg-mp-colbtn { flex: 1; width: 100%; max-width: 38px; display: flex; align-items: flex-end; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 14px; }
.eg-mp-stack { width: 100%; height: 100%; display: flex; flex-direction: column-reverse; border-radius: 14px; overflow: hidden; background: rgba(255,255,255,.05); }
.eg-mp-colbtn:hover .eg-mp-stack, .eg-mp-colbtn:focus-visible .eg-mp-stack { background: rgba(255,255,255,.1); }
.eg-mp-seg { display: block; width: 100%; flex: none; transition: block-size .35s ease; }
.eg-mp-seg--test { background: var(--mp-test); } .eg-mp-seg--game { background: var(--mp-game); }
.eg-mp-seg--lesson { background: var(--mp-lesson); } .eg-mp-seg--class { background: var(--mp-class); }
.eg-mp-seg--score { background: linear-gradient(0deg, var(--mp-blue), var(--mp-sky)); border-radius: 14px 14px 0 0; }
.eg-mp-col.is-current .eg-mp-stack { box-shadow: 0 0 0 2px rgba(1,155,253,.6); }
.eg-mp-xl { height: 24px; line-height: 24px; color: var(--mp-muted); font-size: .64rem; white-space: nowrap; overflow: hidden; max-width: 100%; }
.eg-mp-col.is-current .eg-mp-xl { color: #fff; font-weight: 700; }
@media (max-width: 520px) { .eg-mp-col:nth-child(odd):not(.is-current) .eg-mp-xl { visibility: hidden; } }
.eg-mp-chart__empty { position: absolute; inset: 0 0 24px; display: grid; place-items: center; margin: 0; color: var(--mp-muted); font-size: .85rem; pointer-events: none; }
.eg-mp-tip { position: absolute; z-index: 5; transform: translate(-50%, calc(-100% - 8px)); min-width: 150px; max-width: 220px; padding: 10px 12px; border-radius: 12px;
  background: #fff; color: #101340; font-size: .76rem; box-shadow: 0 10px 30px rgba(0,0,0,.45); pointer-events: none; }
.eg-mp-tip strong { display: block; margin-block-end: 4px; font-size: .8rem; }
.eg-mp-tip ul { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 2px; }
.eg-mp-tip li { display: flex; align-items: center; gap: 6px; } .eg-mp-tip p { margin: 0; color: #4a4e7a; }
.eg-mp-key { display: inline-block; width: 9px; height: 9px; border-radius: 3px; flex: none; }
.eg-mp-key--test { background: var(--mp-test); } .eg-mp-key--game { background: var(--mp-game); } .eg-mp-key--lesson { background: var(--mp-lesson); } .eg-mp-key--class { background: var(--mp-class); }
.eg-mp-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--mp-muted); font-size: .75rem; }
.eg-mp-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* history */
.eg-mp-hist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.eg-mp-hist__i { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 0; border-block-end: 1px solid var(--mp-line); }
.eg-mp-hist__i:last-child { border-block-end: 0; }
.eg-mp-hist__ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; flex: none; font-size: 18px; }
.eg-mp-hist__ic--test { background: rgba(61,139,255,.18); color: var(--mp-test); } .eg-mp-hist__ic--game { background: rgba(255,146,31,.18); color: var(--mp-game); }
.eg-mp-hist__ic--lesson { background: rgba(46,211,160,.16); color: var(--mp-lesson); } .eg-mp-hist__ic--class { background: rgba(180,140,255,.18); color: var(--mp-class); }
.eg-mp-hist__body { flex: 1; min-width: 0; }
.eg-mp-hist__t { margin: 0; font-weight: 600; font-size: .9rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; text-align: start; }
.eg-mp-hist__m { margin: 2px 0 0; color: var(--mp-muted); font-size: .74rem; overflow-wrap: anywhere; }
.eg-mp-hist__r { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.eg-mp-score { font-weight: 800; font-size: .9rem; padding: 2px 8px; border-radius: 8px; background: rgba(255,255,255,.08); }
.eg-mp-score.is-hi { color: #7ef0b8; } .eg-mp-score.is-lo { color: #ffb0b0; }
.eg-mp-tag { font-size: .66rem; padding: 2px 7px; border-radius: 99px; background: rgba(255,255,255,.08); color: var(--mp-muted); white-space: nowrap; }
.eg-mp-tag--gold { background: rgba(254,206,0,.16); color: var(--mp-gold); } .eg-mp-tag--ok { background: rgba(34,197,94,.14); color: #7ef0b8; }

/* buttons, states */
.eg-mp-btn { align-self: flex-start; min-height: 36px; padding: 6px 16px; border-radius: 99px; border: 0; cursor: pointer; font: inherit; font-size: .82rem; font-weight: 700;
  color: #fff; background: linear-gradient(135deg, var(--mp-sky), var(--mp-blue)); }
.eg-mp-btn--ghost { background: rgba(255,255,255,.08); }
.eg-mp-error { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px; border-radius: 12px; background: rgba(255,107,107,.1); color: #ffd0d0; margin-block-end: 12px; }
.eg-mp-error p { margin: 0; flex: 1; min-width: 160px; }
.eg-mp-empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 28px 12px; border-radius: 16px; background: var(--mp-card); }
.eg-mp-empty .eg-mp-ic { width: 42px; height: 42px; color: var(--mp-gold); }
.eg-mp-empty h3 { margin: 0; font-size: 1.1rem; } .eg-mp-empty p { margin: 0; color: var(--mp-muted); max-width: 46ch; font-size: .9rem; }
.eg-mp-skel-stack { display: grid; gap: 12px; }
.eg-mp-skel { border-radius: 16px; background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.11), rgba(255,255,255,.05)); background-size: 200% 100%; animation: eg-mp-sh 1.3s linear infinite; }
.eg-mp-skel--card { height: 150px; } .eg-mp-skel--chart { height: 240px; grid-column: 1 / -1; }
@keyframes eg-mp-sh { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .eg-mp-skel { animation: none; } .eg-mp-seg { transition: none; } }
