/* static/css/style.css */

.nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 2rem;
  background-color: #fff;
  border-bottom: 1px solid #e9ecef;
  position: relative;
  z-index: 6000;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 12px 10px;
  border: none;
  background: transparent;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
  border-radius: 10px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #111;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-header.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-header.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.nav-header.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.logo-image {
  max-height: 40px; /* Adjust as needed */
  max-width: 100%;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.nav-toggle:focus-visible,
.nav-mobile a:focus-visible {
  outline: 3px solid #c2410c;
  outline-offset: 3px;
}

.nav-center {
  display: flex;
  gap: 1.5rem;
  margin-inline: auto;
  align-items: center;
  white-space: nowrap;
}

.nav-center .nav-dropdown {
  position: relative;
  z-index: 6100;
}

.nav-header .dropdown-menu {
  z-index: 6200;
}

.nav-center a {
  text-decoration: none;
  color: #343a40;
  font-weight: 500;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.nav-welcome {
  font-size: 0.9rem;
  color: #6c757d;
  max-width: 16ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-center .nav-dropdown .dropdown-toggle:hover {
  border-color: transparent !important;
}

.dropdown-menu {
  border-radius: 0.5rem;
  border: 1px solid #e9ecef;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  position: absolute;
  z-index: 2100;
}

.dropdown-item {
  font-weight: 500;
}

.dropdown-item:hover {
  background-color: #f8f9fa;
  color: #F97316;
}

.btn-auth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 1.1rem;
  border-radius: 9999px;
  background-color: #F97316;
  color: #fff;
  font-weight: 600;
  border: none;
  box-shadow: 0 0.5rem 1rem rgba(249, 115, 22, 0.2);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn-auth:hover,
.btn-auth:focus {
  background-color: #EA580C;
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-auth:focus {
  outline: none;
  box-shadow: 0 0 0 0.25rem rgba(249, 115, 22, 0.35);
}

.btn-auth .user-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  background: url('../img/user.png') no-repeat center center / contain;
}

.nav-mobile {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
  padding: 1rem 1.5rem 1.5rem;
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  max-height: calc(100vh - 68px);
  max-height: calc(100dvh - 68px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.nav-header.nav-open .nav-mobile {
  display: block;
}

.nav-mobile__links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.65rem 0;
  font-weight: 500;
  color: #343a40;
  text-decoration: none;
}

.nav-mobile__links a:hover {
  color: #F97316;
}

.nav-mobile__divider {
  height: 1px;
  background: #e9ecef;
  margin: 0.75rem 0;
}

.nav-mobile__auth {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.nav-mobile__welcome {
  margin: 0;
  font-size: 0.95rem;
  color: #6c757d;
  overflow-wrap: anywhere;
}

.btn-auth--mobile {
  width: 100%;
  justify-content: center;
  min-height: 48px;
}

@media (max-width: 1199px) {
  .nav-header {
    padding: 0.5rem max(1rem, env(safe-area-inset-right)) 0.5rem max(1rem, env(safe-area-inset-left));
    min-height: 64px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-center,
  .nav-right {
    display: none;
  }

  .nav-center .nav-dropdown {
    display: none;
  }
}

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

  .nav-header {
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-toggle span,
  .btn-auth {
    transition: none;
  }
  .nav-agentspace__text,
  .nav-agentspace__text::after {
    animation: none !important;
  }
}
