body {
  font-family: "Libre Franklin", sans-serif;
  color: #444;
  background-color: #f4efdf;
  padding: 0;
  margin: 0;
}

#container {
  display: flex;
  flex-direction: row; /* Side-by-side layout by default */
  height: 100vh; /* Full viewport height */
  width: 100vw; /* Full viewport width */
  overflow: hidden;
}

#side-panel {
  height: 100vh;
  flex: 400px 0 0;
  background-color: #f4efdf;
  z-index: 600;
  overflow-y: auto;
  box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.3);
  border-right: 2px solid #ddd8c7;
  display: flex;
  flex-direction: column;
  align-items: center; /* Center content horizontally */
  justify-content: flex-start; /* Align content to the top */
  padding-top: 10px;
}

#map {
  flex-grow: 1;
  height: 100%;
  background-color: #f4efdf;
}

h2 {
  /* float: left; */
  color: #444;
  margin: 20px 0px 0px 26px;
  font-size: 26px;
  text-align: center;
}

h3 {
  /* float: left; */
  color: #444;
  margin: 4px 0px 4px 26px;
  font-size: 16px;
  text-align: center;
}

p {
  font-size: 14px;
  line-height: 1.5;
  color: #444;
  margin: 10px;
  text-align: center;
  padding-right: 15px;
  /* padding-left: 10px; */
}

a {
  color: #00acc1;
  text-decoration: none;
  font-weight: 500;
}

a:hover {
  text-decoration: underline;
}

#section-ui-controls {
  margin: 10px auto;
  text-align: center;
  width: 90%;
}

#sectionControl {
  width: 100%;
  max-width: 300px;
  border: none;
  border-radius: 4px;
  color: #4d4d4d;
  font-size: 10pt;
  background-color: rgba(251, 249, 245, 0.9);
  font-family: inherit;
}

#ui-controls {
  margin: 10px auto;
  text-align: center;
  width: 90%;
}

#selectionControl {
  width: 100%;
  max-width: 300px;
  border: none;
  border-radius: 4px;
  color: #4d4d4d;
  font-size: 10pt;
  background-color: rgba(251, 249, 245, 0.9);
  font-family: inherit;
}

.leaflet-tooltip {
  color: #444;
  font-size: 1em;
  padding: 10px;
}

.leaflet-tooltip u {
  color: #444;
  font-weight: bold;
  font-size: 1em;
  /* padding: 10px; */
}

.tooltipTitle {
  font-size: 1.33em;
  margin-bottom: 0px;
}

#chart-container {
  font-style: inherit;
  margin-top: 20px auto;
  width: 90%;
  height: auto;
}

#chart-container svg {
  display: block;
  max-width: 100%;
  height: auto;
}

#stats h3 {
  margin-top: 5px;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  color: #444;
  margin-bottom: 5px;
}

#monitoring-periods {
  width: 90%;
  margin: 20px auto;
}

.period-row {
  border-bottom: 1px solid #ddd;
  margin-bottom: 15px;
  padding-bottom: 10px;
}

.period-section {
  font-weight: bold;
  text-align: center;
  margin-bottom: 5px;
}

.period-details {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center; /* Aligns items vertically if they have different heights */
  flex-wrap: nowrap; /* Prevents the items from wrapping onto a new line */
}

.period-block {
  flex: 0 0 48%; /* Fixes each block at roughly half the container's width */
  box-sizing: border-box; /* Ensures padding and borders don't cause overflow */
  background-color: rgba(251, 249, 245, 0.9);
  padding: 5px;
  border-radius: 4px;
  text-align: center;
  font-size: 13px;
}

.period-block .label {
  font-weight: bold;
  display: block;
  margin-bottom: 3px;
}

/* Remove any default button styles and make the entire block clickable */
.period-button {
  flex: 0 0 48%;
  display: block;
  width: 100%;
  background-color: rgba(251, 249, 245, 0.9);
  border: none;
  border-radius: 4px;
  text-align: center;
  padding: 8px;
  font-size: 13px;
  cursor: pointer;
  /* transition: background-color 0.3s, transform 0.2s; */
}

/* Style for the label inside the button */
.period-button .label {
  font-weight: bold;
  display: block;
  margin-bottom: 3px;
}

/* Hover effect for the button */
.period-button:hover {
  background-color: rgba(251, 249, 245, 1);
  transform: scale(1.02);
  box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.3);
}

/* Optional: indicate the active (clicked) state */
.period-button.active {
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.4);
}

/* Adjust the container for period details to layout buttons side-by-side */
.period-details {
  display: flex;
  justify-content: space-between;
  gap: 4%;
}

/* New: Reset button styling */
#reset-container {
  text-align: center;
  margin: 10px 0;
}

#reset-filters {
  padding: 5px 5px;
  font-size: 14px;
  background-color: #eee;
  border: 1px solid #a7a7a7;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

#reset-filters:hover {
  background-color: #fc8d8db6;
  box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.3);
}

/* Mobile-friendly layout */
@media (max-width: 768px) {
  /* Adjust breakpoint as needed */
  #container {
    flex-direction: column; /* Stack the elements vertically */
    height: auto;
    overflow-y: auto;
  }

  #side-panel {
    width: 100%; /
    height: 25vh; 
    order: 2; 
    border-right: none;
    border-top: 2px solid #ddd8c7;
    padding: 10px;
    align-items: flex-start;
  }

  #map {
    height: 75vh; 
    order: 1; /* Place the map above the panel */
  }

  #chart-container {
    width: 95%; /* Slightly larger width on mobile */
    margin: 10px auto;
    text-align: center;
  }

  #ui-controls {
    width: 95%;
    text-align: center;
    margin: 10px auto;
  }

  #selectionControl {
    max-width: 50%; /* Remove width limit for mobile */
  }

  #section-ui-controls {
    width: 95%;
    text-align: center;
    margin: 10px auto;
  }

  #sectionControl {
    max-width: 50%; /* Remove width limit for mobile */
  }
}
