/* ==========================================================================
   CivicAI Navigation Bar
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.site-header.scrolled {
  box-shadow: var(--shadow-sm);
  background-color: rgba(255, 255, 255, 0.98);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

/* Brand Logo */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  user-select: none;
}

.brand-emblem-wrapper {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.brand-logo:hover .brand-emblem-wrapper {
  transform: scale(1.05);
}

.brand-emblem-img {
  width: 100%;
  height: 100%;
}

.brand-text-block {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: var(--fw-extrabold);
  letter-spacing: -0.03em;
  color: var(--color-primary-950);
  line-height: 1.1;
}

.brand-name span {
  color: var(--color-brand-blue);
}

.brand-tagline {
  font-size: 0.6875rem;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.04em;
  color: var(--color-emerald-700);
  text-transform: uppercase;
}

/* Nav Menu Items */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: var(--fw-medium);
  transition: color var(--transition-fast);
  position: relative;
  padding: 0.5rem 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-brand-blue);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: var(--color-brand-blue);
  transition: width var(--transition-fast);
  border-radius: var(--radius-full);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Nav Controls / Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Language Toggle Pill */
.language-selector {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem;
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
}

.lang-btn {
  background: transparent;
  border: none;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lang-btn.active {
  background-color: var(--bg-surface);
  color: var(--color-brand-blue);
  box-shadow: var(--shadow-xs);
}

.lang-btn:hover:not(.active) {
  color: var(--text-primary);
}

/* Mobile Hamburger Toggle */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  color: var(--text-primary);
  cursor: pointer;
}

/* Mobile Menu Drawer */
@media (max-width: 900px) {
  .nav-menu {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background-color: var(--bg-surface);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-lg);
  }

  .nav-menu.open {
    display: flex;
  }

  .mobile-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-actions .btn {
    display: none;
  }
}
/* =====================================================
   CivicAI User Account
   ===================================================== */

.user-account {
  position: relative;
  display: none;
  margin-left: 0.5rem;
}

.user-account-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.user-account-btn:hover {
  background: var(--bg-surface-subtle);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-700);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.user-name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  width: 240px;
  padding: 0.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-surface);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  display: none;
  z-index: 1000;
}

.user-dropdown.show {
  display: block;
}

.user-dropdown-header {
  padding: 0.7rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0.35rem;
}

.user-dropdown-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.user-dropdown-header strong {
  display: block;
  font-size: 0.8rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.7rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
}

.user-dropdown button:hover {
  background: var(--bg-surface-subtle);
}

.user-dropdown button svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.user-dropdown hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 0.35rem 0;
}

.user-dropdown .logout-btn {
  color: #dc2626;
}
/* ==========================================================================
   Theme Toggle
   ========================================================================== */

.theme-toggle {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  background: var(--bg-surface-subtle);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}
