:root{
  --bg:#f8fafc;          /* light background */
  --card:#ffffff;        /* white cards */
  --muted:#64748b;       /* muted text */
  --text:#1e293b;        /* dark text */
  --accent:#059669;      /* green accent */
  --accent-2:#10b981;    /* lighter green for hover */
  --chip:#f1f5f9;       /* light pill background */
  --button:#059669;      /* green CTA button */
  --button-text:#ffffff; 
  --link:#2563eb;        /* blue links */
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --radius:16px;
  --radius-sm:12px;
  --gap:22px;
  --container: 1080px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:'Inter',system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,'Helvetica Neue',Arial,sans-serif;
  background:linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) fixed;
  color:var(--text);
  line-height:1.55;
  letter-spacing:.1px;
}
a{color:var(--link)}
.container{max-width:var(--container);margin:0 auto;padding:0 22px 80px}

/* Header */
.topbar{display:flex;justify-content:flex-end;align-items:center;padding:8px 6px}
.theme-toggle{
  width:38px;height:38px;border-radius:50%;
  display:grid;place-items:center;cursor:pointer;
  background:transparent;border:1px solid rgba(0,0,0,.12);
  color:#64748b;transition:.2s;box-shadow:none;
  touch-action:manipulation;-webkit-tap-highlight-color:transparent;
  min-height:44px;min-width:44px
}
.theme-toggle:hover{background:#f1f5f9;color:#1e293b}
.theme-toggle:active{transform:scale(0.95)}

.hero{display:flex;flex-direction:column;align-items:center;gap:8px;margin-top:6px;margin-bottom:0px;text-align:center}
.title{font-weight:800;font-size:38px;letter-spacing:.5px}
.subtitle{color:var(--muted);font-weight:400}

.hero-cta{margin-top:6px;margin-bottom:0}
.btn{display:inline-flex;gap:10px;align-items:center;justify-content:center;border:none;cursor:pointer;text-decoration:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.btn-ghost{padding:12px 18px;border-radius:999px;background:var(--chip);color:var(--text);border:1px solid rgba(0,0,0,.1);box-shadow:var(--shadow);min-height:44px;min-width:44px}
.btn-ghost svg{width:18px;height:18px}

/* Filter card */
.filter-card{background:var(--card);border:1px solid rgba(0,0,0,.06);border-radius:var(--radius);padding:24px;box-shadow:var(--shadow);margin:8px 0 24px 0}
.filter-row{display:flex;flex-wrap:wrap;gap:16px;align-items:flex-end}
.field{flex:1;min-width:260px;max-width:260px;position:relative}
.label{font-size:12px;text-transform:uppercase;letter-spacing:.12em;color:var(--muted);margin-bottom:8px;display:block}
.select{appearance:none;width:100%;padding:14px 44px 14px 14px;border-radius:12px;border:1px solid rgba(0,0,0,.12);background:#ffffff;color:#1e293b;font-size:15px;min-height:44px;touch-action:manipulation}
.select:focus{outline:2px solid rgba(5,150,105,.55);border-color:transparent}
.chev{position:absolute;right:14px;bottom:14px;pointer-events:none;opacity:.9}

/* Date input styling */
input[type="date"].select {
  padding: 14px 44px 14px 14px;
  color-scheme: light;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font-family: inherit;
  font-size: 15px;
  width: 100%;
  min-width: 260px;
}

input[type="date"].select::-webkit-calendar-picker-indicator {
  display: none;
}

/* Fix date input formatting */
input[type="date"].select::-webkit-datetime-edit-text {
  padding: 0;
}

input[type="date"].select::-webkit-datetime-edit-month-field,
input[type="date"].select::-webkit-datetime-edit-day-field,
input[type="date"].select::-webkit-datetime-edit-year-field {
  padding: 0;
}

/* Hide the native calendar picker completely */
input[type="date"].select::-webkit-calendar-picker-indicator {
  display: none !important;
  opacity: 0;
  position: absolute;
    right: -9999px;
}

/* Ensure consistent width for date inputs */
.field input[type="date"].select {
  width: 100%;
  min-width: 260px;
  max-width: 260px;
  box-sizing: border-box;
}

/* Make sure both date fields have identical styling */
#startDate, #endDate {
  width: 100% !important;
  min-width: 260px !important;
  max-width: 260px !important;
  box-sizing: border-box !important;
}

/* Section */
.section{margin-top:32px;padding:32px;border-top:1px solid rgba(0,0,0,.06)}
.kicker{color:var(--muted);text-transform:uppercase;letter-spacing:.16em;font-size:12px;margin-bottom:6px}
.date{color:var(--muted);font-size:13px;margin-bottom:14px}
.headline{font-size:32px;font-weight:800;margin:6px 0 14px}
.lead{color:var(--text);max-width:70ch;opacity:0.8}
.meta{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:14px;margin-top:10px}
.pin{width:16px;height:16px;opacity:.85}

.cta-row{margin-top:18px}
.btn-primary{padding:12px 20px;border-radius:12px;background:var(--button);color:var(--button-text);font-weight:700;min-height:44px;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.btn-primary:hover{filter:brightness(1.02)}
.btn-primary:active{transform:scale(0.98)}

/* Footer */
footer{margin-top:60px;color:var(--muted);text-align:center;font-size:13px}

/* Loading */
.loading{text-align:center;padding:60px 40px;color:var(--muted)}
.spinner{width:40px;height:40px;border:3px solid rgba(255,255,255,.1);border-top:3px solid var(--accent);border-radius:50%;animation:spin 1s linear infinite;margin:0 auto 20px}
@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}

/* Map Styles - Modern Redesign */
.map-section {
  background: var(--bg);
  min-height: 100vh;
  padding: 0;
  margin: 0;
}

.map-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card);
  border-bottom: 1px solid rgba(0,0,0,.06);
  padding: 20px 24px;
  margin: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  backdrop-filter: blur(10px);
}

.map-header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.map-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.map-title svg {
  width: 28px;
  height: 28px;
  color: var(--accent);
}

.map-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
}

.map-container {
  width: 100%;
  height: calc(100vh - 100px);
  background: var(--bg);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 12px;
}

.map-container svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Modern Map Markers */
.map-marker {
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

.map-marker:hover {
  transform: scale(1.1);
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.25));
}

.map-marker circle {
  fill: var(--accent);
  stroke: white;
  stroke-width: 3;
  transition: all 0.3s ease;
}

.map-marker:hover circle {
  fill: var(--accent-2);
  stroke-width: 4;
}

.map-marker .inner-circle {
  fill: white;
  stroke: none;
}

.map-marker:hover .inner-circle {
  fill: var(--accent);
}

/* Modern Marker Labels */
.marker-label {
  pointer-events: none;
  user-select: none;
  font-size: 13px;
  font-weight: 600;
  fill: var(--text);
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
  transition: all 0.3s ease;
}

.text-bg {
  fill: rgba(0,0,0,0.8);
  stroke: var(--accent);
  stroke-width: 1;
  opacity: 0.9;
  transition: all 0.3s ease;
}

.map-marker:hover .text-bg {
  opacity: 1;
  fill: rgba(0,0,0,0.9);
}

.map-marker:hover .marker-label {
  fill: var(--accent);
  text-shadow: 0 2px 6px rgba(0,0,0,0.9);
}

/* News Count Badge */
.news-count-badge {
  fill: white;
  stroke: var(--accent);
  stroke-width: 2;
  transition: all 0.3s ease;
}

.news-count-text {
  font-size: 12px;
  font-weight: 700;
  fill: var(--accent);
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  transition: all 0.3s ease;
}

.map-marker:hover .news-count-badge {
  fill: var(--accent);
  stroke: white;
}

.map-marker:hover .news-count-text {
  fill: white;
}

/* Map Controls */
.map-controls {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-control-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid rgba(0,0,0,.12);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  backdrop-filter: blur(10px);
}

.map-control-btn:hover {
  background: var(--chip);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.map-control-btn svg {
  width: 20px;
  height: 20px;
}

/* Map Legend */
.map-legend {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background: var(--card);
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.map-legend-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.map-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
}

.map-legend-item:last-child {
  margin-bottom: 0;
}

.map-legend-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid white;
}

/* Mobile Map Styles */
@media (max-width: 768px) {
  .map-header {
    padding: 16px 20px;
  }

  .map-header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .map-title {
    font-size: 20px;
  }

  .map-stats {
    font-size: 13px;
  }

  .map-container {
    height: calc(100vh - 140px);
  }

  .map-controls {
    top: 16px;
    right: 16px;
  }

  .map-control-btn {
    width: 40px;
    height: 40px;
  }

  .map-legend {
    bottom: 16px;
    left: 16px;
    right: 16px;
    padding: 12px;
  }

  .map-legend-title {
    font-size: 13px;
  }

  .map-legend-item {
    font-size: 12px;
  }
}

.map-marker:hover .marker-label {
  font-size: 16px;
  font-weight: 800;
  fill: var(--accent-2);
}

.map-marker:hover text {
  font-size: 16px;
  font-weight: 700;
}

.tooltip-bg {
  transition: opacity 0.3s ease;
}

.tooltip-text {
  transition: opacity 0.3s ease;
}

.map-marker:hover .tooltip-bg {
  opacity: 1 !important;
}

.map-marker:hover .tooltip-text {
  opacity: 1 !important;
}

/* Popup Modal */
.popup-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  box-sizing: border-box;
}

.popup-content {
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow);
}

.popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.popup-close:hover {
  background: var(--chip);
  color: var(--text);
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.popup-kicker {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 12px;
  font-weight: 600;
}

.popup-date {
  color: var(--muted);
  font-size: 13px;
}

.popup-title {
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 16px 0;
  line-height: 1.3;
}

.popup-summary {
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 20px;
  opacity: 0.8;
}

.popup-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.popup-cta {
  text-align: center;
}

/* Municipality news list styling */
.municipality-news-list {
  scrollbar-width: thin;
  scrollbar-color: var(--accent) rgba(255,255,255,0.1);
}

.municipality-news-list::-webkit-scrollbar {
  width: 6px;
}

.municipality-news-list::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}

.municipality-news-list::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

.municipality-news-list::-webkit-scrollbar-thumb:hover {
  background: var(--accent-2);
}

/* Pagination styles */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 32px 0 16px 0;
  flex-wrap: wrap;
}

.pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 8px 12px;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--chip);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 6px 12px -2px rgba(0,0,0,0.15), 0 4px 8px -2px rgba(0,0,0,0.1);
}

.pagination-btn.active {
  background: var(--accent);
  color: var(--button-text);
  border-color: var(--accent);
  font-weight: 600;
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.pagination-btn:disabled:hover {
  background: var(--card);
  border-color: rgba(0,0,0,.12);
  transform: none;
  box-shadow: var(--shadow);
}

.pagination-nav {
  min-width: 44px;
  padding: 8px;
}

.pagination-ellipsis {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  color: var(--muted);
  font-weight: 500;
}

.pagination-info {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 32px;
}

@media (max-width: 768px) {
  .pagination {
    gap: 4px;
    margin: 24px 0 12px 0;
  }
  
  .pagination-btn {
    min-width: 40px;
    height: 40px;
    padding: 6px 8px;
    font-size: 13px;
  }
  
  .pagination-nav {
    min-width: 40px;
    padding: 6px;
  }
  
  .pagination-ellipsis {
    min-width: 40px;
    height: 40px;
    font-size: 13px;
  }
}

/* News container */
#news-container {
  margin-top: 8px;
}

/* Utilities */
.hidden{display:none}

/* Mobile Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 8px 16px 60px;
  }
  
  .title {
    font-size: 28px;
    line-height: 1.2;
  }
  
  .subtitle {
    font-size: 14px;
    margin-bottom: 16px;
  }
  
  .hero-cta {
    margin-top: 16px;
  }
  
  .btn-ghost {
    padding: 10px 16px;
    font-size: 14px;
  }
  
  .filter-card {
    padding: 20px;
    margin: 20px 0;
  }
  
  .field {
    min-width: 100%;
  }
  
  .select {
    padding: 12px 40px 12px 12px;
    font-size: 14px;
  }
  
  input[type="date"].select {
    padding: 12px 40px 12px 12px;
  }
  
  .section {
    padding: 24px 16px;
    margin-top: 20px;
  }
  
  .headline {
    font-size: 24px;
    line-height: 1.3;
    margin: 8px 0 12px;
  }
  
  .lead {
    font-size: 15px;
    line-height: 1.5;
  }
  
  .btn-primary {
    padding: 10px 16px;
    font-size: 14px;
  }
  
  .map-container {
    height: 500px;
    margin: 16px 0;
  }
  
  .popup-content {
    padding: 20px;
    margin: 16px;
    max-width: calc(100vw - 32px);
  }
  
  .popup-title {
    font-size: 20px;
    line-height: 1.3;
  }
  
  .municipality-news-list {
    max-height: 300px;
  }
  
  .news-item {
    padding: 12px;
    margin-bottom: 8px;
  }
  
  .topbar {
    padding: 8px 16px;
  }
  
  .theme-toggle {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 8px 12px 40px;
  }
  
  .title {
    font-size: 24px;
  }
  
  .subtitle {
    font-size: 13px;
  }
  
  .section {
    padding: 20px 12px;
  }
  
  .headline {
    font-size: 20px;
  }
  
  .lead {
    font-size: 14px;
  }
  
  .map-container {
    height: 400px;
  }
  
  .popup-content {
    padding: 16px;
    margin: 8px;
    max-width: calc(100vw - 16px);
  }
  
  .popup-title {
    font-size: 18px;
  }
}

@media (min-width: 1000px) {
  .title {
    font-size: 44px;
  }
  .headline {
    font-size: 36px;
  }
  .map-title {
    font-size: 32px;
  }
}
