/* ===========================================================
   Navigation (Header + Desktop/Mobile + Mobile Tray)
   - Fixed header shell and brand cluster
   - Primary desktop nav + icon buttons
   - Mobile nav trigger icons
   - Slide-down mobile nav tray (menu + CTA buttons)
   =========================================================== */


/* ---- Header shell ---- */
header {
  width: 100%;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: fixed;
  z-index: 9999;
}

/* Centered inner wrapper */
#header_wrapper {
  max-width: var(--wrap-max);
  margin-inline: auto;
  padding-inline: var(--wrap-pad);
  min-height: 84px; /* keep as-is to avoid visual changes */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

#header_left { display: flex; align-items: center; min-width: 0; }
#header_right { display: flex; align-items: center; }

/* Desktop/Mobile swap */
#mobile_nav { display: none; }
@media (max-width: 900px) {
  /* .brand-tagline { display: none; }  (left commented as in original) */
  #main_nav { display: none; }
  #mobile_nav { display: flex; }
  #hamburger-btn { font-size: x-large; }
}


/* ---- Logo cluster (icon + text) ---- */
.logo-container { display: flex; align-items: center; }

.logo-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: inherit;
  transition: opacity .2s ease;
}
.logo-link:hover { opacity: .9; }

.logo-icon {
  display: flex; align-items: center; justify-content: center;
  padding: 10px;
  background: var(--primary);
  border-radius: var(--radius);
}
.map-icon { width: 22px; height: 22px; color: #fff; }

.logo-text { display: flex; flex-direction: column; min-width: 0; }
.brand-title {
  font-size: 1.25rem; font-weight: 800;
  background: var(--primary);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-tagline { font-size: .85rem; color: var(--muted); }


/* ---- Desktop nav ---- */
nav { display: flex; }

nav ul {
  display: flex; align-items: center; gap: 1.2rem;
  flex-wrap: wrap; margin-left: auto;
}

nav ul li a {
  color: var(--link);
  font-size: 1rem;
  font-weight: 500;
  padding: 4px 0;
  transition: color .2s ease;
  white-space: nowrap;
}
nav ul li a:hover { color: #000; }

/* Nudge before the last two nav items (matches original) */
nav ul li:nth-last-child(2) { margin-right: -6px; }


/* ---- Icon-style buttons (used in header + mobile triggers) ---- */
.icon-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  color: #111;
  transition: background-color .2s ease, color .2s ease;
}
.icon-link:hover { background: var(--accent-bg); color: #fff; }
.icon-link i { font-size: 1.25rem; line-height: 1; }

/* Mobile nav trigger icons behave like .icon-link */
#mobile_nav ul { gap: 2rem; }
#mobile_nav ul li i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #111;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0; /* spacing controlled by gap */
  transition: background-color 0.2s ease, color 0.2s ease;
}
#mobile_nav ul li i:hover {
  background: var(--accent-bg);
  color: #fff;
}


/* ---- “Sign up” pill shown in nav (stays here as part of header UI) ---- */
.signup-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; min-width: 105px; padding: .5rem 1.2rem;
  font-size: .95rem; font-weight: 700; color: #fff;
  background: linear-gradient(to right, var(--btn-blue), var(--btn-purple));
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,.15);
  transition: box-shadow .2s ease, transform .02s ease, background .2s ease;
}
.signup-btn:hover {
  background: linear-gradient(to right, var(--btn-blue-hover), var(--btn-purple-hover));
  box-shadow: 0 6px 12px rgba(0,0,0,.2);
  color: #fff;
}
.signup-btn:active { transform: translateY(1px); }


/* ===========================================================
   Mobile Nav Tray (Slide Animation)
   - Smooth open/close with max-height + opacity
   - Menu list and CTA buttons inside tray
   =========================================================== */

#mobile_nav_tray {
  margin: 0 24px;
  padding: 0 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid #ddd;
  background: #fff;

  /* Animation */
  max-height: 0;          /* collapsed */
  opacity: 0;             /* hidden */
  overflow: hidden;       /* hide contents during collapse */
  transition:
    max-height 0.32s ease,
    opacity 0.2s ease;
  will-change: max-height, opacity;
}

#mobile_nav_tray.open {
  max-height: 500px;      /* large enough to reveal menu */
  opacity: 1;             /* visible */
}

/* Tray menu list */
#mobile_nav_items { display: table-caption; margin-top: 12px; }
#mobile_nav_items ul { margin-top: 12px; }

/* Tray CTA buttons area */
#mobile_nav_buttons {
  display: grid;
  margin: 24px 0 12px 0;
  border-top: solid 1px var(--border);
  padding-top: 12px;
}

#mobile_nav_buttons button {
  color: #000;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;                 /* space between icon/text if any */
  white-space: nowrap;
  font-size: 0.975rem;         /* text-sm */
  font-weight: 500;            /* font-medium */
  padding: 0 2rem;             /* px-8 */
  height: 44px;                /* h-11 */
  width: 100%;                 /* w-full */
  border-radius: 12px;         /* rounded-md */
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(43, 99, 217, 0.2); /* border-primary/20 */
  background: linear-gradient(to right, #ebf2ff, #f4eaff); /* from-blue-50 to-purple-50 */
  transition: all 0.3s ease;
  cursor: pointer;
}

/* Emphasized tray CTA (Sign Up) */
#mobile_nav_buttons #mobile_signup_button {
  color: #fff;
  background: linear-gradient(to right, var(--btn-blue-hover), #ec4899);
  font-weight: 700;
  border: none;
  margin-bottom: 8px;
}

/* Note: the .gradient-text utility used on the Login button
   is defined in utilities.css and intentionally not duplicated here. */


/* ---- Small spacing tune-ups for narrow viewports ---- */
@media (max-width: 560px) {
  #header_wrapper { padding-inline: 16px; }
}
