/* ===================================================================
   TOPPERSCLOUD — Navbar Stylesheet
   Responsive navigation: desktop mega-dropdowns + mobile drawer
   =================================================================== */

/* ---------- Header Wrapper ---------- */
.tc-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

/* ---------- Navbar Bar ---------- */
.tc-navbar {
  background: var(--white);
  border-bottom: 1px solid transparent;
  transition: background .3s ease, box-shadow .3s ease, border-color .3s ease;
}

.tc-navbar.scrolled {
  box-shadow: 0 2px 20px rgba(0, 0, 0, .08);
  border-bottom-color: var(--neutral-200);
}

.tc-navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 24px;
}

/* ---------- Logo ---------- */
.tc-navbar__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.tc-navbar__logo img {
  height: 36px;
  width: auto;
}

.tc-navbar__logo-text {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.tc-navbar__logo-toppers {
  color: var(--primary);
}

.tc-navbar__logo-cloud {
  color: var(--secondary);
}

/* ---------- Desktop Nav ---------- */
.tc-navbar__nav {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: center;
}

.tc-navbar__menu {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tc-navbar__item {
  position: relative;
}

/* Nav link / dropdown toggle */
.tc-navbar__link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 18px;
  font-family: var(--font-body);
  font-size: 0.938rem;
  font-weight: 500;
  color: var(--neutral-700);
  background: none;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: color .25s ease, background .25s ease;
}

.tc-navbar__link:hover,
.tc-navbar__link:focus-visible {
  color: var(--primary);
  background: var(--blue-100);
}

.tc-navbar__link.active {
  color: var(--primary);
}

.tc-navbar__chevron {
  font-size: 20px;
  transition: transform .3s ease;
}

.tc-navbar__dropdown.open .tc-navbar__chevron {
  transform: rotate(180deg);
}

/* ---------- Desktop Dropdown ---------- */
.tc-navbar__dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 320px;
  background: var(--white);
  border: 1px solid var(--neutral-200);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .10), 0 4px 12px rgba(0, 0, 0, .05);
  padding: 12px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
  z-index: 100;
}

.tc-navbar__dropdown.open .tc-navbar__dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Dropdown grid */
.tc-dropdown__grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tc-dropdown__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--dark);
  transition: background .2s ease;
}

.tc-dropdown__item:hover {
  background: var(--blue-100);
}

.tc-dropdown__item--highlight {
  border-top: 1px solid var(--neutral-200);
  margin-top: 6px;
  padding-top: 14px;
}

.tc-dropdown__icon {
  font-size: 24px;
  color: var(--primary);
  flex-shrink: 0;
  background: var(--blue-100);
  border-radius: 10px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tc-dropdown__title {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--dark);
  line-height: 1.3;
}

.tc-dropdown__desc {
  display: block;
  font-size: 0.8rem;
  color: var(--neutral-500);
  line-height: 1.4;
  margin-top: 1px;
}

/* ---------- Right Actions ---------- */
.tc-navbar__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* My Account CTA (desktop) */
.tc-navbar__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--white);
  border: 2px solid var(--primary);
  border-radius: var(--radius-full);
  text-decoration: none;
  white-space: nowrap;
  transition: all .3s ease;
}

.tc-navbar__cta .material-symbols-outlined {
  font-size: 20px;
}

.tc-navbar__cta-arrow {
  font-size: 18px !important;
  transition: transform .3s ease;
}

.tc-navbar__cta:hover {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(0, 149, 255, .25);
}

.tc-navbar__cta:hover .tc-navbar__cta-arrow {
  transform: translateX(3px);
}

/* Account icon (mobile only) */
.tc-navbar__account-mobile {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  text-decoration: none;
  transition: background .3s ease;
}

.tc-navbar__account-mobile .material-symbols-outlined {
  font-size: 22px;
}

.tc-navbar__account-mobile:hover {
  background: var(--primary-dark);
}

/* ---------- Hamburger (mobile only) ---------- */
.tc-navbar__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  gap: 5px;
  z-index: 1001;
}

.tc-navbar__hamburger span {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--dark);
  border-radius: 3px;
  transition: all .35s cubic-bezier(.4, 0, .2, 1);
  transform-origin: center;
}

/* Hamburger → X animation */
.tc-navbar__hamburger.active span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}

.tc-navbar__hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.tc-navbar__hamburger.active span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* ---------- Mobile Overlay ---------- */
.tc-mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 26, 46, .45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility .35s ease;
  z-index: 1001;
}

.tc-mobile-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* ---------- Mobile Drawer ---------- */
.tc-mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  max-width: 85vw;
  height: 100dvh;
  background: var(--white);
  z-index: 1002;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .4s cubic-bezier(.4, 0, .2, 1);
  box-shadow: -8px 0 30px rgba(0, 0, 0, .1);
  overflow: hidden;
}

.tc-mobile-drawer.open {
  transform: translateX(0);
}

.tc-mobile-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--neutral-200);
  flex-shrink: 0;
}

.tc-mobile-drawer__header .tc-navbar__logo img {
  height: 30px;
}

.tc-mobile-drawer__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--light);
  border: none;
  cursor: pointer;
  color: var(--dark);
  transition: background .2s ease;
}

.tc-mobile-drawer__close:hover {
  background: var(--neutral-200);
}

.tc-mobile-drawer__close .material-symbols-outlined {
  font-size: 22px;
}

/* ---------- Mobile Menu Items ---------- */
.tc-mobile-drawer__nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  -webkit-overflow-scrolling: touch;
}

.tc-mobile-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tc-mobile-menu__toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 14px;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--dark);
  cursor: pointer;
  border-radius: 12px;
  transition: background .2s ease;
}

.tc-mobile-menu__toggle:hover {
  background: var(--light);
}

.tc-mobile-menu__icon {
  font-size: 22px;
  color: var(--primary);
}

.tc-mobile-menu__chevron {
  font-size: 20px;
  margin-left: auto;
  color: var(--neutral-400);
  transition: transform .3s ease;
}

.tc-mobile-accordion.open .tc-mobile-menu__chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

/* Accordion panel */
.tc-mobile-accordion__panel {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s cubic-bezier(.4, 0, .2, 1);
}

.tc-mobile-accordion.open .tc-mobile-accordion__panel {
  max-height: 400px;
}

.tc-mobile-accordion__panel li a {
  display: block;
  padding: 11px 14px 11px 50px;
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--neutral-600);
  border-radius: 10px;
  text-decoration: none;
  transition: background .2s ease, color .2s ease;
}

.tc-mobile-accordion__panel li a:hover,
.tc-mobile-accordion__panel li a.active {
  background: var(--blue-100);
  color: var(--primary);
}

/* ---------- Mobile Drawer Footer ---------- */
.tc-mobile-drawer__footer {
  padding: 16px 20px;
  border-top: 1px solid var(--neutral-200);
  flex-shrink: 0;
}

.tc-mobile-drawer__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  background: var(--primary);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: background .3s ease;
}

.tc-mobile-drawer__cta .material-symbols-outlined {
  font-size: 20px;
}

.tc-mobile-drawer__cta:hover {
  background: var(--primary-dark);
}

/* ---------- Body spacer (compensate for fixed header) ---------- */
body {
  padding-top: 72px;
}

/* ===================================================================
   RESPONSIVE
   =================================================================== */

/* -------- Tablet & below (≤ 991px) -------- */
@media (max-width: 991px) {
  .tc-navbar__inner {
    height: 64px;
  }

  .tc-navbar__logo-text {
    font-size: 1.05rem;
  }

  .tc-navbar__nav {
    display: none;
  }

  .tc-navbar__cta {
    display: none;
  }

  .tc-navbar__account-mobile {
    display: flex;
  }

  .tc-navbar__hamburger {
    display: flex;
  }

  body {
    padding-top: 24px;
  }

  
}

/* -------- Desktop (≥ 992px) -------- */
@media (min-width: 992px) {
  .tc-mobile-overlay,
  .tc-mobile-drawer {
    display: none !important;
  }

  .tc-navbar__hamburger {
    display: none !important;
  }

  .tc-navbar__account-mobile {
    display: none !important;
  }
}

/* -------- Large desktop (≥ 1200px) -------- */
@media (min-width: 1200px) {
  .tc-navbar__inner {
    height: 76px;
  }

  .tc-navbar__logo img {
    height: 40px;
  }

  .tc-navbar__link {
    padding: 10px 20px;
    font-size: 0.95rem;
  }

  body {
    padding-top: 16px;
  }
}

/* -------- Small mobile (≤ 480px) -------- */
@media (max-width: 480px) {
  .tc-mobile-drawer {
    width: 100vw;
    max-width: 100vw;
  }

  .tc-navbar__logo img {
    height: 30px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   USER AVATAR / ACCOUNT DROPDOWN  (shown when classroom session active)
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Shared avatar circle ── */
.tc-navbar__user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--tc-primary, #4f46e5);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  user-select: none;
}
.tc-navbar__user-avatar--sm {
  width: 28px;
  height: 28px;
  font-size: 0.75rem;
}

/* ── Pill button that triggers the dropdown ── */
.tc-navbar__user-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.tc-navbar__user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border: 2px solid transparent;
  border-radius: 40px;
  background: transparent;
  cursor: pointer;
  color: var(--tc-text, #1e1b4b);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.18s, border-color 0.18s;
}
.tc-navbar__user-btn:hover,
.tc-navbar__user-btn[aria-expanded="true"] {
  background: rgba(79, 70, 229, 0.08);
  border-color: rgba(79, 70, 229, 0.25);
}
.tc-navbar__user-chevron {
  font-size: 18px;
  transition: transform 0.2s;
}
.tc-navbar__user-btn[aria-expanded="true"] .tc-navbar__user-chevron {
  transform: rotate(180deg);
}

/* ── Dropdown menu panel ── */
.tc-navbar__user-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 210px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  padding: 6px;
  list-style: none;
  z-index: 1200;
}
.tc-navbar__user-menu.is-open {
  display: block;
  animation: tcMenuFadeIn 0.18s ease;
}
@keyframes tcMenuFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Menu items ── */
.tc-navbar__user-item a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--tc-text, #1e1b4b);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s;
}
.tc-navbar__user-item a:hover {
  background: rgba(79, 70, 229, 0.07);
  color: var(--tc-primary, #4f46e5);
}
.tc-navbar__user-item a .material-symbols-outlined {
  font-size: 18px;
  opacity: 0.75;
}
.tc-navbar__user-item--danger a {
  color: #dc2626;
}
.tc-navbar__user-item--danger a:hover {
  background: rgba(220, 38, 38, 0.07);
  color: #dc2626;
}
.tc-navbar__user-divider {
  height: 1px;
  background: rgba(0,0,0,0.08);
  margin: 4px 8px;
}

/* Mobile drawer: sign-out link below the CTA */
.tc-mobile-drawer__signout {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 0;
  font-size: 0.85rem;
  color: #dc2626;
  text-decoration: none;
  font-weight: 600;
}

/* On desktop, hide avatar-initial pill from mobile icon slot */
@media (min-width: 992px) {
  .tc-navbar__account-mobile  { display: none; }
}
/* On mobile, hide the desktop user-wrap dropdown */
@media (max-width: 991px) {
  .tc-navbar__user-wrap { display: none; }
}
