/* ---------- Map area ---------- */

#mapwrap { position: relative; flex: 1; min-width: 0; }

#map { position: absolute; inset: 0; }

.fab-row {
  position: absolute;
  bottom: calc(26px + env(safe-area-inset-bottom));   /* clear the iOS home indicator */
  left: 50%;
  transform: translateX(-50%);
  z-index: 800;
  display: flex;
  gap: 10px;
}

.fab {
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  padding: 14px 26px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s, background 0.15s;
  white-space: nowrap;
}

.fab:hover { background: var(--accent-dark); transform: translateY(-2px); }

.fab-secondary { background: #fff; color: var(--ink); }
.fab-secondary:hover { background: var(--bg-soft); }

.locate {
  position: absolute;
  right: 14px;
  bottom: calc(26px + env(safe-area-inset-bottom));   /* clear the iOS home indicator */
  z-index: 800;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: #fff;
  font-size: 19px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.locate:hover { background: var(--bg-soft); }

#pickBanner {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

#pickBanner button {
  border: none;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

#pickBanner button:hover { background: rgba(255, 255, 255, 0.32); }

#pickBanner[hidden] { display: none; }

#sharedBanner {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  background: #1e3a8a;
  color: #fff;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow);
  white-space: nowrap;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
}

#sharedBanner[hidden] { display: none; }

/* Read-only shared view: hide everything that mutates the map */
body.readonly #addBtn,
body.readonly #importBtn,
body.readonly #accountBar { display: none; }

/* Viewing a friend's map (read-only, but still signed in so the account bar
   and map switcher stay): hide the place-adding controls. */
body.viewing-friend #addBtn,
body.viewing-friend #importBtn { display: none; }

/* A friend request awaiting my answer puts a dot on the 👥 button. */
#friendsBtn.has-pending { position: relative; }
#friendsBtn.has-pending::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid #fff;
}

#mapwrap.picking #map { cursor: crosshair; }

/* While picking, pins must not swallow map clicks */
#mapwrap.picking .leaflet-marker-icon { pointer-events: none !important; }

/* ---------- Map pins ---------- */

.pin-icon { background: none; border: none; }

.pin {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--c, var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  border: 2.5px solid #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}

.pin::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top: 9px solid var(--c, var(--accent));
  border-bottom: none;
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.2));
}

/* ---------- Leaflet popup ---------- */

.leaflet-popup-content-wrapper {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.leaflet-popup-content { margin: 14px 16px; font-family: inherit; }

.popup { min-width: 200px; max-width: 240px; }

.popup h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 900;
}

.popup .cat-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.popup .cat-line {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  color: #fff;
  background: var(--c, var(--accent));
  border-radius: 999px;
  padding: 2px 9px;
}

/* Light colors (e.g. white): dark text + visible outline instead of white-on-white */
.popup .cat-line.light {
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line);
}

.pin.light { border-color: #94a3b8; }

/* Marker clusters — themed to the app accent */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background-color: rgba(255, 77, 90, 0.2);
}
.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background-color: rgba(255, 77, 90, 0.75);
  color: #fff;
  font-family: "Nunito", system-ui, sans-serif;
  font-weight: 800;
  font-size: 13px;
}

.dot.light,
.cat-swatch.light {
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.2);
}

.cat-option.light.active {
  color: var(--ink);
  border-color: #94a3b8;
}

.popup .rating { color: #f5a623; font-size: 14px; letter-spacing: 2px; margin-bottom: 4px; }

.popup .tags { margin: 4px 0; display: flex; flex-wrap: wrap; gap: 4px; }

.popup .tag {
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 1.5px 8px;
}

.popup .note {
  font-size: 13px;
  color: var(--ink);
  margin: 6px 0;
  line-height: 1.45;
}

.popup .addr { font-size: 11.5px; color: var(--ink-soft); margin: 4px 0 8px; line-height: 1.4; }

.popup .actions { display: flex; gap: 6px; margin-top: 8px; }

.popup .actions button {
  flex: 1;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 6px 0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink-soft);
}

.popup .actions button:hover { border-color: var(--accent); color: var(--accent); }

