:root {
  --bg-color: #121212;
  --text-primary: #eaeaea;
  --text-secondary: #a0aec0;
  --accent-color: #9ae6b4;
  --border-color: #4a5568;
  --card-bg-color: rgba(26, 32, 44, 0.85);
  --font-serif: 'Lora', serif;
  --font-sans: 'Inter', sans-serif;
}

.village-dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e11d48;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.leaflet-div-icon.village-dot {
  background: transparent;
  border: none;
}

.leaflet-interactive.village-pin {
  transition: transform 0.05s ease-in-out, opacity 0.15s;
}

.leaflet-interactive.village-pin:focus {
  outline: 2px solid #8bd5ff;
  outline-offset: 2px;
}

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background: rgba(17, 24, 39, 0.8);
  color: #fff;
}

.marker-cluster div {
  background: transparent;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.resource-link {
  display: inline-block;
  color: var(--text-secondary);
  font-weight: 500;
  text-decoration: none;
  position: relative;
  padding-bottom: 5px;
  background-image: linear-gradient(var(--accent-color), var(--accent-color));
  background-size: 0% 1px;
  background-position: left bottom;
  background-repeat: no-repeat;
  transition: background-size 0.4s ease-in-out, color 0.4s ease-in-out, transform 0.3s ease;
}

.resource-link:hover {
  color: var(--text-primary);
  background-size: 100% 1px;
  transform: translateY(-2px);
}

#map-atlas {
  height: 100vh;
  width: 100%;
  background-color: #1a202c;
}

#map-atlas:focus {
  outline: 3px solid var(--accent-color);
  outline-offset: 4px;
}

.search-combobox {
  position: relative;
}

.search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.5rem);
  background-color: var(--card-bg-color);
  border: 1px solid rgba(74, 85, 104, 0.8);
  border-radius: 0.5rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45);
  max-height: 14rem;
  overflow-y: auto;
  padding: 0.25rem 0;
  z-index: 1200;
  display: none;
  list-style: none;
  margin: 0;
}

.search-results[aria-hidden='false'] {
  display: block;
}

.search-result-option {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 0.5rem 0.75rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  font-family: var(--font-sans);
}

.search-result-option:focus,
.search-result-option:hover,
.search-result-option[aria-selected='true'] {
  background-color: rgba(154, 230, 180, 0.18);
  color: #fff;
  outline: none;
}

.search-result-primary {
  display: block;
  font-weight: 600;
}

.search-result-secondary {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.search-results-empty {
  list-style: none;
}

.atlas-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 2rem;
  text-align: center;
  background: linear-gradient(135deg, rgba(26, 32, 44, 0.85), rgba(74, 85, 104, 0.5));
  border: 1px solid rgba(74, 85, 104, 0.6);
  border-radius: 0.75rem;
  color: var(--text-secondary);
}

.info-panel {
  background-color: rgba(26, 32, 44, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(74, 85, 104, 0.5);
}

.info-toggle {
  background-color: rgba(26, 32, 44, 0.7);
}

#info-box-content {
  max-height: 90vh;
  overflow-y: auto;
  transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;
  transform: translateX(0);
  opacity: 1;
}

#info-box-content.is-hidden {
  transform: translateX(-110%);
  opacity: 0;
  pointer-events: none;
}

#info-box-toggle .icon-open {
  display: none;
}

#info-box-toggle .icon-close {
  display: block;
}

#info-box-toggle[aria-expanded='false'] .icon-open {
  display: block;
}

#info-box-toggle[aria-expanded='false'] .icon-close {
  display: none;
}

.leaflet-popup-content-wrapper {
  background-color: rgba(26, 32, 44, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-primary);
  border: 1px solid rgba(74, 85, 104, 0.5);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.leaflet-popup-content {
  margin: 1.25rem;
  font-family: var(--font-sans);
  line-height: 1.6;
}

.leaflet-popup-tip {
  background: rgba(26, 32, 44, 0.8);
}

.leaflet-control-zoom a {
  color: var(--accent-color) !important;
  background-color: var(--card-bg-color) !important;
  border-bottom: 1px solid var(--border-color) !important;
}

.filter-accordion-panel {
  overflow: hidden;
  transition: max-height 0.4s ease-in-out, opacity 0.4s ease-in-out;
  max-height: 0;
  opacity: 0;
}

.filter-accordion-panel.open {
  max-height: 200px;
  opacity: 1;
  overflow-y: auto;
}

.filter-accordion-trigger .accordion-icon {
  transition: transform 0.3s ease-in-out;
}

.filter-accordion-trigger[aria-expanded='true'] .accordion-icon {
  transform: rotate(180deg);
}

/* Popup CTA styling */
.popup-card {
  min-width: 220px;
}

.popup-title {
  font-size: 1rem;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.popup-sub {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.popup-actions {
  margin-top: 0.5rem;
}

.popup-cta {
  display: inline-block;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-primary);
  background-image: linear-gradient(var(--accent-color), var(--accent-color));
  background-size: 0% 2px;
  background-position: left bottom;
  background-repeat: no-repeat;
  transition: background-size 0.25s ease, color 0.25s ease, transform 0.2s ease;
}

.popup-cta:hover {
  color: #fff;
  background-size: 100% 2px;
  transform: translateY(-1px);
}

.district-anchor {
  pointer-events: none;
}

.district-anchor-label {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
  background-color: rgba(17, 24, 39, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 9999px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}
