/* ShoreSignal — Waze-Style UI */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Bright, Waze-inspired palette */
  --bg: #ffffff;                    /* Bright white background */
  --surface: #f8f9fa;               /* Light surface cards */
  --surface2: #ffffff;              /* Off-white secondary */
  --surface3: #f0f2f5;              /* Light tertiary */
  --border: #e0e0e0;                /* Light borders */
  --text: #1a1a1a;                  /* Dark text */
  --text2: #666666;                 /* Medium gray text */
  --accent: #0084d1;                /* Waze-style bright blue */
  --accent-dim: rgba(0,132,209,0.1);
  --danger: #ff4757;                /* Bright red */
  --danger-dim: rgba(255,71,87,0.1);
  --amber: #ffa500;                 /* Bright orange */
  --amber-dim: rgba(255,165,0,0.1);
  --blue: #0084d1;                  /* Bright ocean blue */
  --blue-dim: rgba(0,132,209,0.1);
  --purple: #9c27b0;                /* Bright purple */
  --purple-dim: rgba(156,39,176,0.1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --bottom-nav-h: 72px;
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* ─── App Shell ────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
}

/* ─── Top Bar ──────────────────────────────── */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  padding-top: calc(8px + var(--safe-top));
  background: var(--bg);
  z-index: 100;
  flex-shrink: 0;
  min-height: 48px;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ss-logo {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
  color: white;
}

.top-bar-location {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 4px 10px;
  border-radius: 20px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-bar-right {
  display: flex;
  align-items: center;
}

.loc-refresh-btn {
  background: none;
  border: none;
  padding: 5px;
  cursor: pointer;
  color: var(--accent);
  opacity: 0.7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.loc-refresh-btn:hover { opacity: 1; background: var(--accent-dim); }

.nav-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.nav-btn:hover { background: var(--surface); }
.nav-btn.primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.nav-btn.primary:hover { background: #2bc490; }

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}
.user-avatar:hover { border-color: var(--accent); }
.user-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* ─── View Toggle ──────────────────────────── */
/* ─── Filter Bar ───────────────────────────── */
.filter-bar {
  flex-shrink: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 8px 12px 0;
  z-index: 100;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

/* Search */
.search-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  color: var(--text2);
  pointer-events: none;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 32px 8px 30px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.search-input::placeholder { color: var(--text2); }
.search-input:focus { border-color: rgba(51,212,160,0.4); }

.search-clear {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 50%;
  transition: color 0.2s;
}
.search-clear:hover { color: var(--text); }
.search-clear.hidden { display: none; }

/* View Toggle (now inline in filter bar) */
.view-toggle {
  display: flex;
  flex-shrink: 0;
  background: var(--surface);
  border-radius: 10px;
  padding: 3px;
  border: 1px solid var(--border);
}

.vt-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border: none;
  background: none;
  color: var(--text2);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.vt-btn.active {
  background: var(--accent);
  color: var(--bg);
}

.vt-btn svg {
  flex-shrink: 0;
}

/* Region Tabs */
.region-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 8px;
}
.region-tabs::-webkit-scrollbar { display: none; }

.rt-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 20px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.rt-btn:hover { border-color: rgba(51,212,160,0.3); color: var(--text); }
.rt-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

/* ─── Location Banner ──────────────────────── */
.location-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: #fff8e1;
  border-bottom: 1px solid #ffe082;
  font-size: 0.78rem;
  font-weight: 600;
  color: #7a5c00;
  flex-shrink: 0;
  z-index: 90;
}
.location-banner.hidden { display: none; }
.location-banner svg { flex-shrink: 0; color: #f59e0b; }
.location-banner span { flex: 1; }
.loc-banner-enable {
  background: var(--accent);
  border: none;
  color: white;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.loc-banner-enable:hover { background: #0073b8; }
.loc-banner-dismiss {
  background: none;
  border: none;
  cursor: pointer;
  color: #a07a00;
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: 4px;
  flex-shrink: 0;
}
.loc-banner-dismiss:hover { background: rgba(0,0,0,0.08); }

/* Scan This Area Button */
.scan-area-btn {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--bg);
  border: 1.5px solid var(--accent);
  color: var(--accent);
  border-radius: 24px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.scan-area-btn:hover { background: var(--accent); color: var(--bg); }
.scan-area-btn.hidden { display: none; }

/* ─── Main Content ─────────────────────────── */
.main-content {
  flex: 1;
  position: relative;
  min-height: 0;
}

.map-view, .list-view {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.map-view.active, .list-view.active {
  opacity: 1;
  pointer-events: auto;
}

#map {
  width: 100%;
  height: 100%;
}

/* ─── List View ────────────────────────────── */
.list-view {
  background: var(--bg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 16px);
}

.list-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 16px 16px 12px;
}

.list-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gps-sort-badge {
  font-size: 0.68rem;
  font-weight: 700;
  background: #e6f4ff;
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid rgba(0,132,209,0.2);
  white-space: nowrap;
}

.list-title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.list-count {
  font-size: 0.75rem;
  color: var(--text2);
  font-weight: 600;
}

.list-scroll {
  padding: 0 12px;
}

/* Beach Card (List View) */
.beach-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 42px 14px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}
.beach-card:hover { border-color: rgba(255,255,255,0.12); }
.beach-card:active { transform: scale(0.98); }

.bc-score {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
}
.bc-score.good { background: var(--accent-dim); color: var(--accent); }
.bc-score.ok { background: var(--amber-dim); color: var(--amber); }
.bc-score.bad { background: var(--danger-dim); color: var(--danger); }

.bc-info { flex: 1; min-width: 0; }
.bc-name {
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}
.bc-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
}
.bc-distance {
  font-size: 0.72rem;
  color: var(--text2);
  font-weight: 500;
}
.bc-city {
  font-size: 0.72rem;
  color: var(--text2);
  font-weight: 500;
}
.bc-hazards {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.bc-hazard-tag {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.bc-hazard-tag.jellyfish { background: var(--purple-dim); color: var(--purple); }
.bc-hazard-tag.waves { background: var(--blue-dim); color: var(--blue); }
.bc-hazard-tag.crowded { background: var(--amber-dim); color: var(--amber); }
.bc-hazard-tag.rain { background: rgba(100,100,200,0.15); color: #6464c8; }
.bc-hazard-tag.wind { background: var(--accent-dim); color: var(--accent); }
.bc-hazard-tag.other { background: var(--danger-dim); color: var(--danger); }
.bc-hazard-tag.clear { background: var(--accent-dim); color: var(--accent); }

.bc-arrow {
  color: var(--text2);
  font-size: 1.1rem;
  flex-shrink: 0;
  opacity: 0.5;
}

/* Heart (Favorite) Button on Beach Cards */
.heart-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text2);
  transition: all 0.15s;
  z-index: 2;
  opacity: 0.6;
}
.heart-btn:hover { opacity: 1; background: var(--danger-dim); color: var(--danger); }
.heart-btn.favorited { color: var(--danger); opacity: 1; }
.heart-btn svg { pointer-events: none; }

/* Heart button in detail panel header */
.detail-heart-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text2);
  transition: all 0.15s;
  flex-shrink: 0;
}
.detail-heart-btn:hover { color: var(--danger); background: var(--danger-dim); }
.detail-heart-btn.favorited { color: var(--danger); }

/* ─── My Beaches Strip ──────────────────────── */
.my-beaches-section {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.my-beaches-section.hidden { display: none; }

.mbs-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.mbs-title {
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.3px;
  color: var(--text);
}
.mbs-count {
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 10px;
}

.mbs-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.mbs-scroll::-webkit-scrollbar { display: none; }

/* Mini beach card in My Beaches strip */
.mbs-card {
  flex-shrink: 0;
  width: 130px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 10px 8px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.mbs-card:hover { border-color: var(--accent); }
.mbs-card:active { transform: scale(0.97); }

.mbs-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.mbs-score.good { background: var(--accent-dim); color: var(--accent); }
.mbs-score.ok { background: var(--amber-dim); color: var(--amber); }
.mbs-score.bad { background: var(--danger-dim); color: var(--danger); }

.mbs-name {
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}
.mbs-condition {
  font-size: 0.67rem;
  color: var(--text2);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Empty state in My Beaches strip */
.mbs-empty {
  font-size: 0.78rem;
  color: var(--text2);
  font-style: italic;
  padding: 4px 2px;
}

/* ─── Leaflet Customization ────────────────── */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4) !important;
}
.leaflet-control-zoom a {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  width: 38px !important;
  height: 38px !important;
  line-height: 38px !important;
  font-size: 18px !important;
  font-weight: 600 !important;
}
.leaflet-control-zoom a:hover { background: var(--surface2) !important; }

.beach-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.75rem;
  color: white;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  border: 2px solid rgba(255,255,255,0.6);
  transition: transform 0.15s;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.beach-marker:hover { transform: scale(1.15); }
.beach-marker.score-good { background: #00a860; }
.beach-marker.score-ok { background: #ff9500; }
.beach-marker.score-bad { background: #ff4757; }

.user-location-marker {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--blue);
  border: 3px solid white;
  box-shadow: 0 0 0 4px rgba(0,132,209,0.25), 0 2px 8px rgba(0,0,0,0.2);
}

/* Popup */
.leaflet-popup-content-wrapper {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 16px !important;
  color: var(--text) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
}
.leaflet-popup-tip { background: var(--surface) !important; }
.leaflet-popup-content { margin: 14px 16px !important; min-width: 200px; font-family: 'Inter', sans-serif; }

.popup-beach-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 3px; letter-spacing: -0.2px; }
.popup-beach-city { font-size: 0.75rem; color: var(--text2); margin-bottom: 8px; }
.popup-score {
  display: inline-block;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 8px;
  margin-bottom: 8px;
}
.popup-score.good { background: var(--accent-dim); color: var(--accent); }
.popup-score.ok { background: var(--amber-dim); color: var(--amber); }
.popup-score.bad { background: var(--danger-dim); color: var(--danger); }

.popup-hazards { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.popup-tag { font-size: 0.65rem; padding: 3px 7px; border-radius: 5px; font-weight: 600; }
.popup-tag.jellyfish { background: var(--purple-dim); color: var(--purple); }
.popup-tag.waves { background: var(--blue-dim); color: var(--blue); }
.popup-tag.crowded { background: var(--amber-dim); color: var(--amber); }
.popup-tag.rain { background: rgba(255,255,255,0.06); color: var(--text2); }
.popup-tag.wind { background: var(--accent-dim); color: var(--accent); }
.popup-tag.other { background: var(--danger-dim); color: var(--danger); }
.popup-tag.clear { background: var(--accent-dim); color: var(--accent); }

.popup-actions { display: flex; gap: 6px; }
.popup-btn {
  flex: 1;
  padding: 10px 0;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.popup-btn.report { background: var(--accent); color: var(--bg); }
.popup-btn.report:hover { background: #2bc490; }
.popup-btn.detail { background: var(--surface2); color: var(--text); }
.popup-btn.detail:hover { background: var(--surface3); }

/* ─── Bottom Nav (Waze-style) ──────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
}

.bottom-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: var(--bottom-nav-h);
  max-width: 480px;
  margin: 0 auto;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text2);
  cursor: pointer;
  padding: 8px 16px;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.nav-item:hover { color: var(--text); }
.nav-item.active { color: var(--accent); }
.nav-item span {
  font-size: 0.65rem;
  font-weight: 600;
}

.report-fab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 18px;
  padding: 10px 24px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 20px rgba(51,212,160,0.35);
  transition: all 0.15s;
  position: relative;
  top: -8px;
}
.report-fab:hover { background: #2bc490; transform: scale(1.05); }
.report-fab:active { transform: scale(0.97); }
.report-fab span {
  font-size: 0.65rem;
  font-weight: 700;
}

/* ─── Report Panel (Waze-style) ────────────── */
.report-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.report-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.report-panel {
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 480px;
  padding: 24px 16px;
  padding-bottom: calc(24px + var(--safe-bottom));
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.report-overlay.active .report-panel {
  transform: translateY(0);
}

.report-panel-header {
  text-align: center;
  margin-bottom: 20px;
  position: relative;
}

.report-close {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--surface);
  border: none;
  color: var(--text2);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.report-close:hover { background: var(--surface2); color: var(--text); }

.report-title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.report-beach-name {
  font-size: 0.8rem;
  color: var(--text2);
  font-weight: 500;
  margin-top: 4px;
}

/* Big Hazard Buttons Grid (Waze-style) */
.hazard-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.hazard-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px 8px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 18px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  min-height: 100px;
}
.hazard-btn:hover {
  border-color: rgba(0,132,209,0.2);
  background: var(--surface2);
}
.hazard-btn:active {
  transform: scale(0.95);
}
.hazard-btn.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 0 1px var(--accent);
}

.hb-icon {
  font-size: 36px;
  line-height: 1;
}

.hb-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.hazard-btn.selected .hb-label {
  color: var(--accent);
}

/* Note section after hazard selected */
.report-note-section {
  margin-top: 16px;
  animation: slideUp 0.25s ease-out;
}
.report-note-section.hidden {
  display: none;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.selected-hazard-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.report-note-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  padding: 12px;
  resize: none;
  margin-bottom: 12px;
}
.report-note-input::placeholder { color: var(--text2); }
.report-note-input:focus { outline: none; border-color: var(--accent); }

.report-submit-btn {
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: -0.3px;
}
.report-submit-btn:hover { background: #0073b8; }
.report-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── Beach Detail Panel (Rebuilt) ─────────── */
/* Full-screen panel that slides in from the right.
   z-index 900 = above ALL Leaflet layers (marker-pane: 600, popup-pane: 700).
   Root cause of every previous breakage: panel at z-index 300 was below Leaflet
   markers/popups which bled through, making the panel appear transparent. */
.dp {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 900;
  background: var(--bg);
  overflow: hidden;           /* Panel itself never scrolls — inner .dp-body scrolls */
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.dp.active {
  transform: translateX(0);
}

/* Sticky header */
.dp-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(var(--safe-top) + 10px) 12px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-height: 56px;
}
.dp-back {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s;
}
.dp-back:active { background: var(--surface3); }
.dp-header-info { flex: 1; min-width: 0; }
.dp-name {
  font-weight: 800;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.3px;
}
.dp-city { font-size: 0.72rem; color: var(--text2); margin-top: 1px; }
.dp-header-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.dp-share {
  background: none; border: none; cursor: pointer;
  padding: 6px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text2);
  transition: all 0.15s;
  flex-shrink: 0;
}
.dp-share:hover { color: var(--accent); background: var(--accent-dim); }

/* Scrollable body — overflow here, not on .dp */
.dp-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 20px);
}

/* Hero strip */
.dp-hero {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border);
}
.dp-hero.good { background: rgba(0, 180, 80, 0.07); }
.dp-hero.ok   { background: rgba(255, 165, 0, 0.07); }
.dp-hero.bad  { background: rgba(255, 71, 87, 0.07); }
.dp-score-badge {
  width: 74px; height: 74px;
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 2rem;
  flex-shrink: 0;
}
.dp-score-badge.good { background: #00b44f; color: #fff; }
.dp-score-badge.ok   { background: var(--amber); color: #fff; }
.dp-score-badge.bad  { background: var(--danger); color: #fff; }
.dp-hero-label { font-weight: 800; font-size: 1.1rem; color: var(--text); margin-bottom: 3px; }
.dp-hero-sub   { font-size: 0.76rem; color: var(--text2); line-height: 1.4; }

/* Section */
.dp-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.dp-section-title {
  font-weight: 800;
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 10px;
}

/* ─── Hazard Report Buttons (primary CTA) ─── */
.dp-hazard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.dp-hazard-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 14px 6px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  min-height: 90px;
  position: relative;
}
.dp-hazard-btn:active {
  transform: scale(0.94);
  background: var(--accent-dim);
  border-color: var(--accent);
}
.dp-hb-icon  { font-size: 30px; line-height: 1; }
.dp-hb-label { font-size: 0.64rem; font-weight: 700; color: var(--text); text-align: center; line-height: 1.2; }
.dp-hb-count {
  position: absolute; top: 6px; right: 6px;
  background: var(--danger); color: #fff;
  font-size: 0.6rem; font-weight: 800;
  padding: 1px 5px; border-radius: 8px;
  line-height: 1.5;
}

/* Active reports list */
.dp-report-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.dp-report-item:last-child { border-bottom: none; }
.dp-report-emoji  { font-size: 18px; flex-shrink: 0; padding-top: 1px; }
.dp-report-info   { flex: 1; }
.dp-report-type   { font-weight: 700; font-size: 0.78rem; text-transform: capitalize; }
.dp-report-meta   { font-size: 0.65rem; color: var(--text2); margin-top: 1px; }
.dp-report-note   { font-size: 0.73rem; color: #666; margin-top: 2px; line-height: 1.3; }
.dp-report-badge  { font-size: 0.65rem; padding: 2px 8px; border-radius: 6px; font-weight: 700; flex-shrink: 0; }
.dp-report-badge.active  { background: var(--accent-dim); color: var(--accent); }
.dp-report-badge.expired { background: rgba(0,0,0,0.06); color: var(--text2); }

/* Empty state */
.dp-empty { text-align: center; padding: 16px; color: var(--text2); font-size: 0.82rem; }
.dp-empty-icon { font-size: 1.5rem; margin-bottom: 4px; }

/* Weather */
.dp-cond-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px; border-radius: 10px;
  font-size: 0.78rem; font-weight: 700;
  margin-bottom: 8px;
}
.dp-cond-bar.calm      { background: rgba(0,132,209,0.1);  color: #0055a0; }
.dp-cond-bar.moderate  { background: rgba(255,165,0,0.12); color: #b36b00; }
.dp-cond-bar.rough     { background: rgba(255,71,87,0.12); color: #cc1f30; }
.dp-weather-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.dp-w-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 8px 4px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px;
}
.dp-w-icon  { font-size: 18px; }
.dp-w-value { font-weight: 800; font-size: 0.76rem; text-align: center; line-height: 1.2; }
.dp-w-label { font-size: 0.58rem; color: var(--text2); text-transform: capitalize; font-weight: 600; }

/* Mini map thumbnail */
.dp-mini-map {
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

/* Hide filter bar when detail open */
#app.detail-open .filter-bar,
#app.detail-open .location-banner {
  display: none;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  padding-top: calc(12px + var(--safe-top));
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}
.detail-back {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.detail-back:hover { background: var(--surface2); }
.detail-header-info { flex: 1; min-width: 0; }
.detail-header-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail-header-city { font-size: 0.75rem; color: var(--text2); }
.detail-header-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.detail-share-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text2);
  transition: all 0.15s;
  flex-shrink: 0;
}
.detail-share-btn:hover { color: var(--accent); background: var(--accent-dim); }
.detail-share-btn.share-copied { color: var(--accent); }

.detail-score-section {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.detail-score-circle {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.detail-score-circle.good { background: var(--accent-dim); color: var(--accent); border: 3px solid var(--accent); }
.detail-score-circle.ok { background: var(--amber-dim); color: var(--amber); border: 3px solid var(--amber); }
.detail-score-circle.bad { background: var(--danger-dim); color: var(--danger); border: 3px solid var(--danger); }

.detail-score-info h3 { font-weight: 700; font-size: 0.9rem; margin-bottom: 2px; letter-spacing: -0.2px; }
.detail-score-info p { font-size: 0.75rem; color: var(--text2); line-height: 1.3; }

.detail-section {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
}
.detail-section-title {
  font-weight: 800;
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 8px;
}

.hazard-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.hazard-summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.hazard-summary-item .emoji { font-size: 20px; }
.hazard-summary-item .count { font-weight: 800; font-size: 0.8rem; }
.hazard-summary-item .type { font-size: 0.6rem; color: var(--text2); text-transform: capitalize; font-weight: 600; }
.hazard-summary-item.active { border-color: rgba(255,82,82,0.3); background: var(--danger-dim); }

.report-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.report-item:last-child { border-bottom: none; }
.report-emoji { font-size: 18px; flex-shrink: 0; padding-top: 1px; }
.report-info { flex: 1; }
.report-type { font-weight: 700; font-size: 0.78rem; text-transform: capitalize; }
.report-meta { font-size: 0.65rem; color: var(--text2); margin-top: 1px; }
.report-note { font-size: 0.73rem; color: #666; margin-top: 2px; line-height: 1.3; }
.report-badge { font-size: 0.65rem; padding: 2px 8px; border-radius: 6px; font-weight: 700; flex-shrink: 0; }
.report-badge.active { background: var(--accent-dim); color: var(--accent); }
.report-badge.expired { background: rgba(0,0,0,0.06); color: var(--text2); }

.detail-report-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  margin-top: 6px;
  letter-spacing: -0.2px;
}
.detail-report-btn:hover { background: #0073b8; }

/* ─── Modal (Auth / Profile) ───────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px 20px;
  padding-bottom: calc(24px + var(--safe-bottom));
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-overlay.active .modal { transform: translateY(0); }

.modal-handle { display: flex; justify-content: center; margin-bottom: 16px; }
.modal-handle-bar { width: 40px; height: 4px; background: rgba(0,0,0,0.12); border-radius: 2px; }

.modal h2 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}
.modal .modal-subtitle {
  font-size: 0.82rem;
  color: var(--text2);
  margin-bottom: 20px;
}

/* Auth */
.auth-modal .modal { border-radius: 24px; max-width: 400px; }
@media (min-width: 481px) {
  .auth-modal { align-items: center; }
  .auth-modal .modal { border-radius: 24px; }
}

.auth-tabs {
  display: flex;
  margin-bottom: 20px;
  background: var(--surface);
  border-radius: 12px;
  padding: 3px;
}
.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  color: var(--text2);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.15s;
}
.auth-tab.active { background: var(--accent); color: white; font-weight: 700; }

.auth-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 13px 14px;
  margin-bottom: 10px;
}
.auth-input::placeholder { color: var(--text2); }
.auth-input:focus { outline: none; border-color: var(--accent); }

.auth-submit {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  margin-top: 4px;
  margin-bottom: 12px;
}
.auth-submit:hover { background: #0073b8; }
.auth-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  font-size: 0.78rem;
  color: var(--text2);
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.google-btn {
  width: 100%;
  padding: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.15s;
}
.google-btn:hover { background: var(--surface2); }
.google-btn svg { width: 18px; height: 18px; }

.auth-error {
  background: var(--danger-dim);
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  display: none;
}
.auth-error.show { display: block; }

/* Profile */
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.profile-stat {
  text-align: center;
  padding: 16px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.profile-stat .num {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent);
}
.profile-stat .label {
  font-size: 0.7rem;
  color: var(--text2);
  margin-top: 2px;
  font-weight: 600;
}

.logout-btn {
  width: 100%;
  padding: 13px;
  background: var(--danger-dim);
  border: 1px solid rgba(255,71,87,0.2);
  border-radius: 12px;
  color: var(--danger);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 20px;
}
.logout-btn:hover { background: rgba(255,71,87,0.12); }

/* ─── Loading ──────────────────────────────── */
.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.4s;
}
.loading-screen.hidden { opacity: 0; pointer-events: none; }
.loading-logo {
  font-weight: 900;
  font-size: 1.8rem;
  color: var(--accent);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.5px;
}
.loading-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
}
.loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(0,132,209,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Toast ────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 14px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 600;
  opacity: 0;
  transition: all 0.3s;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(0,132,209,0.3); }
.toast.error { border-color: rgba(255,71,87,0.3); }

/* ─── Empty State ──────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--text2);
}
.empty-state .emoji { font-size: 44px; margin-bottom: 12px; }
.empty-state p { font-size: 0.88rem; line-height: 1.5; }

/* ─── Weather Strip (Beach Cards) ─────────── */
.bc-weather {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.bc-weather-item {
  font-size: 0.68rem;
  color: var(--text2);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 2px;
}

.bc-weather-item strong {
  color: var(--text);
  font-weight: 700;
}

.bc-weather-sep {
  color: var(--border);
  font-size: 0.65rem;
}

.bc-weather-loading {
  display: inline-block;
  width: 110px;
  height: 11px;
  background: linear-gradient(
    90deg,
    var(--surface2) 25%,
    var(--surface3) 50%,
    var(--surface2) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Live Conditions (Detail View) ──────── */
.weather-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text2);
  font-size: 0.8rem;
  padding: 14px 0;
}

.weather-unavail {
  color: var(--text2);
  font-size: 0.8rem;
  padding: 8px 0;
}

.conditions-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 0.75rem;
}
.conditions-bar.calm     { background: var(--accent-dim);  color: var(--accent); }
.conditions-bar.moderate { background: var(--amber-dim);   color: var(--amber); }
.conditions-bar.rough    { background: var(--danger-dim);  color: var(--danger); }

.weather-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}

.weather-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 5px 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
}

.weather-item-icon  { font-size: 16px; line-height: 1; }
.weather-item-value { font-weight: 800; font-size: 0.75rem; line-height: 1.1; }
.weather-item-label {
  font-size: 0.55rem;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 600;
}

/* ─── Photo Gallery ────────────────────────── */
.detail-section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.photo-upload-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(51,212,160,0.3);
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.photo-upload-btn:hover { background: rgba(51,212,160,0.2); }
.photo-upload-btn:active { transform: scale(0.95); }
.photo-upload-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.photo-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.photo-strip::-webkit-scrollbar { height: 3px; }
.photo-strip::-webkit-scrollbar-track { background: transparent; }
.photo-strip::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 2px; }

.photo-thumb {
  flex: 0 0 110px;
  height: 80px;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface2);
  scroll-snap-align: start;
  border: 1px solid var(--border);
  transition: transform 0.15s, opacity 0.15s;
}
.photo-thumb:active { transform: scale(0.96); opacity: 0.85; }
.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-count {
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--text2);
  font-weight: 500;
}

.photo-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  color: var(--text2);
  font-size: 0.82rem;
}
.photo-empty span { font-size: 1.4rem; }

.photo-loading {
  display: flex;
  align-items: center;
  height: 40px;
}

/* ─── Photo Viewer ──────────────────────────── */
.photo-viewer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.photo-viewer-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.photo-viewer-close {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: 16px;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 10;
}
.photo-viewer-close:hover { background: rgba(255,255,255,0.2); }

.photo-viewer-inner {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.photo-viewer-inner img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 12px;
  object-fit: contain;
}
.photo-viewer-info { text-align: center; }
.photo-viewer-caption {
  font-weight: 600;
  color: #fff;
  font-size: 0.9rem;
  margin-bottom: 4px;
}
.photo-viewer-meta {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
}

/* ─── Profile Panel ────────────────────────── */
/* z-index 900 = above ALL Leaflet layers (marker-pane: 600, popup-pane: 700).
   Previously at z-index 300 which sat below Leaflet markers/popups,
   causing map content to bleed through — same bug the beach detail panel had. */
.profile-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  height: 100dvh;
  background: var(--bg);
  z-index: 900;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease-out, visibility 0.22s;
}
.profile-panel.active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.profile-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  padding-top: calc(12px + var(--safe-top));
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.profile-back-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
}
.profile-panel-title {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
}

.profile-panel-body {
  padding: 24px 16px;
  padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 24px);
  max-width: 480px;
  margin: 0 auto;
}

/* Avatar + Identity */
.pp-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
}
.pp-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0,132,209,0.25);
}
.pp-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pp-name {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text);
  text-align: center;
}
.pp-email {
  font-size: 0.8rem;
  color: var(--text2);
  text-align: center;
}
.pp-since {
  font-size: 0.75rem;
  color: var(--text2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 12px;
  margin-top: 4px;
}

/* Credibility Badge */
.pp-badge-section {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}
.pp-badge {
  background: linear-gradient(135deg, var(--accent-dim), rgba(0,132,209,0.06));
  border: 2px solid var(--accent);
  border-radius: 20px;
  padding: 20px 32px;
  text-align: center;
  min-width: 180px;
  box-shadow: 0 4px 20px rgba(0,132,209,0.1);
}
.pp-badge.tier-regular {
  background: linear-gradient(135deg, rgba(255,165,0,0.1), rgba(255,165,0,0.04));
  border-color: var(--amber);
  box-shadow: 0 4px 20px rgba(255,165,0,0.12);
}
.pp-badge.tier-trusted {
  background: linear-gradient(135deg, rgba(0,200,150,0.12), rgba(0,200,150,0.05));
  border-color: #00c896;
  box-shadow: 0 4px 20px rgba(0,200,150,0.15);
}
.pp-badge.tier-guardian {
  background: linear-gradient(135deg, rgba(156,39,176,0.12), rgba(156,39,176,0.05));
  border-color: var(--purple);
  box-shadow: 0 4px 20px rgba(156,39,176,0.15);
}
.pp-badge-icon {
  font-size: 2.4rem;
  line-height: 1;
  margin-bottom: 8px;
}
.pp-badge-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pp-badge-score {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}
.pp-badge.tier-regular .pp-badge-score { color: var(--amber); }
.pp-badge.tier-trusted .pp-badge-score { color: #00c896; }
.pp-badge.tier-guardian .pp-badge-score { color: var(--purple); }
.pp-badge-label {
  font-size: 0.7rem;
  color: var(--text2);
  margin-top: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Stats row */
.pp-stats {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 24px;
}
.pp-stat {
  flex: 1;
  text-align: center;
  padding: 16px 8px;
}
.pp-stat-divider {
  width: 1px;
  background: var(--border);
  margin: 12px 0;
}
.pp-stat-num {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent);
}
.pp-stat-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text2);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Activity Feed */
.pp-section { margin-bottom: 24px; }
.pp-section-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.pp-feed-loading, .pp-feed-empty {
  text-align: center;
  color: var(--text2);
  font-size: 0.85rem;
  padding: 24px 0;
}
.pp-feed-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.pp-feed-item:last-child { border-bottom: none; }
.pp-feed-item:active { background: var(--surface); border-radius: 10px; }
.pp-feed-icon {
  font-size: 1.4rem;
  width: 36px;
  height: 36px;
  background: var(--surface);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pp-feed-info { flex: 1; min-width: 0; }
.pp-feed-type {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}
.pp-feed-beach {
  font-size: 0.78rem;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.pp-feed-time {
  font-size: 0.72rem;
  color: var(--text2);
  flex-shrink: 0;
}
.pp-load-more {
  width: 100%;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent);
  cursor: pointer;
  margin-top: 8px;
}
.pp-load-more:active { background: var(--accent-dim); }

/* Sign Out */
.pp-signout-wrap {
  display: flex;
  justify-content: center;
  padding-top: 8px;
}
.pp-signout-btn {
  padding: 12px 32px;
  background: none;
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s;
}
.pp-signout-btn:active { background: var(--danger-dim); }

/* ─── Desktop ──────────────────────────────── */
@media (min-width: 768px) {
  .dp {
    width: 420px;
    left: auto;
    right: 0;
    border-left: 1px solid var(--border);
    transform: translateX(100%);
  }
  .dp.active {
    transform: translateX(0);
  }

  .bottom-nav {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 20px 20px 0 0;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }

  .report-overlay { align-items: center; }
  .report-panel { border-radius: 24px; max-width: 440px; }

  .modal-overlay { align-items: center; }
  .modal { border-radius: 24px; max-width: 440px; }

  .profile-panel {
    width: 420px;
    left: auto;
    right: 0;
    border-left: 1px solid var(--border);
  }
}

/* ─── Onboarding Overlay ───────────────────── */
.onboard-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, #0084d1 0%, #005fa3 100%);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: onboardFadeIn 0.35s ease;
}

.onboard-overlay.hidden {
  display: none;
}

@keyframes onboardFadeIn {
  from { opacity: 0; transform: scale(1.03); }
  to   { opacity: 1; transform: scale(1); }
}

.onboard-card {
  background: var(--bg);
  border-radius: 24px;
  padding: 40px 28px 32px;
  text-align: center;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

.onboard-logo {
  width: 72px;
  height: 72px;
  background: var(--accent);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 20px;
  box-shadow: 0 8px 24px rgba(0, 132, 209, 0.35);
}

.onboard-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 12px;
  line-height: 1.2;
}

.onboard-desc {
  font-size: 16px;
  color: var(--text2);
  line-height: 1.6;
  margin: 0 0 32px;
}

.onboard-gps-btn {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 18px 24px;
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-bottom: 14px;
  transition: opacity 0.15s, transform 0.1s;
  display: block;
}

.onboard-gps-btn:active {
  opacity: 0.85;
  transform: scale(0.98);
}

.onboard-browse-btn {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
  display: block;
  width: 100%;
}

.onboard-browse-btn:active {
  opacity: 0.7;
}
