/* ─── Nourfikir Theme — main.css ─────────────────────────────────────────── */

:root {
  --nf-primary:      #1e40af;
  --nf-primary-dark: #1e3a8a;
  --nf-primary-light:#dbeafe;
  --nf-accent:       #0ea5e9;
  --nf-success:      #16a34a;
  --nf-warning:      #d97706;
  --nf-danger:       #dc2626;
  --nf-surface:      #ffffff;
  --nf-bg:           #f8fafc;
  --nf-border:       #e2e8f0;
  --nf-text:         #0f172a;
  --nf-text-muted:   #64748b;
  --nf-radius:       0.5rem;
  --nf-radius-lg:    0.75rem;
  --nf-shadow:       0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --nf-shadow-md:    0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --nf-font:         'Inter', system-ui, -apple-system, sans-serif;
  --nf-font-size:    16px;
  --nf-container-width: 1200px;
  --nf-button-radius: 0.5rem;
  --nf-logo-width:   130px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: var(--nf-font-size); -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--nf-font);
  background: var(--nf-bg);
  color: var(--nf-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--nf-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Layout ────────────────────────────────────────────────────────────── */
.nf-container { width: 100%; max-width: var(--nf-container-width); margin: 0 auto; padding: 0 1.5rem; }
.nf-main      { flex: 1; padding: 2rem 0; }

/* ─── Header ─────────────────────────────────────────────────────────────── */
.nf-header {
  background: var(--nf-surface);
  border-bottom: 1px solid var(--nf-border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--nf-shadow);
}
.nf-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 88px; gap: 1rem; padding-top: 0.45rem; padding-bottom: 0.45rem;
}
.nf-header__logo {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 700; font-size: 1.15rem; color: var(--nf-primary);
  text-decoration: none; min-width: 0; flex-shrink: 0;
}
.nf-logo__name  { letter-spacing: -0.02em; }
.nf-brand-logo {
  width: var(--nf-logo-width); height: auto; max-height: 80px;
  object-fit: contain; border-radius: 0.35rem;
}
.nf-brand-logo--header { background: #fff; }
.nf-logo__tagline {
  font-size: 0.65rem; font-weight: 500; color: var(--nf-text-muted);
  background: var(--nf-primary-light); padding: 0.15rem 0.45rem;
  border-radius: 999px; text-transform: uppercase; letter-spacing: 0.05em;
}
.nf-header__nav { display: flex; align-items: center; justify-content: flex-end; gap: 1rem; }
.nf-role-nav { display: flex; align-items: center; gap: 1rem; }
.nf-menu {
  display: flex; align-items: center; gap: 1rem; list-style: none;
  margin: 0; padding: 0;
}
.nf-menu a {
  color: var(--nf-text-muted); font-weight: 500; font-size: 0.9rem;
  text-decoration: none;
}
.nf-menu a:hover,
.nf-menu .current-menu-item > a { color: var(--nf-primary); }
.nf-nav__link   { color: var(--nf-text-muted); font-weight: 500; font-size: 0.9rem; }
.nf-nav__link:hover { color: var(--nf-primary); text-decoration: none; }
.nf-header__user { font-size: 0.85rem; font-weight: 600; color: var(--nf-text); display: flex; align-items: center; gap: 0.4rem; }
.nf-header__menu-toggle { display: none; }
.nf-header--compact .nf-header__inner { min-height: 64px; }
.nf-header--compact .nf-brand-logo { max-height: 54px; width: min(var(--nf-logo-width), 105px); }
.nf-header--compact .nf-logo__tagline { display: none; }
.nf-header--centered .nf-header__inner {
  flex-direction: column; justify-content: center; min-height: 132px;
  padding-top: 0.8rem; padding-bottom: 0.8rem;
}
.nf-header--centered .nf-header__nav { width: 100%; justify-content: center; }

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.nf-badge { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.15rem 0.5rem; border-radius: 999px; }
.nf-badge--student  { background: #dcfce7; color: #15803d; }
.nf-badge--teacher  { background: #dbeafe; color: #1d4ed8; }
.nf-badge--administrator { background: #fef3c7; color: #92400e; }

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.nf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.6rem 1.2rem; border-radius: var(--nf-button-radius);
  font-family: var(--nf-font); font-size: 0.9rem; font-weight: 600;
  border: 2px solid transparent; cursor: pointer;
  transition: all 0.15s ease; text-decoration: none; line-height: 1;
}
.nf-btn:hover { text-decoration: none; }
.nf-btn--primary  { background: var(--nf-primary); color: #fff; border-color: var(--nf-primary); }
.nf-btn--primary:hover { background: var(--nf-primary-dark); border-color: var(--nf-primary-dark); }
.nf-btn--ghost    { background: transparent; color: var(--nf-primary); border-color: var(--nf-border); }
.nf-btn--ghost:hover { background: var(--nf-bg); }
.nf-btn--danger   { background: var(--nf-danger); color: #fff; border-color: var(--nf-danger); }
.nf-btn--success  { background: var(--nf-success); color: #fff; border-color: var(--nf-success); }
.nf-btn--sm  { padding: 0.4rem 0.9rem; font-size: 0.8rem; }
.nf-btn--lg  { padding: 0.8rem 1.8rem; font-size: 1rem; }
.nf-btn--full { width: 100%; }
.nf-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.nf-card {
  background: var(--nf-surface); border: 1px solid var(--nf-border);
  border-radius: var(--nf-radius-lg); padding: 1.5rem;
  box-shadow: var(--nf-shadow);
}
.nf-card--hover { transition: box-shadow 0.15s ease, transform 0.15s ease; }
.nf-card--hover:hover { box-shadow: var(--nf-shadow-md); transform: translateY(-1px); }
.nf-card__header { margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--nf-border); }
.nf-card__title  { font-size: 1.05rem; font-weight: 700; color: var(--nf-text); }
.nf-card__subtitle { font-size: 0.8rem; color: var(--nf-text-muted); margin-top: 0.2rem; }

/* ─── Grid ───────────────────────────────────────────────────────────────── */
.nf-grid          { display: grid; gap: 1.25rem; }
.nf-grid--2       { grid-template-columns: repeat(2, 1fr); }
.nf-grid--3       { grid-template-columns: repeat(3, 1fr); }
.nf-grid--4       { grid-template-columns: repeat(4, 1fr); }
.nf-grid--sidebar { grid-template-columns: 240px 1fr; gap: 1.5rem; }

/* ─── Stat cards ─────────────────────────────────────────────────────────── */
.nf-stat { display: flex; flex-direction: column; gap: 0.25rem; }
.nf-stat__value { font-size: 2rem; font-weight: 800; color: var(--nf-primary); line-height: 1; }
.nf-stat__label { font-size: 0.78rem; color: var(--nf-text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.nf-stat__delta { font-size: 0.78rem; font-weight: 600; }
.nf-stat__delta--up   { color: var(--nf-success); }
.nf-stat__delta--down { color: var(--nf-danger); }

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.nf-form-group  { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1.1rem; }
.nf-label       { font-size: 0.85rem; font-weight: 600; color: var(--nf-text); }
.nf-label--req::after { content: ' *'; color: var(--nf-danger); }
.nf-input, .nf-select, .nf-textarea {
  width: 100%; padding: 0.55rem 0.85rem;
  border: 1px solid var(--nf-border); border-radius: var(--nf-radius);
  font-family: var(--nf-font); font-size: 0.9rem; color: var(--nf-text);
  background: var(--nf-surface); transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
}
.nf-input:focus, .nf-select:focus, .nf-textarea:focus {
  outline: none; border-color: var(--nf-accent);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
}
.nf-textarea    { resize: vertical; min-height: 100px; }
.nf-form-hint   { font-size: 0.78rem; color: var(--nf-text-muted); }
.nf-form-error  { font-size: 0.78rem; color: var(--nf-danger); font-weight: 500; }

/* ─── Alerts / Notices ───────────────────────────────────────────────────── */
.nf-alert { padding: 0.85rem 1.1rem; border-radius: var(--nf-radius); font-size: 0.88rem; font-weight: 500; margin-bottom: 1rem; }
.nf-alert--success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.nf-alert--error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.nf-alert--info    { background: var(--nf-primary-light); color: var(--nf-primary-dark); border: 1px solid #bfdbfe; }
.nf-alert--warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.nf-table-wrap { overflow-x: auto; }
.nf-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.nf-table th { padding: 0.7rem 1rem; text-align: left; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--nf-text-muted); border-bottom: 2px solid var(--nf-border); background: var(--nf-bg); }
.nf-table td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--nf-border); color: var(--nf-text); vertical-align: middle; }
.nf-table tr:last-child td { border-bottom: none; }
.nf-table tr:hover td { background: var(--nf-bg); }

/* ─── Status pills ───────────────────────────────────────────────────────── */
.nf-pill { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.2rem 0.6rem; border-radius: 999px; }
.nf-pill--draft    { background: #f1f5f9; color: #64748b; }
.nf-pill--pending  { background: #fef3c7; color: #92400e; }
.nf-pill--approved { background: #dcfce7; color: #15803d; }
.nf-pill--rejected { background: #fee2e2; color: #991b1b; }

/* ─── Sidebar nav ────────────────────────────────────────────────────────── */
.nf-sidebar { display: flex; flex-direction: column; gap: 0.25rem; }
.nf-sidebar__label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--nf-text-muted); padding: 0.75rem 0.75rem 0.25rem; }
.nf-sidebar__link {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.75rem;
  border-radius: var(--nf-radius); color: var(--nf-text-muted); font-size: 0.875rem; font-weight: 500;
  text-decoration: none; transition: all 0.1s ease;
}
.nf-sidebar__link:hover { background: var(--nf-bg); color: var(--nf-text); text-decoration: none; }
.nf-sidebar__link.active { background: var(--nf-primary-light); color: var(--nf-primary); font-weight: 600; }
.nf-sidebar__icon { width: 1.1rem; text-align: center; }

/* ─── Page headers ───────────────────────────────────────────────────────── */
.nf-page-header { margin-bottom: 1.75rem; }
.nf-page-header__title { font-size: 1.6rem; font-weight: 800; color: var(--nf-text); letter-spacing: -0.02em; }
.nf-page-header__sub   { font-size: 0.9rem; color: var(--nf-text-muted); margin-top: 0.25rem; }
.nf-page-header__actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.nf-page-header__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ─── Homepage hero ──────────────────────────────────────────────────────── */
.nf-hero {
  background: linear-gradient(135deg, var(--nf-primary-dark) 0%, var(--nf-primary) 50%, var(--nf-accent) 100%);
  color: #fff; padding: 5rem 0 4rem; text-align: center;
}
.nf-hero__eyebrow { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.75; margin-bottom: 1rem; }
.nf-hero__title   { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 900; letter-spacing: -0.03em; line-height: 1.15; margin-bottom: 1.25rem; }
.nf-hero__sub     { font-size: 1.1rem; opacity: 0.85; max-width: 560px; margin: 0 auto 2.25rem; line-height: 1.65; }
.nf-hero__cta     { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.nf-hero__cta .nf-btn--primary { background: #fff; color: var(--nf-primary); border-color: #fff; }
.nf-hero__cta .nf-btn--primary:hover { background: #f0f9ff; }
.nf-hero__cta .nf-btn--ghost  { border-color: rgba(255,255,255,0.4); color: #fff; }
.nf-hero__cta .nf-btn--ghost:hover { background: rgba(255,255,255,0.1); }

/* ─── Track cards ────────────────────────────────────────────────────────── */
.nf-tracks { padding: 3.5rem 0; }
.nf-tracks__title { text-align: center; font-size: 1.4rem; font-weight: 800; margin-bottom: 0.5rem; letter-spacing: -0.02em; }
.nf-tracks__sub   { text-align: center; color: var(--nf-text-muted); margin-bottom: 2.25rem; }
.nf-track-card { border-top: 4px solid var(--nf-primary); }
.nf-track-card__icon   { font-size: 2rem; margin-bottom: 0.75rem; }
.nf-track-card__title  { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.35rem; }
.nf-track-card__desc   { font-size: 0.875rem; color: var(--nf-text-muted); margin-bottom: 1rem; line-height: 1.6; }
.nf-track-card__tags   { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.1rem; }
.nf-tag { font-size: 0.72rem; font-weight: 600; background: var(--nf-bg); border: 1px solid var(--nf-border); color: var(--nf-text-muted); padding: 0.2rem 0.55rem; border-radius: 999px; }

/* ─── Auth pages ─────────────────────────────────────────────────────────── */
.nf-auth { min-height: calc(100vh - 88px); display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.nf-auth__box { width: 100%; max-width: 420px; }
.nf-auth__title { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 0.35rem; }
.nf-auth__sub   { color: var(--nf-text-muted); font-size: 0.875rem; margin-bottom: 1.75rem; }
.nf-auth__footer { text-align: center; font-size: 0.83rem; color: var(--nf-text-muted); margin-top: 1.25rem; }

/* ─── Question card ──────────────────────────────────────────────────────── */
.nf-question__text     { font-size: 1rem; font-weight: 600; margin-bottom: 1.25rem; line-height: 1.55; }
.nf-options            { display: flex; flex-direction: column; gap: 0.6rem; }
.nf-option             { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.75rem 1rem; border: 2px solid var(--nf-border); border-radius: var(--nf-radius); cursor: pointer; transition: all 0.12s ease; }
.nf-option:hover       { border-color: var(--nf-accent); background: #f0f9ff; }
.nf-option.selected    { border-color: var(--nf-primary); background: var(--nf-primary-light); }
.nf-option.correct     { border-color: var(--nf-success); background: #dcfce7; }
.nf-option.incorrect   { border-color: var(--nf-danger); background: #fee2e2; }
.nf-option__key        { font-weight: 800; font-size: 0.85rem; min-width: 1.5rem; color: var(--nf-text-muted); }
.nf-option__text       { font-size: 0.9rem; line-height: 1.5; }
.nf-explanation        { margin-top: 1.1rem; padding: 0.85rem; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: var(--nf-radius); font-size: 0.875rem; line-height: 1.6; color: #15803d; }

/* ─── Progress bar ───────────────────────────────────────────────────────── */
.nf-progress { background: var(--nf-border); border-radius: 999px; height: 8px; overflow: hidden; }
.nf-progress__bar { height: 100%; border-radius: 999px; background: var(--nf-primary); transition: width 0.3s ease; }

/* ─── Empty state ────────────────────────────────────────────────────────── */
.nf-empty { text-align: center; padding: 3rem 1rem; color: var(--nf-text-muted); }
.nf-empty__icon  { font-size: 3rem; margin-bottom: 1rem; }
.nf-empty__title { font-size: 1.05rem; font-weight: 700; color: var(--nf-text); margin-bottom: 0.35rem; }
.nf-empty__desc  { font-size: 0.875rem; margin-bottom: 1.25rem; }

/* ─── Card hover variant ─────────────────────────────────────────────────── */
.nf-card--hover { transition: box-shadow 0.15s ease, transform 0.12s ease; }
.nf-card--hover:hover { box-shadow: var(--nf-shadow-md); transform: translateY(-2px); }

/* ─── Question explanation ───────────────────────────────────────────────── */
.nf-explanation { background: #f0fdf4; border-left: 3px solid var(--nf-success); padding: 0.65rem 0.9rem; border-radius: 0 var(--nf-radius) var(--nf-radius) 0; font-size: 0.87rem; line-height: 1.55; color: #166534; }

/* ─── Alert info variant ─────────────────────────────────────────────────── */
.nf-alert--info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

/* ─── Progress bar ───────────────────────────────────────────────────────── */
.nf-progress { height: 4px; background: var(--nf-border); border-radius: 99px; overflow: hidden; }
.nf-progress__bar { height: 100%; background: var(--nf-primary); border-radius: 99px; transition: width 0.3s ease; }

/* ─── Background alt ─────────────────────────────────────────────────────── */
.nf-bg-alt, [style*="--nf-bg-alt"] { background: var(--nf-bg); }
:root { --nf-bg-alt: #f1f5f9; }

/* ─── Curriculum filter bar ──────────────────────────────────────────────── */
.nf-filter-bar { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1.5rem; padding: 1rem; background: var(--nf-surface); border: 1px solid var(--nf-border); border-radius: var(--nf-radius-lg); }
.nf-filter-bar .nf-form-group { margin-bottom: 0; min-width: 160px; }

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.nf-footer { background: var(--nf-text); color: rgba(255,255,255,0.7); padding: 1.75rem 0; margin-top: auto; }
.nf-footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.nf-footer__identity { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.nf-footer__brand {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: #fff; font-weight: 700; text-decoration: none;
}
.nf-footer__brand:hover { text-decoration: none; }
.nf-brand-logo--footer {
  width: min(var(--nf-logo-width), 105px); max-height: 70px;
  padding: 0.2rem; background: #fff; border-radius: 0.4rem;
}
.nf-footer-menu {
  display: flex; align-items: center; gap: 0.9rem;
  list-style: none; margin: 0; padding: 0;
}
.nf-footer-menu a { color: rgba(255,255,255,0.75); font-size: 0.8rem; text-decoration: none; }
.nf-footer-menu a:hover { color: #fff; }
.nf-footer__copy  { font-size: 0.8rem; }

/* ─── Tabs ───────────────────────────────────────────────────────────────── */
.nf-tabs       { display: flex; gap: 0.15rem; border-bottom: 2px solid var(--nf-border); margin-bottom: 1.5rem; }
.nf-tab        { padding: 0.6rem 1.1rem; font-size: 0.875rem; font-weight: 600; color: var(--nf-text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.12s ease; text-decoration: none; }
.nf-tab:hover  { color: var(--nf-text); text-decoration: none; }
.nf-tab.active { color: var(--nf-primary); border-bottom-color: var(--nf-primary); }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nf-grid--3, .nf-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .nf-grid--sidebar { grid-template-columns: 1fr; }
  .nf-header__inner,
  .nf-header--centered .nf-header__inner {
    min-height: 76px; flex-direction: row; justify-content: space-between;
    padding-top: 0.35rem; padding-bottom: 0.35rem;
  }
  .nf-brand-logo,
  .nf-header--compact .nf-brand-logo { width: min(var(--nf-logo-width), 92px); max-height: 62px; }
  .nf-logo__name { font-size: 1rem; }
  .nf-logo__tagline { display: none; }
  .nf-header__nav { display: none; }
  .nf-header__menu-toggle { display: flex; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 0.4rem; }
  .nf-header__menu-toggle span { display: block; width: 22px; height: 2px; background: var(--nf-text); border-radius: 2px; }
  .nf-header__nav.open {
    display: flex; flex-direction: column; align-items: stretch; position: absolute;
    top: 100%; left: 0; right: 0; background: var(--nf-surface);
    border-bottom: 1px solid var(--nf-border); padding: 1rem 1.5rem;
    box-shadow: var(--nf-shadow-md);
  }
  .nf-header__nav.open .nf-menu {
    display: flex; flex-direction: column; align-items: stretch; gap: 0;
    padding-bottom: 0.75rem; border-bottom: 1px solid var(--nf-border);
  }
  .nf-header__nav.open .nf-menu a { display: block; padding: 0.55rem 0; }
  .nf-role-nav { flex-direction: column; align-items: stretch; gap: 0.35rem; }
  .nf-role-nav .nf-nav__link { padding: 0.5rem 0; }
  .nf-role-nav .nf-btn { margin-top: 0.35rem; }
  .nf-header__user { justify-content: space-between; padding: 0.4rem 0; }
}
@media (max-width: 640px) {
  .nf-grid--2, .nf-grid--3, .nf-grid--4 { grid-template-columns: 1fr; }
  .nf-hero { padding: 3rem 0 2.5rem; }
  .nf-page-header__row { flex-direction: column; }
  .nf-footer__inner, .nf-footer__identity { flex-direction: column; align-items: flex-start; }
  .nf-footer-menu { flex-wrap: wrap; }
}
