/* Navigation Styles for WSCC Workflow Admin Dashboard */
/* WSCC-20703: Fix Nav-Bar Being Crowded */

/* ============================================
   1. BASE NAVIGATION STYLES
   ============================================ */

/* Ensure nav uses flexbox properly to prevent overlap */
header nav {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
  justify-content: flex-start;
}

/* Override Pico CSS default nav ul spacing */
header nav > ul {
  margin: 0 !important;
  padding: 0 !important;
}

/* Left nav list - don't shrink, stay fixed */
header nav > ul:first-child {
  flex-shrink: 0;
}

/* Nav right section alignment - push to left, allow compression from right */
.nav-right {
  display: flex;
  align-items: center;
  flex-shrink: 1;
  margin-left: 0 !important;
  gap: 0;
}

.nav-right > li {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.nav-right .profile-dropdown-container {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
}

/* ============================================
   2. LEFT SIDE (Logo, Title, Environment)
   ============================================ */

.nav-left-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-logo {
  max-height: 24px;
}

.nav-title {
  white-space: nowrap;
}

/* ============================================
   3. RIGHT SIDE (Nav Links, Config, Theme, Profile)
   ============================================ */

.nav-config-btn {
  background: none;
  border: none;
  color: var(--pico-primary);
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-decoration: none;
  font-size: inherit;
  font-family: inherit;
  white-space: nowrap;
}

.nav-config-btn:hover {
  text-decoration: underline;
}

/* Remove outline for mouse clicks, but keep for keyboard navigation */
.nav-config-btn:focus {
  outline: none;
}

.nav-config-btn:focus-visible {
  outline: 2px solid var(--pico-primary);
  outline-offset: 2px;
}

.nav-theme-btn {
  background-color: transparent;
  color: #28BDFF;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

/* ============================================
   4. HAMBURGER MENU
   ============================================ */

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--pico-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  margin-left: auto;
}

.nav-hamburger:hover {
  color: var(--pico-primary-hover);
}

/* ============================================
   5. RESPONSIVE BREAKPOINTS
   ============================================ */

/* Mobile hamburger menu */
@media (max-width: 1200px) {
  /* Show hamburger button */
  .nav-hamburger {
    display: block;
  }

  /* Hide desktop nav on mobile */
  .nav-desktop {
    display: none !important;
  }

  /* Style mobile dropdown menu when shown */
  .nav-mobile {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--pico-background-color);
    padding: 1rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    z-index: 999;
    border-top: 1px solid var(--pico-muted-border-color);
  }

  /* Stack nav items vertically */
  .nav-mobile > li {
    width: 100%;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--pico-muted-border-color);
    justify-content: flex-start;
  }

  .nav-mobile > li:last-child {
    border-bottom: none;
  }

  /* Position nav container for absolute dropdown */
  header nav {
    position: relative;
  }
}

/* Hide mobile menu on desktop */
@media (min-width: 1201px) {
  .nav-mobile {
    display: none !important;
  }
}

/* Push nav to the left on narrower screens to maximize space before hamburger kicks in */
@media (max-width: 1400px) and (min-width: 1201px) {
  header {
    padding-left: 0 !important;
    padding-right: 0 !important;
    max-width: none !important;
  }

  header nav {
    margin-left: 0 !important;
    padding-left: 1rem;
  }
}