/* ═══════════════════════════════════════
   Quanta Navbar — includes/navbar.css
   ═══════════════════════════════════════ */

/* ── Top navbar (all screens) ── */
.quanta-navbar {
  width: 100%;
  position: fixed;
  top: 0; left: 0; right: 0;
  background: transparent;
  font-family: var(--q-font, "Poppins", sans-serif);
  z-index: 1000;
  transition: background 0.32s ease, box-shadow 0.32s ease, backdrop-filter 0.32s ease;
  border-bottom: 1px solid transparent;
}

.quanta-navbar.scrolled {
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 24px rgba(20,27,79,.08);
  border-bottom: 1px solid rgba(20,27,79,.06);
}

body.home-page .quanta-navbar.scrolled {
  background: rgba(255,255,255,.92);
}

.quanta-navbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Logo */
.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  margin-right: auto;
}

.nav-logo-badge {
  display: inline-block;
  background: linear-gradient(115deg, var(--q-royal, #3528d9) 0%, #5b4aed 100%);
  color: #fff;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 6px 16px;
  border-radius: 10px;
  font-size: 1.05rem;
  box-shadow: 0 6px 18px rgba(53,40,217,.28);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.nav-logo-img {
  height: 38px;
  width: auto;
  display: block;
  object-fit: contain;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.nav-logo-text {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--q-navy, #141b4f);
  line-height: 1;
}

.nav-logo:hover .nav-logo-img {
  transform: translateY(-1px);
  opacity: 0.9;
}

.nav-logo:hover .nav-logo-badge {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(53,40,217,.36);
}

/* Desktop links */
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
}

.nav-links a {
  text-decoration: none;
  color: var(--q-navy, #141b4f);
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  position: relative;
  transition: color 0.2s ease;
  padding: 4px 0;
}

.quanta-navbar:not(.scrolled) .nav-links a {
  color: var(--q-navy, #141b4f);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: linear-gradient(90deg, var(--q-accent, #e45b7c), var(--q-royal, #3528d9));
  border-radius: 2px;
  transition: width 0.24s ease;
}

.nav-links a:hover,
.nav-links a.active { color: var(--q-royal, #3528d9); }

.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

/* Desktop CTA button */
.nav-cta-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  background: linear-gradient(105deg, var(--q-accent, #e45b7c), #c73d5f);
  color: #fff;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .04em;
  box-shadow: 0 4px 14px rgba(228,91,124,.32);
  transition: transform .2s ease, box-shadow .2s ease;
  white-space: nowrap;
  margin-left: 8px;
}

.nav-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(228,91,124,.44);
}

/* Hamburger — completely removed, bottom nav handles mobile menu */
.nav-toggle { display: none !important; }

/* Mobile animated enquire pill */
.nav-mobile-pill {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 7px 14px 7px 10px;
  background: linear-gradient(105deg, var(--q-accent, #e45b7c), #c73d5f);
  color: #fff;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .03em;
  box-shadow: 0 4px 14px rgba(228,91,124,.38);
  position: relative;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}

.nav-mobile-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(228,91,124,.5);
}

/* Animated pulse dot */
.nav-pill-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #fff;
  flex-shrink: 0;
  position: relative;
}

.nav-pill-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
  animation: pill-pulse 1.6s ease-out infinite;
}

@keyframes pill-pulse {
  0%   { transform: scale(1);   opacity: .7; }
  70%  { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* ── Mobile bottom nav ── */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(20,27,79,.08);
  box-shadow: 0 -4px 24px rgba(20,27,79,.1);
  padding: 5px 3px calc(5px + env(safe-area-inset-bottom, 0px));
  justify-content: space-around;
  align-items: stretch;
}

.mbn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  padding: 5px 2px;
  text-decoration: none;
  color: var(--q-soft, #64748b);
  border-radius: 11px;
  transition: color 0.18s ease, background 0.18s ease;
  min-width: 0;
  position: relative;
}

.mbn-item.active,
.mbn-item:hover { color: var(--q-royal, #3528d9); }

.mbn-item.active { background: rgba(53,40,217,.07); }

.mbn-item--cta {
  color: var(--q-accent, #e45b7c);
}

.mbn-item--cta.active,
.mbn-item--cta:hover { color: #c73d5f; background: rgba(228,91,124,.08); }

.mbn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  position: relative;
}

.mbn-item.active .mbn-icon::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 10px;
  background: rgba(53,40,217,.1);
}

.mbn-item--cta.active .mbn-icon::before {
  background: rgba(228,91,124,.12);
}

.mbn-label {
  font-size: .54rem;
  font-weight: 600;
  letter-spacing: .025em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  /* Hide desktop links and CTA */
  .nav-links { display: none; }
  .nav-cta-btn { display: none; }

  /* Show animated pill */
  .nav-mobile-pill { display: flex; }

  /* Show bottom nav */
  .mobile-bottom-nav { display: flex; }

  /* Bottom padding so content isn't hidden behind bottom nav */
  body { padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }

  .quanta-navbar-inner { padding: 10px 16px; }
}

@media (max-width: 360px) {
  .mbn-label { font-size: .5rem; letter-spacing: 0; }
  .mbn-icon { width: 24px; height: 24px; }
  .mbn-icon svg { width: 20px; height: 20px; }
}

/* Desktop: show links, hide bottom nav and pill */
@media (min-width: 769px) {
  .mobile-bottom-nav { display: none !important; }
  .nav-mobile-pill { display: none !important; }
  body { padding-bottom: 0; }
}

/* ── User dropdown (logged in) ── */
.nav-user-wrap {
  position: relative;
}

.nav-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 5px;
  background: rgba(255,255,255,.9);
  border: 1.5px solid rgba(20,27,79,.1);
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--q-font, "Poppins", sans-serif);
  font-size: .82rem;
  font-weight: 600;
  color: var(--q-navy, #141b4f);
  transition: border-color .2s ease, box-shadow .2s ease;
  box-shadow: 0 2px 8px rgba(20,27,79,.06);
}

.nav-user-btn:hover,
.nav-user-btn[aria-expanded="true"] {
  border-color: rgba(53,40,217,.3);
  box-shadow: 0 4px 14px rgba(20,27,79,.1);
}

.nav-user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.nav-user-initial {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--q-navy-l, #1e2766), var(--q-royal, #3528d9));
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-user-name {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-user-chevron {
  color: var(--q-muted, #64748b);
  transition: transform .22s ease;
  flex-shrink: 0;
}

.nav-user-btn[aria-expanded="true"] .nav-user-chevron {
  transform: rotate(180deg);
}

/* Dropdown menu */
.nav-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  background: #fff;
  border: 1px solid rgba(20,27,79,.08);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(20,27,79,.14);
  overflow: hidden;
  z-index: 2000;
  animation: dropdown-in .18s ease;
}

.nav-user-dropdown.open { display: block; }

@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nav-user-dropdown-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(20,27,79,.06);
}

.nav-dropdown-name {
  font-size: .88rem;
  font-weight: 700;
  color: var(--q-navy, #141b4f);
}

.nav-dropdown-email {
  font-size: .76rem;
  color: var(--q-muted, #64748b);
  margin-top: 2px;
  word-break: break-all;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--q-ink, #0f172a);
  text-decoration: none;
  transition: background .15s ease;
}

.nav-dropdown-item:hover { background: #f8fafc; }

.nav-dropdown-item--danger { color: #dc2626; }
.nav-dropdown-item--danger:hover { background: #fee2e2; }

.nav-dropdown-divider {
  height: 1px;
  background: rgba(20,27,79,.06);
  margin: 4px 0;
}

/* ── Medium Toggle (Desktop) ── */
.nav-medium-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: rgba(255,255,255,.85);
  border: 1.5px solid rgba(20,27,79,.12);
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--q-font, "Poppins", sans-serif);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--q-muted, #64748b);
  transition: border-color .2s ease, box-shadow .2s ease;
  box-shadow: 0 2px 8px rgba(20,27,79,.06);
  white-space: nowrap;
  margin-left: 4px;
}

.nav-medium-toggle:hover {
  border-color: rgba(53,40,217,.3);
  box-shadow: 0 4px 12px rgba(20,27,79,.1);
}

.nmt-option {
  padding: 2px 6px;
  border-radius: 999px;
  transition: background .18s ease, color .18s ease;
  color: var(--q-muted, #64748b);
}

.nmt-option.active {
  background: linear-gradient(115deg, var(--q-royal, #3528d9), #5b4aed);
  color: #fff;
}

.nmt-divider {
  color: rgba(20,27,79,.2);
  font-weight: 400;
  font-size: .7rem;
}

/* ── Medium Toggle (Mobile bottom nav) ── */
.mbn-medium-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--q-font, "Poppins", sans-serif);
}

.mbn-medium-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  background: rgba(53,40,217,.1);
  color: var(--q-royal, #3528d9);
  transition: background .18s ease, color .18s ease;
}

.mbn-medium-btn.medium-hi .mbn-medium-label {
  background: rgba(228,91,124,.12);
  color: var(--q-accent, #e45b7c);
}

@media (max-width: 768px) {
  .nav-medium-toggle { display: none; }
}

@media (min-width: 769px) {
  .mbn-medium-btn { display: none; }
}

/* Mobile top bar medium toggle — only on mobile */
.nav-medium-toggle--mobile {
  display: none;
}

@media (max-width: 768px) {
  .nav-medium-toggle--mobile {
    display: inline-flex;
    margin-left: 0;
    margin-right: 4px;
  }
  /* Hide user button in top bar on mobile — profile is in bottom nav */
  .nav-user-wrap {
    display: none;
  }
}

/* ── 6-item bottom nav adjustment ── */
@media (max-width: 768px) {
  /* When 6 items are present (logged in + medium toggle), shrink slightly */
  .mobile-bottom-nav {
    gap: 0;
  }
  .mbn-item {
    padding: 6px 2px;
    min-width: 0;
  }
  .mbn-label {
    font-size: .55rem;
  }
}

/* ═══════════════════════════════════════
   Resources Mega Dropdown
   ═══════════════════════════════════════ */

/* Wrapper — position anchor */
.nav-dropdown-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* Trigger link — same style as other nav links */
.nav-dropdown-trigger {
  text-decoration: none;
  color: var(--q-navy, #141b4f);
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  position: relative;
  transition: color 0.2s ease;
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.nav-dropdown-trigger::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: linear-gradient(90deg, var(--q-accent, #e45b7c), var(--q-royal, #3528d9));
  border-radius: 2px;
  transition: width 0.24s ease;
}

.nav-dropdown-trigger:hover,
.nav-dropdown-trigger.active { color: var(--q-royal, #3528d9); }

.nav-dropdown-trigger:hover::after,
.nav-dropdown-trigger.active::after { width: 100%; }

.nav-trigger-chevron {
  transition: transform 0.22s ease;
  flex-shrink: 0;
  color: var(--q-muted, #64748b);
}

.nav-dropdown-wrap:hover .nav-trigger-chevron,
.nav-dropdown-wrap.open .nav-trigger-chevron {
  transform: rotate(180deg);
}

/* Mega dropdown panel */
.nav-mega-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 50%;
  width: min(560px, calc(100vw - 32px));
  min-width: 0;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(20,27,79,.16), 0 4px 16px rgba(20,27,79,.08);
  border: 1px solid rgba(20,27,79,.07);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 2000;
  /* Invisible padding-top bridge so mouse can travel from trigger to panel */
  padding-top: 8px;
  margin-top: 0px;
}

/* Show on hover */
.nav-dropdown-wrap:hover .nav-mega-dropdown,
.nav-dropdown-wrap.open .nav-mega-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Small arrow pointing up */
.nav-mega-dropdown::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 50%;
  width: 12px; height: 12px;
  background: #fff;
  border-left: 1px solid rgba(20,27,79,.07);
  border-top: 1px solid rgba(20,27,79,.07);
  transform: translateX(-50%) rotate(45deg);
}

.nmd-inner {
  display: flex;
  gap: 0;
  padding: 8px;
  background: #fff;
  border-radius: 16px;
}

.nmd-inner--classes {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  padding: 14px;
}

.nmd-class-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 102px;
  padding: 11px 10px 10px;
  border: 1px solid rgba(20, 27, 79, .075);
  border-radius: 12px;
  background: linear-gradient(145deg, #ffffff 0%, #f8f7ff 100%);
  color: var(--q-navy, #141b4f);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.nmd-class-card:hover {
  transform: translateY(-2px);
  border-color: rgba(53, 40, 217, .24);
  box-shadow: 0 14px 28px rgba(20, 27, 79, .12);
}

.nmd-class-num {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--q-royal, #3528d9);
  color: #fff;
  font-size: .94rem;
  font-weight: 900;
  line-height: 1;
}

.nmd-class-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.nmd-class-copy strong {
  font-size: .72rem;
  line-height: 1.05;
  white-space: nowrap;
}

.nmd-class-copy small {
  color: var(--q-muted, #64748b);
  font-size: .58rem;
  font-weight: 700;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.nmd-class-arrow {
  margin-top: auto;
  align-self: flex-end;
  width: 24px;
  height: 20px;
  border-radius: 999px;
  background: rgba(232, 82, 121, .12);
  color: var(--q-pink, #e85279);
  display: grid;
  place-items: center;
  font-weight: 900;
  line-height: 1;
}

/* Each class column */
.nmd-class-col {
  flex: 1;
  min-width: 0;
  border-radius: 10px;
  overflow: hidden;
  transition: background 0.15s;
}

.nmd-divider {
  width: 1px;
  background: rgba(20,27,79,.07);
  margin: 8px 4px;
  flex-shrink: 0;
}

/* Class button (header of each column) */
.nmd-class-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 10px;
  text-decoration: none;
  border-radius: 10px 10px 0 0;
  transition: background 0.15s;
}

.nmd-class-btn:hover {
  background: rgba(53,40,217,.05);
}

.nmd-class-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.nmd-class-label {
  font-size: .9rem;
  font-weight: 700;
  color: var(--q-navy, #141b4f);
  letter-spacing: .02em;
}

/* Subject items */
.nmd-subjects {
  display: flex;
  flex-direction: column;
  padding: 2px 6px 8px;
}

.nmd-subject-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  font-size: .84rem;
  font-weight: 500;
  color: var(--q-muted, #475569);
  transition: background 0.15s, color 0.15s;
}

.nmd-subject-item:hover {
  background: rgba(53,40,217,.07);
  color: var(--q-royal, #3528d9);
}

.nmd-subject-item span {
  font-size: 1rem;
  flex-shrink: 0;
}

.nmd-subject-item--all {
  margin-top: 4px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--q-royal, #3528d9);
  border-top: 1px solid rgba(20,27,79,.06);
  padding-top: 10px;
}

.nmd-subject-item--all:hover {
  background: rgba(53,40,217,.06);
  color: var(--q-navy, #141b4f);
}

/* Hide on mobile — bottom nav handles navigation */
@media (max-width: 768px) {
  .nav-dropdown-wrap { display: none; }
}

@media (max-width: 1100px) {
  .nav-mega-dropdown { width: min(500px, calc(100vw - 32px)); }
  .nmd-inner--classes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 920px) {
  .nav-mega-dropdown { width: min(420px, calc(100vw - 28px)); }
  .nmd-inner--classes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nmd-class-card { min-height: 104px; }
}
