* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  padding: 10px 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
  font-size: 1.4rem;
  color: #2c3e50;
}

header .subtitle {
  font-size: 0.85rem;
  color: #7f8c8d;
}

header .attribution {
  font-size: 0.75rem;
  color: #95a5a6;
}

header .attribution a {
  color: #3498db;
  text-decoration: none;
}

header .attribution a:hover {
  text-decoration: underline;
}

#map {
  position: fixed;
  top: 80px;
  bottom: 0;
  left: 0;
  right: 0;
}

#legend {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  font-size: 0.85rem;
}

#legend h3 {
  margin-bottom: 10px;
  color: #2c3e50;
  font-size: 0.9rem;
}

.legend-item {
  display: flex;
  align-items: center;
  margin: 5px 0;
  color: #34495e;
}

.legend-color {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
}

#filters {
  position: fixed;
  top: 100px;
  right: 20px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  font-size: 0.85rem;
  min-width: 200px;
}

#filters h3 {
  margin-bottom: 12px;
  color: #2c3e50;
  font-size: 0.9rem;
}

.filter-group {
  margin-bottom: 12px;
}

.filter-group label {
  display: block;
  color: #7f8c8d;
  font-size: 0.75rem;
  margin-bottom: 4px;
}

.filter-group input[type="range"] {
  width: 100%;
  margin-bottom: 2px;
}

.filter-group span {
  font-weight: 600;
  color: #2c3e50;
}

/* Popup styles */
.leaflet-popup-content-wrapper {
  border-radius: 8px;
}

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

.popup-title {
  font-weight: 600;
  font-size: 1rem;
  color: #2c3e50;
  margin-bottom: 8px;
}

.popup-magnitude {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
  margin-bottom: 8px;
}

.popup-info {
  font-size: 0.85rem;
  color: #7f8c8d;
  margin-bottom: 4px;
}

.popup-info strong {
  color: #34495e;
}

/* Cluster styles */
.marker-cluster-small {
  background-color: rgba(254, 224, 139, 0.6);
}
.marker-cluster-small div {
  background-color: rgba(254, 224, 139, 0.8);
}

.marker-cluster-medium {
  background-color: rgba(244, 109, 67, 0.6);
}
.marker-cluster-medium div {
  background-color: rgba(244, 109, 67, 0.8);
}

.marker-cluster-large {
  background-color: rgba(215, 48, 39, 0.6);
}
.marker-cluster-large div {
  background-color: rgba(215, 48, 39, 0.8);
}

.marker-cluster {
  background-clip: padding-box;
  border-radius: 20px;
}

.marker-cluster div {
  width: 30px;
  height: 30px;
  margin-left: 5px;
  margin-top: 5px;
  text-align: center;
  border-radius: 15px;
  font: 12px "Helvetica Neue", Arial, sans-serif;
  font-weight: bold;
  color: white;
  line-height: 30px;
}

/* Loading state */
.loading {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2000;
  background: white;
  padding: 20px 40px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  font-size: 1rem;
  color: #2c3e50;
}

/* Responsive */
@media (max-width: 600px) {
  header h1 {
    font-size: 1.1rem;
  }

  #legend {
    bottom: 10px;
    left: 10px;
    padding: 10px;
  }

  #legend h3 {
    display: none;
  }

  .legend-item {
    display: inline-flex;
    margin-right: 8px;
    font-size: 0.75rem;
  }

  #filters {
    top: auto;
    bottom: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
}
