/* Fullscreen map container */
body {
    margin: 0;
    overflow: hidden;
}

/* Map and slider container */
#map {
    width: 100vw;
    height: 100%;
    background: #fdfdfd;
    position: absolute;
    touch-action: none;
    -ms-touch-action: none;
}

.info {
    padding: 8px 8px;
    font: 24px/26px Arial, Helvetica, sans-serif;
    background: white;
    background: rgba(255,255,255,0.8);
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    border-radius: 5px;
    user-select: none;
    margin-left: 10px;
}

.info h4 {
    margin: 0 0 5px;
    color: #1a1515;
}

.legend {
    line-height: 28px;
    color: #555;
}
.legend i {
    width: 18px;
    height: 23px;
    float: left;
    margin-right: 8px;
    opacity: 0.7;
}

.year-quarter-selector {
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 300px;
  margin: auto;
}

#year-slider {
  width: 100%;
}

#selected-year {
  font-weight: bold;
  display: inline-block;
  margin-top: 5px;
}

.quarter-buttons {
  display: flex;
  justify-content: space-between;
  gap: 5px;
}

.quarter-button {
  flex: 1;
  padding: 9px;
  border: 1px solid #ccc;
  background-color: #f9f9f9;
  cursor: pointer;
  text-align: center;
}

.quarter-button.active {
  background-color: #007bff;
  color: white;
  border-color: #007bff;
}

.quarter-button.disabled {
  background-color: #b9b9b9;
  color: white;
  border-color: #b9b9b9;
  pointer-events: none;
}

.quarter-button:hover {
  background-color: #0056b3;
  color: white;
}

#year-slider::-webkit-slider-thumb::after {
  content: attr(value);
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 5px;
  border-radius: 3px;
  white-space: nowrap;
}

#year-slider::-moz-range-thumb::after {
  content: attr(value);
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 5px;
  border-radius: 3px;
  white-space: nowrap;
}

@media (max-width: 550px) {
  .leaflet-control:not(.info):not(.leaflet-control-attribution) {
      top: 120px;
  }
}

.popup {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  padding: 20px;
  box-shadow: 0 0 15px rgba(0,0,0,0.2);
  border-radius: 8px;
  z-index: 1000;
  display: none;
  min-width: 300px;
  user-select: none;
  font: 20px/22px Arial, Helvetica, sans-serif;
  width: 85%;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
}

.popup h1 {
  margin: 0 0 20px;
  font-size: 1.5em;
  line-height: 1.5;
  text-align: center;
  word-wrap: break-word;
}

.close-button {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 32px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
}

.close-button:hover {
  color: #ff0000;
}

.popup p {
  margin: 10px 0;
}

@media (max-width: 550px) {
  .popup {
      width: 70%;
      max-height: 75vh;
  }
}
