/* ==========================================================================
   Open Minds Academy — Full-Height Slide-In Left Navigation Drawer (v69)
   60fps Mobile Performance: Zero blur filters, crisp solid surfaces,
   48px touch targets, purple (#6d28d9) active states, zero orange.
   ========================================================================== */

body.nav-drawer-open {
  overflow: hidden;
}

@media (min-width: 821px) {
  .nd-wrap {
    display: none !important;
  }
}

.nd-wrap {
  position: fixed;
  inset: 0;
  z-index: 1250;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0s linear 260ms;
}

.nd-wrap[hidden] {
  display: none !important;
}

.nd-wrap.open {
  pointer-events: auto;
  visibility: visible;
  transition-delay: 0s;
}

/* Crisp Scrim — solid translucent overlay for 60fps mobile scrolling/compositing */
.nd-scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .52);
  opacity: 0;
  transition: opacity 200ms ease;
}

.nd-wrap.open .nd-scrim {
  opacity: 1;
}

/* Slide-In Left Drawer Panel */
.nd-panel {
  position: relative;
  z-index: 1;
  width: min(85vw, 336px);
  max-width: 336px;
  height: 100dvh;
  max-height: 100dvh;
  background: #ffffff;
  color: #0f172a;
  transform: translateX(-100%);
  transition: transform 260ms cubic-bezier(.16, 1, .3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 16px 0 44px rgba(15, 23, 42, .22);
  border-right: 1px solid #eef2f6;
  overflow: hidden;
  outline: none;
}

.nd-wrap.open .nd-panel {
  transform: translateX(0);
}

/* Drawer Header (Logged-In User Profile OR Guest Brand Header) */
.nd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 14px;
  border-bottom: 1px solid #eef2f6;
  background: #ffffff;
  flex: none;
}

.nd-head:has(.nd-user) {
  align-items: flex-start;
}

.nd-user {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  flex: 1;
  min-width: 0;
}

.nd-av {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 999px;
  background: #1e293b;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .12);
}

.nd-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.nd-user-name {
  font-size: 15.5px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nd-user-sub {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nd-user-edit {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 48px;
  margin-top: 2px;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: #6d28d9;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.nd-user-edit:hover,
.nd-user-edit:active {
  color: #5b21b6;
  text-decoration: underline;
}

/* Guest Brand Header */
.nd-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding-left: 4px;
  text-decoration: none;
  color: #0f172a;
  flex: 1;
  min-width: 0;
}

.nd-brand-mark {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 10px;
  background: #6d28d9;
  color: #ffffff;
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 2px 6px rgba(109, 40, 217, .24);
}

.nd-brand-mark svg {
  width: 22px;
  height: 22px;
}

.nd-brand-txt {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.05;
  min-width: 0;
}

.nd-brand-txt strong {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.nd-brand-txt small {
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #6d28d9;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Close Drawer Button */
.nd-close {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 12px;
  border: 0;
  background: #f8fafc;
  color: #334155;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  flex: none;
  transition: background .15s ease, color .15s ease;
}

.nd-close:hover,
.nd-close:active {
  background: rgba(109, 40, 217, .1);
  color: #6d28d9;
}

.nd-close svg {
  width: 20px;
  height: 20px;
}

/* Guest Auth 2-Button Strip */
.nd-auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #eef2f6;
  background: #fafbfd;
  flex: none;
}

.nd-btn {
  min-height: 48px;
  height: 48px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.nd-btn-outline {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

.nd-btn-outline:hover,
.nd-btn-outline:active {
  border-color: #6d28d9;
  color: #6d28d9;
  background: rgba(109, 40, 217, .06);
}

.nd-btn-solid {
  background: #6d28d9;
  color: #ffffff;
  border: 1px solid #6d28d9;
  box-shadow: 0 2px 8px rgba(109, 40, 217, .22);
}

.nd-btn-solid:hover,
.nd-btn-solid:active {
  background: #5b21b6;
  border-color: #5b21b6;
}

/* Scrollable Navigation Body */
.nd-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nd-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 8px;
}

.nd-group + .nd-group {
  padding-top: 10px;
  border-top: 1px solid #eef2f6;
}

.nd-gtitle {
  padding: 6px 12px 4px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

/* 48px Touch-Friendly Navigation Items */
.nd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #1e293b;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: background .14s ease, color .14s ease;
}

.nd-item:hover,
.nd-item:active {
  background: #f8fafc;
  color: #0f172a;
}

.nd-item.on {
  background: rgba(109, 40, 217, .09);
  color: #6d28d9;
  font-weight: 700;
}

.nd-ic {
  width: 22px;
  height: 22px;
  min-width: 22px;
  display: inline-grid;
  place-items: center;
  color: #475569;
  flex: none;
  transition: color .14s ease;
}

.nd-ic svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.nd-item.on .nd-ic,
.nd-item:active .nd-ic {
  color: #6d28d9;
}

.nd-lbl {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Categories Accordion */
.nd-acc {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nd-chev {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  color: #94a3b8;
  margin-left: auto;
  flex: none;
  transition: transform 200ms ease, color 150ms ease;
}

.nd-chev svg {
  width: 16px;
  height: 16px;
}

.nd-acc.open .nd-chev {
  transform: rotate(180deg);
  color: #6d28d9;
}

.nd-acc-panel {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 6px 22px;
  margin-left: 18px;
  border-left: 1.5px solid #e2e8f0;
}

.nd-acc.open .nd-acc-panel {
  display: flex;
}

.nd-subitem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #334155;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: background .14s ease, color .14s ease;
}

.nd-subitem:hover,
.nd-subitem:active {
  background: rgba(109, 40, 217, .08);
  color: #6d28d9;
}

.nd-subitem-all {
  color: #6d28d9;
  font-weight: 700;
}

.nd-arr {
  font-size: 14px;
  font-weight: 800;
  color: #6d28d9;
  margin-left: auto;
}

/* Badges & Live Status Pill */
.nd-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(109, 40, 217, .1);
  color: #6d28d9;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  margin-left: auto;
  flex: none;
}

.nd-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(225, 29, 72, .1);
  color: #e11d48;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  margin-left: auto;
  flex: none;
}

.nd-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #e11d48;
  display: inline-block;
}

/* Drawer Footer (Language Picker & Logout) */
.nd-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #eef2f6;
  background: #fafbfd;
  flex: none;
}

.nd-lang-btn,
.nd-logout-btn,
.nd-foot-btn {
  min-height: 48px;
  min-width: 48px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}

.nd-lang-btn {
  background: #ffffff;
  color: #334155;
  border: 1px solid #e2e8f0;
  flex: 1;
  justify-content: flex-start;
}

.nd-lang-btn:hover,
.nd-lang-btn:active {
  border-color: #6d28d9;
  color: #6d28d9;
}

.nd-logout-btn {
  background: rgba(109, 40, 217, .08);
  color: #6d28d9;
  border: 1px solid transparent;
  justify-content: center;
}

.nd-logout-btn:hover,
.nd-logout-btn:active {
  background: rgba(109, 40, 217, .15);
}
