/* =============================================================================
   Navbar Block
   Additional navbar styles beyond app.css base.
   Includes: brand with subtitle, link separators, dark teal theme, 
   inline hamburger icon, branch selector positioning
   ============================================================================= */

/* ---------------------------------------------------------------------------
   Brand with subtitle (stacked layout)
   e.g. "UJ 宇猎" + line + "UNIVERSAL JAECOO"
   --------------------------------------------------------------------------- */
.navbar-brand-stacked {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
  text-decoration: none;
}

.navbar-brand-stacked .brand-main {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.navbar-brand-stacked .brand-divider {
  width: 100%;
  height: 1px;
  background: currentColor;
  opacity: 0.35;
  margin: 2px 0;
}

.navbar-brand-stacked .brand-subtitle {
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.8;
}

/* When brand-stacked class present on navbar-brand */
.navbar .navbar-brand.brand-stacked {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* ---------------------------------------------------------------------------
   Link separators (pipe, slash, dot)
   Applied to .navbar-nav with a modifier class
   --------------------------------------------------------------------------- */
.navbar-nav.nav-separator-pipe > .nav-item + .nav-item::before {
  content: '|';
  display: inline-block;
  color: inherit;
  opacity: 0.4;
  padding: 0 0.15rem;
  font-weight: 300;
  align-self: center;
}

.navbar-nav.nav-separator-slash > .nav-item + .nav-item::before {
  content: '/';
  display: inline-block;
  color: inherit;
  opacity: 0.4;
  padding: 0 0.15rem;
  font-weight: 300;
  align-self: center;
}

.navbar-nav.nav-separator-dot > .nav-item + .nav-item::before {
  content: '•';
  display: inline-block;
  color: inherit;
  opacity: 0.4;
  padding: 0 0.15rem;
  font-weight: 300;
  align-self: center;
}

.navbar-nav.nav-separator-pipe > .nav-item,
.navbar-nav.nav-separator-slash > .nav-item,
.navbar-nav.nav-separator-dot > .nav-item {
  display: inline-flex;
  align-items: center;
}

/* Remove Bootstrap default gap when separators are active so they show properly */
.navbar-nav.nav-separator-pipe,
.navbar-nav.nav-separator-slash,
.navbar-nav.nav-separator-dot {
  gap: 0 !important;
}

/* ---------------------------------------------------------------------------
   Inline hamburger icon — placed inside a nav-link next to text
   --------------------------------------------------------------------------- */
/* Center the text + hamburger icon vertically inside the nav-link */
.nav-link .nav-link-content {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.navbar-inline-hamburger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 18px;
  height: 14px;
  gap: 3px;
  margin-left: 6px;
  vertical-align: middle;
}

.navbar-inline-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ---------------------------------------------------------------------------
   Dark navbar refinements (applied automatically when scheme is dark)
   --------------------------------------------------------------------------- */
.navbar.navbar-dark .navbar-brand,
.navbar.navbar-dark .navbar-brand:hover {
  color: #ffffff;
}

.navbar.navbar-dark .nav-link {
  color: rgba(255, 255, 255, 0.85) !important;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 0.5rem 0.6rem;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

.navbar.navbar-dark .nav-link:hover,
.navbar.navbar-dark .nav-link:focus {
  color: #ffffff !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

.navbar.navbar-dark .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.85);
}

.navbar.navbar-dark .navbar-toggler-icon {
  filter: brightness(0) invert(1);
}

.navbar.navbar-dark .navbar-inline-hamburger span {
  background: rgba(255, 255, 255, 0.85);
}

/* ---------------------------------------------------------------------------
   Right-aligned dropdown fix
   When navbar-nav is justified to the end (justify-content-lg-end), dropdowns 
   without dropdown-menu-end would overflow off-screen to the right.
   This ensures they open leftward automatically.
   --------------------------------------------------------------------------- */
/* When navbar-nav is right-aligned, ensure proper positioning context */
.navbar-nav.justify-content-lg-end > .nav-item.dropdown {
  position: relative;
}

.navbar-nav.justify-content-lg-end > .nav-item.dropdown > .navbar-dropdown-menu:not(.dropdown-menu-end) {
  right: 0;
  left: auto;
}

/* ---------------------------------------------------------------------------
   Responsive adjustments
   --------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .navbar-nav.nav-separator-pipe > .nav-item + .nav-item::before,
  .navbar-nav.nav-separator-slash > .nav-item + .nav-item::before,
  .navbar-nav.nav-separator-dot > .nav-item + .nav-item::before {
    content: none;
  }

  .navbar.navbar-dark {
    padding: 0.5rem 0.75rem;
  }

  .navbar.navbar-dark .nav-link {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .navbar.navbar-dark .navbar-nav .nav-item:last-child .nav-link {
    border-bottom: none;
  }

  /* On mobile, reset the right-aligned dropdown positioning fix */
  .navbar-nav.ms-auto > .nav-item.dropdown > .navbar-dropdown-menu:not(.dropdown-menu-end) {
    right: auto;
    left: 0;
  }
}
