.card-nav-container {
  position: absolute;
  top: 1.2em;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 800px;
  z-index: 99;
}

.card-nav {
  display: block;
  height: 60px;
  padding: 0;
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  will-change: height;
}

.card-nav-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.45rem 0.55rem 1.1rem;
  z-index: 2;
}

.hamburger-menu {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  gap: 6px;
}

.hamburger-menu:hover .hamburger-line {
  opacity: 0.75;
}

.hamburger-line {
  width: 24px;
  height: 2px;
  background-color: currentColor;
  transition: transform 0.25s ease, opacity 0.2s ease;
  transform-origin: 50% 50%;
}

.hamburger-menu.open .hamburger-line:first-child {
  transform: translateY(4px) rotate(45deg);
}

.hamburger-menu.open .hamburger-line:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

.logo-container {
  display: flex;
  align-items: center;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.logo {
  height: 32px;
  width: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.card-nav-cta-button {
  border: none;
  border-radius: calc(0.75rem - 0.35rem);
  padding: 0 1.35rem;
  height: 100%;
  font-weight: 600;
  font-size: 14px;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: flex;
  align-items: center;
}

.card-nav-cta-button:hover {
  filter: brightness(1.15);
}

/* ─────────────────────── THEME AWARE NAVBAR ─────────────────────── */
/* The navbar background/hamburger/logo colors are set inline (dark by
   default); these overrides let the bar follow light mode too. */
[data-theme="light"] .card-nav {
  background-color: rgba(255, 255, 255, 0.8) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .hamburger-line {
  background-color: #0f172a !important;
}

[data-theme="light"] .logo-text {
  color: #0f172a !important;
}

[data-theme="light"] .nav-card {
  background: rgba(244, 248, 255, 0.92) !important;
  color: #0f172a !important;
}

[data-theme="light"] .nav-card-link {
  color: #334155 !important;
}

/* ─────────────────────── AVATAR CTA ─────────────────────── */
.card-nav-cta-button.nav-avatar-btn {
  padding: 0;
  min-width: 44px;
  min-height: 44px;
  background-color: transparent !important;
  box-shadow: none;
}

.nav-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  border: 2px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  user-select: none;
}

.nav-avatar-img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  user-select: none;
}

.card-nav-content {
  position: absolute;
  left: 0;
  right: 0;
  top: 60px;
  bottom: 0;
  padding: 0.5rem;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  visibility: hidden;
  pointer-events: none;
  z-index: 1;
}

.card-nav.open .card-nav-content {
  visibility: visible;
  pointer-events: auto;
}

.nav-card {
  height: 100%;
  flex: 1 1 0;
  min-width: 0;
  border-radius: calc(0.75rem - 0.2rem);
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  gap: 8px;
  user-select: none;
  cursor: pointer;
}

.nav-card-label {
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.5px;
}

.nav-card-links {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-card-link {
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-card-link:hover {
  opacity: 0.75;
}

/* Active page indication (ui-ux-pro-max: navigation active state) */
.nav-card-link.active {
  color: #38bdf8;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

[data-theme="light"] .nav-card-link.active {
  color: #0284c7;
}

.nav-card-link-icon {
  font-size: 14px;
}

@media (max-width: 768px) {
  .card-nav-container {
    width: 90%;
    top: 1em;
  }

  .card-nav-top {
    padding: 0.5rem 1rem;
    justify-content: space-between;
  }

  .hamburger-menu {
    order: 2;
  }

  .logo-container {
    position: static;
    transform: none;
    order: 1;
  }

  .card-nav-cta-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 14px;
    order: 3;
  }
  .card-nav-cta-button .card-nav-cta-text {
    font-size: 13px;
    white-space: nowrap;
  }
  .card-nav-cta-button.nav-avatar-btn {
    width: 44px;
    padding: 0;
  }

  .card-nav-content {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 0.5rem;
    justify-content: flex-start;
  }

  .nav-card {
    height: auto;
    min-height: 60px;
    flex: 1 1 auto;
  }

  .nav-card-label {
    font-size: 18px;
  }

  .nav-card-link {
    font-size: 15px;
  }
}
