/* Desktop navigation - visible on larger screens */
.desktop-nav {
  display: none;
}

@media (min-width: 1280px) {
  .desktop-nav {
    display: flex;
  }
}

/* Mobile navigation - visible below larger screens */
.mobile-nav {
  display: flex;
}

@media (min-width: 1280px) {
  .mobile-nav {
    display: none;
  }
}

/* Mobile menu dropdown */
.mobile-menu-dropdown {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
  opacity: 0;
}

.mobile-menu-dropdown.open {
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 0.75rem;
  opacity: 1;
}

.mobile-menu-dropdown a {
  font-size: 0.95rem;
  line-height: 1.25rem;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
}

@media (min-width: 1280px) {
  .mobile-menu-dropdown {
    display: none;
  }
}

nav {
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.nav-bar-row {
  width: 100%;
}

@media (min-width: 1280px) {
  .desktop-nav {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
    margin-left: 2rem;
    gap: clamp(0.5rem, 1vw, 1rem);
  }
}

.desktop-nav-list {
  display: flex;
  flex: 1;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
  overflow: visible;
  gap: clamp(0.25rem, 0.75vw, 0.75rem);
  margin: 0;
  padding: 0 0.25rem;
}

.desktop-nav-list li {
  flex-shrink: 0;
}

.nav-item {
  position: relative;
}

.nav-item--has-children .nav-caret {
  margin-left: 0.25rem;
  font-size: 0.85rem;
  opacity: 0.7;
  transition: transform 0.15s ease;
}

.nav-item--has-children:hover .nav-caret,
.nav-item--has-children:focus-within .nav-caret {
  transform: translateY(1px) rotate(180deg);
}

.nav-dropdown {
  position: absolute;
  top: 100%;
  margin-top: 0.2rem;
  left: 0;
  min-width: 12.5rem;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 0.75rem;
  box-shadow: 0 14px 45px rgba(0, 0, 0, 0.12), 0 10px 18px rgba(0, 0, 0, 0.08);
  padding: 0.35rem;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 30;
}

.nav-item--has-children .nav-dropdown::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 12px;
  background: transparent;
}

[data-theme="dark"] .nav-dropdown {
  background: rgba(17, 24, 39, 0.98);
  border-color: rgba(75, 85, 99, 0.6);
  box-shadow: 0 14px 45px rgba(0, 0, 0, 0.45), 0 10px 18px rgba(0, 0, 0, 0.4);
}

.nav-dropdown ul {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nav-item--has-children:hover .nav-dropdown,
.nav-item--has-children:focus-within .nav-dropdown,
.nav-item--has-children.dropdown-open .nav-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.desktop-nav-list a {
  white-space: nowrap;
  padding: 0.375rem 0.625rem;
}

.nav-user-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: 'IBM Plex Sans', sans-serif;
  color: #374151;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(241, 245, 249, 0.9));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: all 0.2s ease;
}

.nav-user-inline:hover {
  border-color: rgba(148, 163, 184, 0.5);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .nav-user-inline {
  color: #e2e8f0;
  border-color: rgba(71, 85, 105, 0.4);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.85));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .nav-user-inline:hover {
  border-color: rgba(100, 116, 139, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.nav-user-inline__icon {
  display: inline-flex;
  width: 0.95rem;
  height: 0.95rem;
  color: inherit;
}

.nav-user-inline__icon svg {
  width: 100%;
  height: 100%;
}

.nav-user-inline__label {
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  opacity: 0.8;
}

.nav-user-inline__name {
  font-weight: 600;
  white-space: nowrap;
}

.nav-user-inline--mobile {
  margin: 0.75rem 0;
}

.nav-user-inline--admin {
  border-color: rgba(239, 68, 68, 0.4);
  background: linear-gradient(135deg, rgba(254, 242, 242, 0.95), rgba(254, 226, 226, 0.9));
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.nav-user-inline--admin:hover {
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .nav-user-inline--admin {
  border-color: rgba(239, 68, 68, 0.5);
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.6), rgba(69, 10, 10, 0.5));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(239, 68, 68, 0.1);
}

[data-theme="dark"] .nav-user-inline--admin:hover {
  border-color: rgba(248, 113, 113, 0.6);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3), inset 0 1px 0 rgba(239, 68, 68, 0.1);
}

.mobile-subnav {
  display: none;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0.2rem 0 0.35rem;
  padding-left: 0.75rem;
}

.mobile-subnav.open {
  display: flex;
}

.mobile-caret {
  margin-left: auto;
  font-size: 0.95rem;
  opacity: 0.55;
  transition: transform 0.2s ease;
}

.mobile-caret.open {
  transform: rotate(90deg);
}
