/* ============================================================
   Advero — Shared Navbar Styles (navbar.css)
   Include this in every page: <link rel="stylesheet" href="/navbar.css">
============================================================ */

/* AUTH-GATED NAV — hidden until navbar.js confirms a logged-in session.
   navbar.js REMOVES this class on login (restoring each element's own
   normal/responsive display rule) and ADDS it back on logout/no-session,
   so logged-out visitors never see Browse/Messages/My Listings, even briefly. */
.mh-auth-gated { display: none !important; }

#mh-nav {
  background: #5DADE2;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  gap: 1rem;
}

/* LOGO */
.mh-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  flex-shrink: 0;
}
.mh-logo-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #F5C000, #ffda00);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(245,192,0,0.35);
  flex-shrink: 0;
}
.mh-logo-text {
  font-family: 'Calibri', 'Calibri Regular', sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  color: #1a1a1a;
  letter-spacing: -0.3px;
  line-height: 1;
}
.mh-logo-text span { color: #F5C000; }

/* NAV LINKS */
.mh-nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
  justify-content: center;
}
.mh-nav-link {
  color: #10314a; /* dark on light blue = 7:1+ contrast (WCAG AA) */
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  transition: color 0.2s;
  position: relative;
  white-space: nowrap;
}
.mh-nav-link:hover { color: #000; }
.mh-nav-link.active { color: #000; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.mh-nav-msg { display: flex; align-items: center; gap: 0.35rem; }
.mh-msg-badge {
  background: #E53935;
  color: #fff;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.4;
}

/* ACTIONS */
.mh-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.mh-signin-btn {
  padding: 0.45rem 1rem;
  background: transparent;
  color: #1a1a1a;
  border: 1px solid rgba(0,0,0,0.2);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.mh-signin-btn:hover { background: rgba(0,0,0,0.08); }

.mh-post-btn {
  padding: 0.45rem 1rem;
  background: #F5C000;
  color: #000;
  border: none;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  display: flex; align-items: center; gap: 0.35rem;
  white-space: nowrap;
}
.mh-post-btn:hover { background: #e0ae00; transform: translateY(-1px); }

/* USER AVATAR MENU */
.mh-user-menu { position: relative; }
.mh-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #0A1F6E;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.4);
  transition: border-color 0.2s;
  user-select: none;
  font-family: 'DM Sans', sans-serif;
}
.mh-avatar:hover { border-color: #F5C000; }

.mh-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  box-shadow: 0 10px 36px rgba(0,0,0,0.14);
  min-width: 200px;
  overflow: hidden;
  z-index: 200;
}
.mh-dropdown.open { display: block; animation: mhFadeIn 0.15s ease; }
@keyframes mhFadeIn { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:translateY(0)} }
.mh-dropdown-name {
  padding: 0.85rem 1rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #F3F4F6;
  font-family: 'DM Sans', sans-serif;
}
.mh-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  color: #1a1a1a;
  text-decoration: none;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.15s;
  cursor: pointer;
}
.mh-dropdown-item:hover { background: #F9FAFB; }
.mh-dropdown-divider { height: 1px; background: #F3F4F6; margin: 0.25rem 0; }
.mh-signout { color: #DC2626 !important; }
.mh-signout:hover { background: #FEF2F2 !important; }

/* HAMBURGER (mobile) */
.mh-hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.mh-hamburger span {
  display: block; width: 22px; height: 2px;
  background: #1a1a1a; border-radius: 2px;
  transition: all 0.2s;
}

/* MOBILE NAV */
@media(max-width: 768px) {
  #mh-nav { padding: 0 1rem; }
  .mh-hamburger { display: flex; }
  .mh-nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: #5DADE2;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.5rem;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    z-index: 999;
  }
  .mh-nav-links.open { display: flex; }
  .mh-signin-btn { display: none; }
}
