/* =========================================================
   Masar — student portal. Reuses the tshell/tside/tnav/ttop/tcard
   primitives from teacher.css (same app-shell system as the
   instructor/admin consoles) and adds what's specific to a student:
   a mobile bottom tab bar and the notification bell dropdown.
   ========================================================= */

/* ---------- Notification bell ---------- */
.sbell { position: relative; width: 2.3rem; height: 2.3rem; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.sbell .pill { position: absolute; top: -0.3rem; inset-inline-end: -0.3rem; font-size: 0.62rem; font-weight: 800; min-width: 1.1rem; height: 1.1rem; padding: 0 0.3rem; border-radius: 999px; background: #fb7185; color: #fff; display: flex; align-items: center; justify-content: center; }
.sbell .pill[hidden], .sbottom .pill[hidden] { display: none; }
.sbell-panel {
  position: absolute; top: calc(100% + 0.6rem); inset-inline-end: 0; width: min(90vw, 340px); z-index: 65;
  background: var(--card-solid); border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  box-shadow: var(--shadow-2); overflow: hidden;
}
.sbell-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); }
.sbell-head strong { font-size: 0.88rem; }
.sbell-head button { font-size: 0.74rem; font-weight: 700; color: var(--blue-soft); }
.sbell-list { max-height: 320px; overflow-y: auto; }
.sbell-item { display: block; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; transition: background 0.25s var(--ease); }
.sbell-item:last-child { border-bottom: none; }
.sbell-item:hover { background: var(--card); }
.sbell-item strong { display: block; font-size: 0.83rem; font-weight: 700; color: var(--text); }
.sbell-item span { display: block; font-size: 0.78rem; color: var(--text-dimmer); margin-top: 0.2rem; }
.sbell-item.unread { background: rgba(var(--accent-rgb),0.06); position: relative; }
.sbell-item.unread::before { content: ""; position: absolute; top: 1rem; inset-inline-start: 0.4rem; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.sbell-item.unread strong { padding-inline-start: 0.8rem; }
.sbell-empty { padding: 2rem 1rem; text-align: center; color: var(--text-dimmer); font-size: 0.82rem; }
.sbell-foot { display: block; text-align: center; padding: 0.7rem; font-size: 0.8rem; font-weight: 700; color: var(--blue-soft); border-top: 1px solid var(--border); }

/* ---------- Mobile bottom tab bar ---------- */
.sbottom { display: none; }
@media (max-width: 1023px) {
  .sbottom {
    position: fixed; bottom: 0; inset-inline: 0; z-index: 55;
    display: flex; align-items: stretch; justify-content: space-around;
    background: var(--nav-bg); backdrop-filter: blur(18px);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .sbottom a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem;
    padding: 0.55rem 0.2rem 0.6rem; font-size: 0.63rem; font-weight: 700; color: var(--text-dimmer);
    position: relative; min-width: 0;
  }
  .sbottom a span:first-child { display: none; } /* icon wrapper is the svg itself */
  .sbottom a svg { color: inherit; }
  .sbottom a.active { color: var(--blue); }
  .sbottom a .pill { position: absolute; top: 0.25rem; inset-inline-end: 22%; font-size: 0.58rem; font-weight: 800; min-width: 1rem; height: 1rem; padding: 0 0.25rem; border-radius: 999px; background: #fb7185; color: #fff; display: flex; align-items: center; justify-content: center; }
  .is-student .tbody { padding-bottom: 5.5rem; }
  .is-student .tside { display: none; }
  .is-student .tside-backdrop { display: none; }
  .is-student .tburger { display: none; }
}

/* ---------- XP / level badge ---------- */
.xp-badge { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.9rem; border-radius: 999px; background: var(--card-solid); border: 1px solid var(--border); }
.xp-level { font-size: 0.76rem; font-weight: 800; color: var(--amber-soft); white-space: nowrap; }
.xp-bar { width: 4.5rem; height: 6px; border-radius: 999px; background: var(--border-strong); overflow: hidden; }
.xp-fill { height: 100%; border-radius: 999px; background: var(--grad-primary); }
.xp-count { font-size: 0.72rem; color: var(--text-dimmer); font-weight: 700; white-space: nowrap; }
@media (max-width: 640px) { .xp-badge { display: none; } }

/* ---------- Learning goals ---------- */
.goal-top { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-dim); margin-bottom: 0.4rem; }
.goal-top span:last-child { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- Streak calendar ---------- */
.streak-cal { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.9rem; }
.streak-cell { width: 1.9rem; height: 1.9rem; border-radius: 0.5rem; background: var(--surface); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 0.62rem; font-weight: 700; color: var(--text-dimmer); }
.streak-cell.active { background: var(--grad-primary); border-color: transparent; color: #fff; }
.streak-cell.today { box-shadow: 0 0 0 2px var(--blue); }

/* ---------- Achievement cards (premium, not childish) ---------- */
.ach-card { padding: 1.1rem; border-radius: var(--radius-md); background: var(--card-solid); border: 1px solid var(--border); text-align: center; transition: all 0.35s var(--ease); }
.ach-card.earned { border-color: rgba(var(--warm-rgb),0.35); background: linear-gradient(160deg, rgba(var(--warm-rgb),0.1), var(--card-solid)); }
.ach-card .ach-ico { width: 2.6rem; height: 2.6rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 0.6rem; background: var(--surface); color: var(--text-dimmer); }
.ach-card.earned .ach-ico { background: var(--grad-primary); color: #fff; }
.ach-card .ach-label { font-size: 0.78rem; font-weight: 700; color: var(--text-dim); }
.ach-card.earned .ach-label { color: var(--text); }
.ach-card:not(.earned) { opacity: 0.55; }

/* ---------- Certificate cards ---------- */
.cert-card { padding: 1.4rem; border-radius: var(--radius-md); background: linear-gradient(155deg, rgba(var(--warm-rgb),0.12), var(--card-solid)); border: 1px solid rgba(var(--warm-rgb),0.28); position: relative; overflow: hidden; }
.cert-card .cert-seal { width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--grad-primary); display: flex; align-items: center; justify-content: center; color: #fff; margin-bottom: 0.8rem; }
.cert-card h3 { font-size: 1rem; margin-bottom: 0.3rem; }
.cert-card .cert-code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.76rem; color: var(--text-dimmer); }
.cert-card .cert-actions { display: flex; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; }

/* ---------- Today's plan ---------- */
.plan-row { display: flex; align-items: center; gap: 0.9rem; padding: 0.85rem 1.1rem; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--border); margin-bottom: 0.55rem; text-decoration: none; color: inherit; }
.plan-time { font-size: 0.78rem; font-weight: 800; color: var(--blue-soft); font-variant-numeric: tabular-nums; min-width: 3.6rem; }
.plan-body { flex: 1; min-width: 0; }
.plan-body strong { display: block; font-size: 0.87rem; }
.plan-body small { color: var(--text-dimmer); font-size: 0.76rem; }

/* ---------- Activity timeline ---------- */
.tl-list { position: relative; }
.tl-list::before { content: ""; position: absolute; top: 0.9rem; bottom: 0.9rem; inset-inline-start: 0.85rem; width: 1px; background: var(--border); }
.tl-item { position: relative; display: flex; gap: 0.9rem; padding: 0.7rem 0; }
.tl-dot { position: relative; z-index: 1; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); color: var(--blue-soft); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tl-body { flex: 1; min-width: 0; font-size: 0.85rem; padding-top: 0.15rem; }
.tl-body small { display: block; color: var(--text-dimmer); font-size: 0.74rem; margin-top: 0.15rem; }

/* ---------- Student-side tab pills (course lists) ---------- */
.stu-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1.3rem; }

/* Unread notification row, in the full notifications list */
.plan-row.unread-notif { border-inline-start: 3px solid var(--blue); background: rgba(var(--accent-rgb),0.06); }
