/* ---- Classy, muted palette ----
   looking  #3d5a80 slate blue
   roommate #4f7355 forest sage
   sublet   #a97e50 muted ochre
   community#6d5a7c muted plum
*/
body {
  background: #f5f4f1;
  color: #2c2b33;
  font-family: "Manrope", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
h1, h2, h3, h4, h5, .navbar-brand, .home-brand, .hero h1 {
  font-family: "Manrope", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 700;
  letter-spacing: -.01em;
}

.site-nav { background: #262a33; }

.hero {
  /* On-brand gradient: brand coral deepened for readability — coral-dark
     (#e11d48) -> deep rose (#b81c42) -> community plum accent (#5c4a6a).
     135deg keeps the lighter coral at the top-left h1 and deepens toward the
     denser text below for strong white contrast. */
  background: linear-gradient(135deg, #e11d48 0%, #b81c42 52%, #5c4a6a 100%);
  color: #fff; border-radius: 14px; padding: 3rem 2rem; margin-bottom: 2rem;
}
.hero h1 { font-weight: 700; }
.hero-howto {
  max-width: 860px; background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .25); border-radius: 12px;
  padding: .6rem 1.25rem;
}
.hero-howto li { margin-bottom: .25rem; }

/* How-it-works flow */
.howto-graphic { text-align: center; margin: .25rem 0 1.25rem; }
.howto-graphic svg { width: 100%; max-width: 640px; height: auto; }

.howto-step { display: flex; gap: .7rem; margin-bottom: .9rem; line-height: 1.45; }
.howto-num {
  flex: 0 0 auto; width: 1.8rem; height: 1.8rem; border-radius: 50%;
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .45);
  color: #fff; font-weight: 700; display: flex; align-items: center;
  justify-content: center; font-size: .95rem;
}
.howto-num-zero {
  background: rgba(255, 255, 255, .09);
  border-style: dashed; border-color: rgba(255, 255, 255, .5);
}
.howto-paths { list-style: none; padding-left: 0; margin: .35rem 0 0; }
.howto-paths li { margin-bottom: .3rem; padding-left: 1rem; position: relative; }
.howto-paths li::before {
  content: "→"; position: absolute; left: 0; opacity: .8;
}

.howto-privacy {
  margin-top: 1.1rem; padding: .85rem 1.1rem;
  background: rgba(0, 0, 0, .16); border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 10px;
}
.howto-privacy-title { font-weight: 700; margin-bottom: .4rem; }
.howto-privacy ul { list-style: none; padding-left: 0; margin: 0; }
.howto-privacy li { margin-bottom: .3rem; padding-left: 1.4rem; position: relative; }
.howto-privacy li::before {
  content: "✓"; position: absolute; left: 0; color: #fff; opacity: .85; font-weight: 700;
}

.howto-toggle {
  background: transparent; border: none; color: #fff; font-weight: 700;
  font-size: 1.05rem; width: 100%; display: flex; gap: .4rem;
  justify-content: center; align-items: center; padding: .3rem;
}
.howto-chevron { transition: transform .18s ease; display: inline-block; }
.howto-toggle[aria-expanded="true"] .howto-chevron { transform: rotate(180deg); }

.category-card { transition: transform .12s ease, box-shadow .12s ease; border: none; }
.category-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.10) !important; }
.category-card { border-top: 3px solid #999; }
.card-looking   { border-top-color: #2979ff; }
.card-roommate  { border-top-color: #00c853; }
.card-sublet    { border-top-color: #ff9100; }
.card-community { border-top-color: #aa00ff; }
.card-tagline { color: #55606f; font-style: italic; margin-bottom: .5rem; }

.btn-cat {
  color: #fff; border: none; font-weight: 600;
  transition: transform .12s ease, background-color .12s ease, color .12s ease;
}
.btn-cat-looking   { background: #2979ff; }
.btn-cat-roommate  { background: #00c853; }
.btn-cat-sublet    { background: #ff9100; }
.btn-cat-community { background: #aa00ff; }

/* Homepage "Browse" buttons: on hover the whole button becomes a faint tint
   of its panel color (never white). */
.btn-panel.btn-cat-looking:hover   { background: #e3edff; color: #14459e; }
.btn-panel.btn-cat-roommate:hover  { background: #dcf7e6; color: #0a6b34; }
.btn-panel.btn-cat-sublet:hover    { background: #ffeed6; color: #9a5800; }
.btn-panel.btn-cat-community:hover { background: #f3e3ff; color: #6a12a0; }

/* Listing-page buttons: keep their color, just grow slightly on hover. */
.btn-grow.btn-cat-looking:hover   { background: #2979ff; color: #fff; }
.btn-grow.btn-cat-roommate:hover  { background: #00c853; color: #fff; }
.btn-grow.btn-cat-sublet:hover    { background: #ff9100; color: #fff; }
.btn-grow.btn-cat-community:hover { background: #aa00ff; color: #fff; }
.btn-grow:hover { transform: scale(1.05); }

#map { height: 70vh; border-radius: 12px; }
.listing-thumb {
  height: 42px; width: 42px; object-fit: cover; border-radius: 4px;
  margin: 1px; border: 1px solid #ddd;
}
.gallery-open { cursor: pointer; transition: transform .1s ease; }
.gallery-open:hover { transform: scale(1.08); }
.gallery-img { max-height: 70vh; object-fit: contain; background: #f1f1f1; border-radius: 6px; }
.detail-photo { height: 110px; width: 150px; object-fit: cover; border-radius: 8px; border: 1px solid #ddd; }
.detail-gallery-img { width: 100%; max-height: 320px; object-fit: cover; border-radius: 8px; border: 1px solid #ddd; }

/* List / Map view toggle — bigger, colorful, sits by the search bar */
.view-toggle .view-btn {
  font-weight: 700; font-size: 1rem; padding: .5rem 1.4rem;
  border: 2px solid #2979ff; color: #2979ff; background: #fff;
}
.view-toggle .view-btn:first-child { border-radius: 999px 0 0 999px; }
.view-toggle .view-btn:last-child { border-radius: 0 999px 999px 0; }
.view-toggle .view-btn.active { background: #2979ff !important; color: #fff !important; }
.view-toggle .view-btn:hover { background: #e3edff; }
.view-toggle .view-btn.active:hover { background: #1f6bff !important; }

/* Compact tables that avoid horizontal scrolling */
.compact-table { font-size: .88rem; }
.compact-table th, .compact-table td { white-space: normal; }
.listing-row:hover { background: #f7f7f7; }

/* ---- Map price bubbles (rounded rectangles, lightly colored by type) ---- */
.price-bubble {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: .8rem; font-weight: 700; white-space: nowrap;
  border: 1.5px solid; box-shadow: 0 1px 4px rgba(0,0,0,.25);
  transform: translate(-50%, -50%);
}
.pb-looking   { background: #e3edff; border-color: #2979ff; color: #14459e; }
.pb-roommate  { background: #dcf7e6; border-color: #00c853; color: #0a6b34; }
.pb-sublet    { background: #ffeed6; border-color: #ff9100; color: #9a5800; }
.pb-community { background: #f3e3ff; border-color: #aa00ff; color: #6a12a0; }

/* ---- Map legend as vertical colored toggles ---- */
.map-legend { border: 1px solid var(--air-line, #e5e5e5); border-radius: 12px; padding: .75rem .9rem; }
.legend-toggle {
  display: flex; align-items: center; gap: .6rem; cursor: pointer;
  padding: .3rem .2rem; font-size: 1.02rem; user-select: none; border-radius: 8px;
}
.legend-toggle:hover { background: #f5f5f5; }
.legend-swatch {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  border: 2px solid var(--sc); background: var(--sc);
  transition: background .12s ease, opacity .12s ease;
}
.legend-toggle:not(.active) { opacity: .55; }
.legend-toggle:not(.active) .legend-swatch { background: transparent; }

/* Men/Women slider toggle under the legend — a segmented control with a thumb
   that smoothly slides between the two options. */
.mw-toggle {
  position: relative; display: inline-flex; padding: 3px;
  background: #ececf1; border-radius: 999px;
}
.mw-thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px);
  background: #33303e; border-radius: 999px; z-index: 0;
  transition: left .25s cubic-bezier(.4, 0, .2, 1);
}
.mw-toggle[data-view="Female"] .mw-thumb { left: 50%; }
.mw-btn {
  position: relative; z-index: 1; flex: 1 1 50%; text-align: center;
  padding: .3rem 1.15rem; text-decoration: none; color: #555;
  font-weight: 600; font-size: .9rem; white-space: nowrap;
  transition: color .2s ease;
}
.mw-btn.active { color: #fff; }

/* Map "Ctrl + scroll to zoom" hint overlay */
.map-zoom-hint {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .35); color: #fff; font-weight: 600; font-size: 1.1rem;
  opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 1000;
  border-radius: inherit;
}
.map-zoom-hint.show { opacity: 1; }

/* Apartment Needed map: table popup of everyone looking at a clicked spot */
.looking-table-popup .ltp-head { font-weight: 700; margin-bottom: 4px; }
.looking-table-popup table { font-size: .82rem; }
.looking-table-popup tbody tr:hover { background: #eef4ff; }

/* Map listing popups (logical, labeled layout) */
.map-popup .mp-title { font-weight: 700; font-size: 1rem; margin-bottom: 2px; }
.map-popup .mp-price { font-weight: 700; color: #111; margin-bottom: 5px; font-size: .95rem; }
.map-popup .mp-row { display: flex; justify-content: space-between; gap: 14px; font-size: .85rem; line-height: 1.5; }
.map-popup .mp-k { color: #777; }
.map-popup .mp-v { font-weight: 600; text-align: right; }
.map-popup .mp-link { display: inline-block; margin-top: 7px; font-weight: 600; }
/* Category-colored popup button: keep white text (Leaflet colors <a> links)
   and keep the exact category color on hover (no Bootstrap darkening). */
.leaflet-container a.btn-cat,
.leaflet-container a.btn-cat:hover,
.leaflet-container a.btn-cat:focus { color: #fff; }
.leaflet-container a.btn-cat-looking:hover,
.leaflet-container a.btn-cat-looking:focus   { background: #2979ff; }
.leaflet-container a.btn-cat-roommate:hover,
.leaflet-container a.btn-cat-roommate:focus  { background: #00c853; }
.leaflet-container a.btn-cat-sublet:hover,
.leaflet-container a.btn-cat-sublet:focus    { background: #ff9100; }
.leaflet-container a.btn-cat-community:hover,
.leaflet-container a.btn-cat-community:focus { background: #aa00ff; }
/* Make carousel arrows visible over light photos */
.carousel-control-prev-icon, .carousel-control-next-icon {
  background-color: rgba(0,0,0,.5); border-radius: 50%; padding: 14px;
}
.photo-thumb {
  height: 90px; width: 90px; object-fit: cover; border-radius: 6px; border: 1px solid #ddd;
}
.listing-card { border-left: 4px solid #3d5a80; }

.legend-item { font-size: .85rem; display: inline-flex; align-items: center; }
.legend-dot {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%;
  margin-right: 6px; border: 1px solid rgba(0,0,0,.25);
}

/* Color-coded nav buttons matching the map legend (muted tints on dark) */
.nav-cat {
  font-weight: 600;
  border-radius: 8px;
  margin: 2px 6px;
  padding: .3rem .6rem !important;
  text-align: center;
}
/* More even breathing room between top-nav items so they aren't smooshed */
@media (min-width: 992px) {
  .site-nav .navbar-nav { column-gap: .5rem; }
  .site-nav .navbar-nav .nav-item { display: flex; align-items: center; }
}
/* "Looking for Housing" is the largest button; the other three are equal
   width and slightly narrower. */
@media (min-width: 992px) {
  .nav-cat.nav-looking { min-width: 210px; font-size: 1.02rem; padding: .45rem .8rem !important; }
  .nav-cat.nav-roommate,
  .nav-cat.nav-sublet,
  .nav-cat.nav-community { min-width: 155px; }
}
.navbar-dark .nav-link.nav-looking   { color: #8ba6c9 !important; }
.navbar-dark .nav-link.nav-roommate  { color: #8fb59a !important; }
.navbar-dark .nav-link.nav-sublet    { color: #d0af86 !important; }
.navbar-dark .nav-link.nav-community { color: #ad97bf !important; }
.nav-cat.nav-looking:hover   { background: #3d5a80; color: #fff !important; }
.nav-cat.nav-roommate:hover  { background: #4f7355; color: #fff !important; }
.nav-cat.nav-sublet:hover    { background: #a97e50; color: #fff !important; }
.nav-cat.nav-community:hover { background: #6d5a7c; color: #fff !important; }

/* Section headings that group the category cards on the home page */
.group-heading {
  font-size: .8rem; font-weight: 800; letter-spacing: .09em;
  text-transform: uppercase; color: #6b6b76; margin-bottom: .6rem;
}

/* "Beds to Fill" grouping — a framed cluster of the three nav buttons */
.beds-frame {
  display: flex; align-items: center; gap: 0;
  border: 1px solid rgba(128,128,128,.45); border-radius: 14px;
  padding: .15rem .45rem .15rem .35rem;
}
.beds-frame .nav-cat { margin: 2px 2px; }
.beds-frame-label {
  font-size: .62rem; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; opacity: .7; white-space: nowrap; padding: 0 .15rem;
}
/* More breathing room among the right-side nav items, and a gap before them */
@media (min-width: 992px) {
  .nav-right { column-gap: 1.1rem; margin-left: 2rem; }
}

/* Map button: white rounded pill with a colorful gradient border (kept as-is) */
.nav-link.nav-map {
  color: #3c4043 !important;
  font-weight: 600;
  border-radius: 999px;
  padding: .3rem 1rem !important;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(90deg, #2979ff, #00c853, #ff9100, #aa00ff) border-box;
  border: 2px solid transparent;
}
.nav-link.nav-map:hover { color: #000 !important; box-shadow: 0 2px 6px rgba(0,0,0,.25); }

/* "Viewing" switcher — a small square button in the nav */
.viewing-square {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 50px; height: 46px; border-radius: 8px; text-align: center; line-height: 1.05;
  background: rgba(255,255,255,.08); color: #cdd2dc; text-decoration: none;
}
.viewing-square:hover { background: rgba(255,255,255,.18); color: #fff; }
.viewing-square .vs-label { font-size: .52rem; letter-spacing: .02em; opacity: .85; }
.viewing-square .vs-gender { font-size: 1rem; font-weight: 800; color: #fff; }
/* Full word ("Men"/"Women") — hidden by default, shown in the condensed
   mobile header where the switcher becomes an inline "Viewing: Men" pill. */
.viewing-square .vs-gender-full { display: none; }

/* Account link: two stacked lines on desktop ("Create Account" / "Log In"),
   collapsing to a single "Create Account / Log In" line on mobile. */
.acct-line { display: inline; }
.acct-sep  { display: inline; }
@media (min-width: 992px) {
  .acct-link { text-align: center; line-height: 1.15; }
  .acct-link .acct-line { display: block; }
  .acct-link .acct-sep  { display: none; }
}

/* Flash messages as brief toast bubbles pinned to the top of the viewport */
.toast-stack {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 2000; display: flex; flex-direction: column; align-items: center;
  gap: .5rem; width: max-content; max-width: 92vw; pointer-events: none;
}
.toast-bubble {
  pointer-events: auto; display: inline-flex; align-items: center; gap: .75rem;
  background: #262a33; color: #fff; padding: .6rem 1rem; border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0,0,0,.24); font-weight: 600; font-size: .95rem;
  max-width: 100%; opacity: 0; transform: translateY(-10px);
  transition: opacity .25s ease, transform .25s ease;
}
.toast-bubble.show { opacity: 1; transform: translateY(0); }
.toast-bubble .toast-msg { line-height: 1.3; }
.toast-close {
  background: none; border: none; color: inherit; font-size: 1.15rem;
  line-height: 1; cursor: pointer; opacity: .8; padding: 0;
}
.toast-close:hover { opacity: 1; }
.toast-success { background: #10a94a; }
.toast-info, .toast-message { background: #2b6cb0; }
.toast-danger { background: #d64545; }
.toast-warning { background: #b3701a; }

/* ---- Condensed mobile header (below Bootstrap's lg breakpoint) ------------
   Instead of the hamburger dropdown, show a compact always-open layout:
   row 1 = all four page links on one line, row 2 = the Viewing switcher and
   the account link side by side. */
@media (max-width: 991.98px) {
  .site-nav .navbar-toggler { display: none !important; }
  .site-nav .navbar-collapse {
    display: flex !important; flex-direction: column; align-items: stretch;
    gap: .4rem; width: 100%;
  }

  /* Row 1: the four category links, shrunk to fit one line */
  .site-nav .navbar-nav.me-auto {
    flex-direction: row; flex-wrap: nowrap; align-items: center;
    justify-content: space-between; gap: .15rem; width: 100%; margin: 0 !important;
  }
  .site-nav .beds-frame { border: none; padding: 0; gap: 0; }
  .site-nav .beds-frame-label { display: none; }
  .site-nav .nav-cat {
    font-size: .52rem; padding: .28rem .22rem !important; margin: 0; letter-spacing: 0;
    white-space: nowrap; min-width: 0 !important; border-radius: 999px !important;
  }

  /* Row 2: Viewing switcher + account link on one line, next to each other */
  .site-nav .nav-right {
    flex-direction: row; flex-wrap: nowrap; align-items: center;
    justify-content: flex-start; gap: 1rem; width: 100%; margin: 0 !important;
  }
  .site-nav .nav-right .nav-item { margin: 0 !important; }

  /* Viewing square becomes an inline "Viewing: Men" pill */
  .viewing-square {
    flex-direction: row; align-items: center; gap: .3rem;
    width: auto; height: auto; padding: .3rem .6rem;
  }
  .viewing-square .vs-label { font-size: .8rem; opacity: .95; }
  .viewing-square .vs-gender { display: none; }
  .viewing-square .vs-gender-full { display: inline; font-size: .85rem; font-weight: 800; }

  .acct-link { text-align: left; white-space: nowrap; }
}

/* Home page top bar (nav is hidden on the landing page) */
.home-brand { font-weight: 700; color: #ff385c; font-size: 1.15rem; }
.home-toplink { color: #46536e; text-decoration: none; }
.home-toplink:hover { text-decoration: underline; }

/* Gender-view chooser gate */
.choose-wrap { max-width: 780px; margin: 3rem auto; }
.choose-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2.75rem 1rem; border-radius: 16px; text-decoration: none; color: #fff;
  transition: transform .12s ease, box-shadow .12s ease;
  box-shadow: 0 4px 14px rgba(0,0,0,.10);
}
.choose-btn:hover { transform: translateY(-4px); box-shadow: 0 12px 26px rgba(0,0,0,.18); color: #fff; }
.choose-icon { font-size: 3rem; line-height: 1; margin-bottom: .5rem; }
.choose-label { font-size: 1.3rem; font-weight: 600; }
.choose-men   { background: linear-gradient(135deg, #3d5a80, #2f4763); }
.choose-women { background: linear-gradient(135deg, #8a5a72, #664a5c); }
