/* Shared CodeBash navigation: charcoal, teal identity, quiet violet interaction. */
:root {
  --cb-nav-bg: #20242a;
  --cb-nav-surface: #292e36;
  --cb-nav-border: #363c45;
  --cb-nav-text: #f1f3f4;
  --cb-nav-muted: #c0c5cc;
  --cb-nav-teal: #43c9bc;
  --cb-nav-purple: #a996e8;
}

.cb-nav,
.cb-public-nav,
body > .nav {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--cb-nav-bg);
  border-bottom: 1px solid var(--cb-nav-border);
  color: var(--cb-nav-text);
  backdrop-filter: blur(14px);
}

.cb-nav {
  min-height: 72px;
  padding: 0;
}
nav.navbar.navbar-expand-lg.navbar-dark.bg-primary.cb-nav {
  min-height: 72px !important;
  height: auto !important;
  background-color: var(--cb-nav-bg) !important;
}
nav.navbar.navbar-expand-lg.navbar-dark.bg-primary.cb-nav .cb-nav-inner {
  height: auto !important;
  min-height: 72px;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
nav.navbar.navbar-expand-lg.navbar-dark.bg-primary.cb-nav .navbar-brand {
  height: auto !important;
  min-height: 48px;
}
.cb-nav .cb-nav-inner {
  min-height: 72px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}
.cb-brand,
.cb-brand:hover {
  color: var(--cb-nav-text);
  text-decoration: none;
}
.cb-brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  min-width: 150px;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -.045em;
}
.cb-brand-mark {
  width: 36px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #25655f;
  color: #e8fffa;
  font: 600 .78rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: -.12em;
  padding-right: 2px;
}
.cb-nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  min-width: 0;
}
.cb-nav-links > a,
.cb-nav-links > .dropdown > button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 12px !important;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--cb-nav-muted) !important;
  font-size: .9rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: none !important;
  transition: color .16s ease, background-color .16s ease;
}
.cb-nav-links > a:hover,
.cb-nav-links > .dropdown > button:hover,
.cb-nav-links > a:focus-visible,
.cb-nav-links > .dropdown > button:focus-visible {
  color: var(--cb-nav-text) !important;
  background: var(--cb-nav-surface);
}
.cb-nav-links > a.active,
.cb-nav-links > a[aria-current="page"],
.cb-nav-links > a.fw-bold {
  background: #30353e;
  color: var(--cb-nav-text) !important;
  font-weight: 600;
}
.cb-nav-links > a > i { display: none; }
.cb-nav-links > a[aria-label] > i { display: inline-block; }
.cb-nav-links .ee-nav-pulse { animation: none; }
.cb-nav-links .ee-nav-pulse > i { color: inherit !important; text-shadow: none !important; }
.cb-nav-links .ee-nav-badge { margin-left: 0 !important; }
.cb-nav-links .dropdown-menu {
  z-index: 1040;
  margin-top: 8px;
  padding: 7px;
  border: 1px solid var(--cb-nav-border);
  border-radius: 14px;
  background: #252a31;
  box-shadow: 0 16px 36px rgba(8, 12, 18, .28);
}
.cb-nav-links .dropdown-item {
  min-height: 39px;
  display: flex;
  align-items: center;
  border-radius: 9px;
  color: #d4d8de;
  font-size: .9rem;
}
.cb-nav-links .dropdown-item:hover,
.cb-nav-links .dropdown-item:focus {
  background: #333843;
  color: #fff;
}
.cb-nav-links .dropdown-item.active {
  color: #e4dcff;
  background: rgba(169, 150, 232, .14);
}
.cb-nav-toggle {
  display: none;
  width: 44px;
  height: 42px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid var(--cb-nav-border);
  border-radius: 12px;
  background: transparent;
  color: var(--cb-nav-text);
  font-size: 1.1rem;
  cursor: pointer;
}
.cb-nav-toggle:hover,
.cb-nav-toggle:focus-visible,
.cb-nav-toggle[aria-expanded="true"] {
  background: var(--cb-nav-surface);
  border-color: #5a526f;
}
.cb-nav :focus-visible,
.cb-public-nav :focus-visible,
body > .nav :focus-visible {
  outline: 2px solid var(--cb-nav-purple);
  outline-offset: 3px;
}

/* Legacy public shell uses deliberately shared typography and nav rhythm. */
.cb-public-nav {
  min-height: 72px;
  height: auto !important;
}
.cb-public-nav .cb-public-inner {
  width: min(100%, 1440px) !important;
  min-height: 72px;
  height: auto !important;
  margin: 0 auto !important;
  padding: 10px 28px !important;
  display: flex;
  align-items: center;
  gap: 20px !important;
}
.cb-public-nav .nav-logo,
.cb-public-nav .cb-brand {
  flex: 0 0 auto;
}
.cb-public-nav .nav-logo img { display: none; }
.cb-public-nav .cb-public-panel {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.cb-public-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
}
.cb-public-nav .nav-links a,
body > .nav .nav-links a {
  padding: 9px 12px;
  border-radius: 12px;
  color: var(--cb-nav-muted);
  font: 500 .9rem/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-decoration: none;
  white-space: nowrap;
}
.cb-public-nav .nav-links a:hover,
.cb-public-nav .nav-links a:focus-visible,
body > .nav .nav-links a:hover,
body > .nav .nav-links a:focus-visible {
  color: var(--cb-nav-text);
  background: var(--cb-nav-surface);
}
.cb-public-nav .nav-links a.active,
.cb-public-nav .nav-links a[aria-current="page"],
body > .nav .nav-links a.active,
body > .nav .nav-links a[aria-current="page"] {
  color: var(--cb-nav-text);
  background: #30353e;
  font-weight: 600;
}
.cb-public-nav .nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-left: auto;
  padding-left: 12px;
  border-left: 1px solid var(--cb-nav-border);
}
.cb-public-nav .nav-login {
  padding: 9px 11px;
  color: var(--cb-nav-muted);
  font: 500 .9rem/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-decoration: none;
  white-space: nowrap;
}
.cb-public-nav .nav-login:hover { color: var(--cb-nav-text); }
.cb-public-nav .nav-cta,
.cb-public-nav .cb-public-trial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 17px;
  border: 1px solid rgba(67, 201, 188, .35);
  border-radius: 13px;
  background: var(--cb-nav-teal);
  color: #142827;
  font: 600 .9rem/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-decoration: none;
  white-space: nowrap;
}
.cb-public-nav .nav-cta:hover,
.cb-public-nav .cb-public-trial:hover { filter: brightness(1.06); }
.cb-public-nav .cb-nav-toggle { margin-left: auto; }
.cb-public-nav .nav-cart { color: var(--cb-nav-muted); }

/* The three teacher course views are a quieter extension of the same nav. */
body .teacher-course-hub.hub-nav-shell {
  background: transparent;
  padding: 12px 0;
}
.teacher-course-hub.hub-nav-shell .hub-tabs {
  display: flex;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 7px;
  overflow-x: auto;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: #252a31;
  scrollbar-width: thin;
}
.teacher-course-hub.hub-nav-shell .hub-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 10px;
  border-bottom: 0;
  color: #afb5bd;
  font-size: .88rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color .16s ease, background-color .16s ease;
}
.teacher-course-hub.hub-nav-shell .hub-tabs a:hover { color: #f1f3f4; background: #30353e; }
.teacher-course-hub.hub-nav-shell .hub-tabs a[aria-current="page"] {
  color: #eee9ff;
  background: rgba(169, 150, 232, .14);
  box-shadow: inset 0 0 0 1px rgba(169, 150, 232, .16);
}

@media (max-width: 1279px) {
  .cb-nav .cb-nav-inner { padding-right: 20px; padding-left: 20px; gap: 12px; }
  .cb-nav-toggle { display: inline-flex; }
  .cb-nav-links {
    display: none !important;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: calc(100% + 1px);
    left: 12px;
    right: 12px;
    max-height: min(75dvh, 620px);
    overflow-y: auto;
    padding: 10px;
    border: 1px solid var(--cb-nav-border);
    border-radius: 0 0 16px 16px;
    background: #252a31;
    box-shadow: 0 18px 38px rgba(8, 12, 18, .32);
  }
  .cb-nav-links[data-open="true"] { display: flex !important; }
  .cb-nav-links > a,
  .cb-nav-links > .dropdown > button {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
  }
  .cb-nav-links .dropdown { width: 100%; }
  .cb-nav-links .dropdown-menu {
    position: static !important;
    transform: none !important;
    margin: 2px 0 6px 10px !important;
    width: calc(100% - 10px);
  }
}

@media (max-width: 1279px) {
  .cb-public-nav .cb-public-inner { padding: 10px 18px !important; gap: 10px !important; }
  .cb-public-nav .cb-nav-toggle { display: inline-flex; }
  .cb-public-nav .cb-public-panel {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    left: 12px;
    right: 12px;
    max-height: calc(100dvh - 90px);
    overflow-y: auto;
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--cb-nav-border);
    border-radius: 0 0 16px 16px;
    background: #252a31;
    box-shadow: 0 18px 38px rgba(8, 12, 18, .32);
  }
  .cb-public-nav .cb-public-panel[data-open="true"] { display: flex; }
  .cb-public-nav .nav-links { flex-direction: column; align-items: stretch; }
  .cb-public-nav .nav-links a { display: flex; min-height: 42px; align-items: center; }
  .cb-public-nav .nav-right { margin: 0; padding: 10px 0 0; border-left: 0; border-top: 1px solid var(--cb-nav-border); align-items: stretch; flex-direction: column; }
  .cb-public-nav .nav-login { display: flex; min-height: 42px; align-items: center; }
  .cb-public-nav .nav-cta,
  .cb-public-nav .cb-public-trial { width: 100%; }
}

@media (max-width: 560px) {
  .cb-nav .cb-nav-inner { min-height: 66px; padding: 0 14px; }
  .cb-brand { min-width: 0; font-size: 1.2rem; }
  .cb-brand-mark { width: 34px; height: 30px; }
  .cb-public-nav .cb-public-inner { min-height: 66px; padding: 8px 14px !important; }
  .teacher-course-hub.hub-nav-shell .hub-tabs { width: 100%; }
  .teacher-course-hub.hub-nav-shell .hub-tabs a { padding: 8px 11px; font-size: .82rem; }
}

@media (prefers-reduced-motion: reduce) {
  .cb-nav-links > a,
  .cb-nav-links > .dropdown > button,
  .hub-nav-shell .hub-tabs a { transition: none; }
}
