* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; font-family: -apple-system, Roboto, "Segoe UI", sans-serif; }
#app { position: relative; height: 100vh; width: 100vw; overflow: hidden; }
#map { position: absolute; inset: 0; z-index: 1; }

#brandStrip {
  position: absolute; top: 0; left: 0; right: 0; z-index: 500;
  background: #14532d; color: #fff; text-align: center; font-size: 12px;
  padding: 4px; text-decoration: none; opacity: 0.92;
}

#installBanner {
  position: absolute; top: 30px; left: 10px; right: 10px; z-index: 500;
  background: #fff8e1; border: 1px solid #f0c14b; border-radius: 10px;
  padding: 8px 10px; display: flex; align-items: center; gap: 8px;
  font-size: 12px; box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
#installBanner.hidden { display: none; }
#installBanner span { flex: 1; }
#installBtn { background: #1a7f5a; color: white; border: none; border-radius: 6px; padding: 6px 10px; font-size: 12px; }
#installDismiss { background: none; border: none; font-size: 14px; color: #888; }

#topbar {
  position: absolute; top: 38px; left: 10px; right: 10px; z-index: 500;
  display: flex; align-items: center; gap: 8px;
}
#searchBox {
  flex: 1; padding: 12px 14px; border-radius: 24px; border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2); font-size: 15px; outline: none;
}
.pill {
  width: 14px; height: 14px; border-radius: 50%; background: #ccc;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3); flex-shrink: 0;
}
.pill.online { background: #2ecc71; }
.pill.offline { background: #e74c3c; }

#categoryBar {
  position: absolute; top: 90px; left: 10px; right: 10px; z-index: 500;
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px;
}
.chip {
  flex-shrink: 0; padding: 6px 12px; border-radius: 16px; border: none;
  background: white; box-shadow: 0 1px 4px rgba(0,0,0,0.2); font-size: 13px; cursor: pointer;
}
.chip.active { background: #1a7f5a; color: white; }

#locateBtn, #addPlaceBtn {
  position: absolute; right: 12px; z-index: 500; width: 48px; height: 48px;
  border-radius: 50%; border: none; background: white; font-size: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3); cursor: pointer;
}
#locateBtn { bottom: 90px; }
#addPlaceBtn { bottom: 30px; background: #1a7f5a; }

#placeSheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 600;
  background: white; border-radius: 16px 16px 0 0; padding: 16px 20px 24px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.25); transform: translateY(0);
  transition: transform 0.25s ease;
}
#placeSheet.hidden { transform: translateY(100%); pointer-events: none; }
#sheetHandle { width: 40px; height: 4px; background: #ddd; border-radius: 2px; margin: 0 auto 12px; }
#sheetName { margin: 0 0 2px; font-size: 18px; }
.local-name { color: #666; margin: 0 0 6px; font-size: 14px; }
.tag { display: inline-block; background: #eafaf1; color: #1a7f5a; padding: 2px 10px; border-radius: 12px; font-size: 12px; margin: 0 0 8px; }
.sheet-actions { display: flex; gap: 8px; margin-top: 12px; }
.btn {
  flex: 1; text-align: center; padding: 12px; border-radius: 10px; border: none;
  background: #1a7f5a; color: white; text-decoration: none; font-size: 14px; cursor: pointer;
}
.btn.secondary { background: #eee; color: #333; }

.overlay {
  position: absolute; inset: 0; z-index: 700;
  display: flex; align-items: flex-end;
  pointer-events: none; /* let map drags pass through everywhere except the form card */
}
.overlay.hidden { display: none; }
.overlay-card {
  background: white; width: 100%; padding: 20px; border-radius: 16px 16px 0 0;
  max-height: 45vh; overflow-y: auto;
  pointer-events: auto; /* form itself stays interactive */
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}
.overlay-card input, .overlay-card select {
  width: 100%; padding: 10px; margin: 6px 0; border-radius: 8px; border: 1px solid #ddd; font-size: 14px;
}
.hint { font-size: 12px; color: #888; margin: 8px 0; }

#centerPin {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -100%);
  font-size: 30px; z-index: 400; pointer-events: none; display: none;
}
#centerPin.show { display: block; }

.hidden { display: none !important; }

/* ---- Redesigned "you are here" marker: amber pulsing ring + arrow-style
   core, distinct from green place pins and from the generic Google-blue dot ---- */
.user-location-marker {
  position: relative; width: 26px; height: 26px;
}
.user-location-marker .pulse-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: rgba(255, 140, 0, 0.35);
  animation: pulseRing 1.8s ease-out infinite;
}
.user-location-marker .pulse-core {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 14px; height: 14px; border-radius: 50%;
  background: #ff8c00; border: 3px solid #fff;
  box-shadow: 0 0 4px rgba(0,0,0,0.4);
}
@keyframes pulseRing {
  0%   { transform: scale(0.4); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

.action-banner {
  position: absolute; bottom: 90px; left: 50%; transform: translateX(-50%);
  z-index: 500; background: #1a7f5a; color: white; padding: 10px 16px;
  border-radius: 20px; font-size: 13px; box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  cursor: pointer; white-space: nowrap;
}

.sheet-title-row { display: flex; justify-content: space-between; align-items: flex-start; }
#sheetFavorite {
  background: none; border: none; font-size: 26px; color: #f0b429; cursor: pointer; line-height: 1;
}
#sheetFavorite.saved::before { content: "★"; }
.distance-text { color: #1a7f5a; font-size: 13px; font-weight: 600; margin: 2px 0 6px; }
.btn.share { background: #25D366; }
.full-width { width: 100%; margin-top: 10px; }

.chip[data-cat="favorites"] { background: #fff8e1; }
.chip[data-cat="favorites"].active { background: #f0b429; color: white; }

.marker-cluster-custom {
  background: rgba(26, 127, 90, 0.85); color: white; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px; box-shadow: 0 0 0 4px rgba(26,127,90,0.25);
}
