/* ================================================================
   Teachers area — Mobile nav drawer (Stage-16, 2026-06-30)
   Adds a hamburger button + slide-down drawer for screens ≤768px.
   ================================================================ */

.tp-nav-hamburger {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--text-1, #0F172A);
  border-radius: 10px;
  transition: background .15s ease;
}

.tp-nav-hamburger:hover {
  background: var(--surface-2, #F2F3FF);
}

.tp-nav-hamburger svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

@media (max-width: 768px) {
  .tp-nav-hamburger {
    display: inline-flex;
  }

  /* Hide the inline links by default — they're moved to the drawer. */
  .tp-nav > .tp-nav-links {
    display: none !important;
  }

  /* The drawer */
  .tp-nav-drawer {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--surface, #FFFFFF);
    border-bottom: 1px solid var(--border, #E6E8FF);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
    padding: .6rem 1rem 1rem;
    transform: translateY(-110%);
    transition: transform .22s ease;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: .25rem;
    /* Don't intercept clicks while closed — without this, the off-screen drawer
       still blocks every tap on the page. */
    pointer-events: none;
    visibility: hidden;
  }

  .tp-nav-drawer.is-open {
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
  }

  .tp-nav-drawer a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: .65rem .9rem;
    border-radius: 10px;
    color: var(--text-1, #0F172A);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: background .12s ease;
  }

  .tp-nav-drawer a:hover,
  .tp-nav-drawer a.active {
    background: var(--primary-soft, #E0F2FE);
    color: var(--primary, #0284C7);
  }
}

@media (min-width: 769px) {
  .tp-nav-drawer {
    display: none !important;
  }
}

/* ---------- Touch targets in teachers area ---------- */
@media (max-width: 768px) {
  .tp-btn,
  .tp-btn-primary,
  .tp-btn-block {
    min-height: 48px;
  }

  .tp-field input,
  .tp-field select,
  .tp-field textarea {
    min-height: 44px;
    font-size: 16px; /* prevents iOS auto-zoom on focus */
  }
}

/* ================================================================
   Main site — Mobile touch targets (Stage-16)
   The exam page has radio buttons that were rendering 17×17 on mobile.
   Bump every clickable element in the interactive exam to ≥44×44.
   ================================================================ */
@media (max-width: 768px) {
  /* MCQ and TF radio inputs in the interactive exam */
  .q-options-int input[type="radio"],
  .tf-choice input[type="radio"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
  }

  /* The label wrapping each radio — must be ≥44px tappable */
  .q-options-int .opt-label,
  .tf-choice .tf-btn {
    display: flex;
    align-items: center;
    gap: .6rem;
    min-height: 48px;
    padding: .55rem .8rem;
    border-radius: 10px;
    cursor: pointer;
  }

  /* Mode-segment tabs (وضع تفاعلي / ورقة طباعة) */
  .mode-seg .mode-btn {
    min-height: 44px;
    padding: .55rem .9rem;
    font-size: 14px;
  }

  /* Primary action buttons in the exam control bar */
  .ctrl-bar .btn-small {
    min-height: 44px;
    padding: .5rem 1rem;
  }

  /* Nav links — bigger padding so the tap target reaches 44px even when font is small */
  .nav-links .nav-link {
    min-height: 44px;
    padding: .55rem .8rem;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
  }

  /* Bookmark / icon buttons in test rows */
  .bookmark-btn,
  .icon-btn {
    min-width: 44px;
    min-height: 44px;
  }

  /* Inputs on forms: prevent iOS auto-zoom by ensuring ≥16px font */
  input[type="text"],
  input[type="email"],
  input[type="search"],
  input[type="password"],
  input[type="tel"],
  textarea,
  select {
    font-size: 16px;
  }
}

/* ================================================================
   Teachers nav v3 — Stage-17 unification (2026-07-01)
   Override the old tp-nav to match the public site's theme-v3 nav so
   navigating into /teachers/ does NOT feel like jumping to a different site.
   Also exposes a "you are here" indicator for the teachers area.
   ================================================================ */

.tp-nav {
  height: auto !important;
  padding: .85rem 1.25rem !important;
  background: rgba(250,251,252,.85) !important;
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid #E5E7EB !important;
}
[data-theme="dark"] .tp-nav { background: rgba(11,19,32,.85) !important; border-bottom-color: #1F2937 !important; }

.tp-nav-brand-mark {
  width: 38px !important; height: 38px !important;
  border-radius: 11px !important;
  background: linear-gradient(135deg, #6366F1, #A855F7) !important;
  box-shadow: 0 4px 12px rgba(99,102,241,.32);
  padding: 6px;
}
.tp-nav-brand-mark img {
  width: 100% !important; height: 100% !important;
  object-fit: contain !important;
  filter: brightness(0) invert(1);
}

.tp-nav-brand-text strong { letter-spacing: -.01em; }

.tp-nav-links {
  flex-wrap: wrap;
  gap: .2rem !important;
}
.tp-nav-links a {
  padding: .5rem .85rem !important;
  border-radius: 10px;
  font-size: .9rem;
  color: #374151 !important;
  font-weight: 500 !important;
  transition: background .12s, color .12s;
}
.tp-nav-links a:hover {
  background: #F4F6F8 !important;
  color: #0F1419 !important;
}
.tp-nav-links a.active,
.tp-nav-links a.is-active {
  background: #0F1419 !important;
  color: #fff !important;
}
.tp-nav-links a.active::after,
.tp-nav-links a.is-active::after { display: none !important; }

/* "Teachers area" indicator pill */
.tp-area-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .65rem;
  background: linear-gradient(135deg, #6366F1, #A855F7);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  border-radius: 999px;
  margin-left: .35rem;
  box-shadow: 0 4px 12px rgba(99,102,241,.32);
}

@media (max-width: 880px) {
  .tp-nav { padding: .75rem 1rem !important; gap: .5rem; }
  .tp-nav-links { display: none !important; }
  .tp-nav-links.is-open {
    display: flex !important; flex-direction: column;
    position: fixed; top: 70px; left: 1rem; right: 1rem;
    background: #fff; border: 1px solid #E5E7EB;
    border-radius: 18px; padding: .55rem;
    box-shadow: 0 12px 32px rgba(15,20,25,.10); z-index: 40;
  }
  .tp-nav-links.is-open a { width: 100%; }
}

/* ================================================================
   Bottom Navigation (mobile) — Stage-18 (2026-07-01)
   Persistent iOS/Android-style tab bar shown on ≤768px screens.
   Replaces the hamburger drawer for the public site on mobile.
   ================================================================ */

.bottom-nav {
  display: none; /* Desktop default — overridden in mobile media query */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(64px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid rgba(15, 20, 25, .08);
  z-index: 100;
  box-shadow: 0 -4px 16px rgba(15, 20, 25, .06);
}

[data-theme="dark"] .bottom-nav {
  background: rgba(11, 19, 32, .92);
  border-top-color: rgba(255, 255, 255, .08);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, .35);
}

.bottom-nav-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  height: 64px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 4px 4px 0;
  direction: rtl;
}

.bn-item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 4px;
  text-decoration: none;
  color: #6B7280;
  font-size: 11px;
  font-weight: 500;
  border-radius: 12px;
  transition: color .15s ease, background .15s ease, transform .15s ease;
  -webkit-tap-highlight-color: transparent;
}

[data-theme="dark"] .bn-item {
  color: #9CA3AF;
}

.bn-item:hover {
  color: #6366F1;
}

.bn-item:active {
  transform: scale(.94);
}

.bn-item .bn-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bn-item .bn-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bn-item .bn-label {
  line-height: 1.1;
  white-space: nowrap;
}

.bn-item.is-active {
  color: #6366F1;
  background: rgba(99, 102, 241, .10);
}

[data-theme="dark"] .bn-item.is-active {
  color: #A5B4FC;
  background: rgba(99, 102, 241, .18);
}

.bn-item.is-active .bn-icon svg {
  stroke-width: 2.2;
}

/* ---------- Mobile-only: show bottom nav + hide top hamburger drawer ---------- */
@media (max-width: 768px) {
  .bottom-nav {
    display: block;
  }

  body {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }

  /* Hide the top-nav links + hamburger on mobile — the bottom nav replaces them.
     We keep the brand, search, theme toggle, and any nav-auth-btn. */
  .nav .nav-links,
  .nav-v2 .nav-links,
  #nav-links {
    display: none !important;
  }

  .nav-hamburger,
  #nav-hamburger {
    display: none !important;
  }

  /* Hide the legacy hamburger drawer in teachers area too. */
  .tp-nav-hamburger {
    display: none !important;
  }
  .tp-nav-drawer {
    display: none !important;
  }

  /* Ensure offline banner sits above the bottom nav. */
  .twj-offline-banner {
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
}

/* ---------- Desktop: bottom nav strictly hidden ---------- */
@media (min-width: 769px) {
  .bottom-nav {
    display: none !important;
  }
}

/* ================================================================
   "دخول" button in the public top nav — visible on desktop.
   On mobile the top nav-links hide entirely; "دخول" therefore moves
   to make sense in the bottom-nav OR remains accessible via the
   icon button (icon-only on small screens).
   ================================================================ */
.nav-auth-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  height: 38px;
  padding: 0 .8rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366F1, #A855F7);
  color: #fff !important;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(99, 102, 241, .28);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
  -webkit-tap-highlight-color: transparent;
}

.nav-auth-btn:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 16px rgba(99, 102, 241, .38);
}

.nav-auth-btn:active {
  transform: translateY(1px);
}

.nav-auth-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.nav-auth-btn.is-logged-in {
  background: linear-gradient(135deg, #10B981, #059669);
  box-shadow: 0 4px 12px rgba(16, 185, 129, .28);
}

@media (max-width: 768px) {
  /* Top nav-auth-btn is hidden on mobile (bottom-nav handles it).
     Keep it discoverable via icon if needed in the future. */
  .nav-auth-btn {
    display: none !important;
  }
}

/* ---------- Offline indicator banner (small UX win) ---------- */
.twj-offline-banner {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--warn, #F59E0B);
  color: #fff;
  padding: .55rem 1rem;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(245, 158, 11, .35);
  z-index: 9000;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
}

.twj-offline-banner.is-visible {
  opacity: 1;
}
</content>
</invoke>