:root {
  --bg: #eef2ef;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #667085;
  --line: #dbe4dd;
  --brand: #215732;
  --brand-soft: #edf4ef;
  --blue: #1f4e79;
  --blue-soft: #eaf2f8;
  --shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

body {
  overflow: hidden;
}

.map-page {
  height: 100vh;
  padding: 14px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
}

.topbar {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.year-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.year-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  user-select: none;
  transition: 0.18s ease;
}

.year-option input {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid #8ca196;
  background: #fff;
  margin: 0;
  position: relative;
}

.year-option input:checked {
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(33, 87, 50, 0.12);
}

.year-option span {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.year-option:hover {
  border-color: #bfd0c3;
  background: #fbfcfb;
}

.year-option:has(input:checked) {
  border-color: #bdd1c1;
  background: var(--brand-soft);
}

.toolbar-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.toolbar-search,
.toolbar-filters {
  min-width: 0;
}

.toolbar-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

#search,
#regionFilter,
#typeFilter,
#resetBtn {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0 14px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: 0.18s ease;
}

#search:focus,
#regionFilter:focus,
#typeFilter:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(33, 87, 50, 0.12);
}

#resetBtn {
  width: auto;
  min-width: 110px;
  padding: 0 18px;
  cursor: pointer;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
}

#resetBtn:hover {
  background: #e3eee6;
}

.layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 14px;
}

.sidebar,
.map-wrap {
  min-height: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sidebar {
  display: grid;
  grid-template-rows: auto 1fr;
}

.sidebar-head {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
}

.sidebar-head h2 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.2;
}

.sidebar-head p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.site-list {
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
}

.site-list::-webkit-scrollbar {
  width: 10px;
}

.site-list::-webkit-scrollbar-thumb {
  background: #d7dfd9;
  border-radius: 999px;
  border: 2px solid #fff;
}

.site-card {
  position: relative;
  border: 1px solid #e5ebe6;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  background: #fff;
  cursor: pointer;
  transition: 0.18s ease;
}

.site-card:hover {
  transform: translateY(-2px);
  border-color: #bfd0c3;
  background: #fbfcfb;
  box-shadow: 0 8px 18px rgba(33, 87, 50, 0.08);
}

.site-card.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 2px rgba(33, 87, 50, 0.08) inset;
}

.site-card h3 {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.35;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #d9e3dc;
  background: #f4f7f5;
  color: #395645;
  font-size: 12px;
}

.badge.year-2024 {
  background: var(--blue-soft);
  border-color: #c9d9e8;
  color: var(--blue);
}

.badge.year-2026 {
  background: var(--brand-soft);
  border-color: #cfdfd2;
  color: var(--brand);
}

.site-card a {
  color: var(--brand);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.site-card a:hover {
  text-decoration: underline;
}

.empty-state {
  padding: 24px 14px;
  color: var(--muted);
  font-size: 14px;
}

.map-wrap {
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.map-legend {
  position: absolute;
  z-index: 500;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.08);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}

.legend-dot--2024 {
  background: var(--blue);
}

.legend-dot--2026 {
  background: var(--brand);
}

.leaflet-container {
  background: #edf2ee;
}

.leaflet-popup-content-wrapper {
  border-radius: 14px;
}

.leaflet-popup-content {
  margin: 12px 14px;
  line-height: 1.5;
}

.popup-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.popup-meta {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.popup-link {
  color: var(--brand);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.popup-link:hover {
  text-decoration: underline;
}

/* SVG Marker */
.svg-marker {
  background: transparent;
  border: 0;
}

.svg-marker .svg-marker-wrap {
  position: relative;
  width: 32px;
  height: 42px;
  display: block;
}

.svg-marker svg {
  display: block;
  width: 32px;
  height: 42px;
  transform-origin: center bottom;
  transition: transform 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.18));
}

.svg-marker.is-hover svg,
.svg-marker.is-active svg {
  transform: scale(1.1);
}

.svg-marker.is-hover svg {
  filter: drop-shadow(0 0 7px rgba(0, 0, 0, 0.22));
}

.svg-marker.is-active svg {
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.26));
}

.svg-marker .pulse-ring {
  position: absolute;
  left: 50%;
  top: 11px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
}

.svg-marker.is-hover .pulse-ring,
.svg-marker.is-active .pulse-ring {
  animation: markerPulse 1.35s ease-out infinite;
}

@keyframes markerPulse {
  0% {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0.42;
  }
  70% {
    transform: translate(-50%, -50%) scale(2.3);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 0;
  }
}

@media (max-width: 1100px) {
  body {
    overflow: auto;
  }

  .map-page {
    height: auto;
    min-height: 100vh;
  }

  .toolbar-controls {
    grid-template-columns: 1fr;
  }

  .toolbar-filters {
    grid-template-columns: 1fr 1fr;
  }

  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: 360px 70vh;
  }
}

@media (max-width: 700px) {
  .map-page {
    padding: 10px;
    gap: 10px;
  }

  .topbar {
    padding: 12px;
  }

  .toolbar-filters {
    grid-template-columns: 1fr;
  }

  .year-switch {
    gap: 8px;
  }

  .year-option {
    min-height: 40px;
    padding: 0 14px;
  }

  .layout {
    grid-template-rows: 320px 65vh;
  }

  .map-legend {
    top: 10px;
    right: 10px;
  }
}
/* Cluster styling */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background: transparent;
}

.marker-cluster div {
  width: 42px;
  height: 42px;
  margin-left: 0;
  margin-top: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font: 700 13px/1 Arial, Helvetica, sans-serif;
  color: #fff;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 20px rgba(16, 24, 40, 0.18);
}

.cluster-2024 div {
  background: #1f4e79;
}

.cluster-2026 div {
  background: #215732;
}

.cluster-mixed div {
  background: #5b4b8a;
}

.marker-cluster span {
  display: inline-block;
  transform: translateY(0.5px);
}