html, body {
  margin: 0;
  padding: 0;
}

#animation-elements {
  display: flex;
  flex-direction: column;
  position: relative;
  height: 100vh;
  box-sizing: border-box;
}

/* Using aspect ratio 1 : 1.22 from meteo.be */
#map-wrapper {
  flex: 0 0 62%;
  width: 100%;
  position: relative;
  aspect-ratio: 1 / 1.22;
  overflow: hidden;
}

#map {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
}

#chartContainer {
  flex: 0 0 28%;
  width: 100%;
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: sans-serif;
  font-size: 1.2em;
  color: #333;
  /* background-color: #f5f5f5; */
}

#intensity-notification {
  width: 100%;
  text-align: center;
  margin-top: 0.5em;
  font-family: sans-serif;
  font-size: 10pt;
  color: #333;
}

@media only screen and (max-width: 600px) {
  #map {
    flex: none;
    height: 450px;
  }
  #chartContainer {
    flex: none;
  }
}

#map img {
    max-height: none;
}

.run-date-container{
    position: absolute;
    z-index: 401;
    color: white;
    right: 2rem;
    top: 2rem;
    border: 1px solid white;
    padding: 1rem;
    background: darkgray;
}

.loading-spinner {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border: 5px solid rgba(0, 0, 0, 0.1);
  border-left-color: #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 9999;

  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.loading-spinner.visible {
  opacity: 1;
  pointer-events: auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.precip-legend {
  background: white;
  padding: 10px;
  font-family: sans-serif;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  border-radius: 5px;
  line-height: 18px;
  color: #555;
}

.precip-legend i {
  width: 18px;
  height: 18px;
  float: left;
  margin-right: 8px;
  opacity: 0.7;
}

.legend-select-container {
  margin-bottom: 8px;
  clear: both;
}

.legend-items-container div {
  clear: both;
  margin-bottom: 4px;
}

.legend-select-container select {
  width: 100%;
  padding: 4px;
  font-size: 12px;
  border-radius: 3px;
  border: 1px solid #ccc;
}

.legend-opacity-container {
  margin-top: 10px;
  clear: both;
  font-size: 12px;
}

.legend-opacity-control-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.legend-opacity-button {
  background-color: transparent;
  border: 1px solid #aaa;
  border-radius: 3px;
  padding: 2px 6px;
  line-height: 1;
  cursor: pointer;
  color: #444;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.legend-opacity-button:hover {
  background-color: #f0f0f0;
  border-color: #666;
}

.legend-opacity-value {
  width: 50px;
  text-align: center;
  /* font-family: monospace; */
  /* fixed width per character */
  font-size: 10px;
  color: #333;
  /* avoid shrinking when having a small wrapper */
  flex-shrink: 0;
}

/* main container for time slider and legend button */
#time-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  padding: 6px 10px;
  font-family: sans-serif;
  font-size: 14px;
  background-color: white;
  border: 2px solid rgba(0, 0, 0, 0.2);
  gap: 12px;
}

/* Left side: controls, date and slider */
#time-control-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.timecontrol-button {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}

.timecontrol-date {
  white-space: nowrap;
  font-weight: bold;
}

/* Slider container */
.timecontrol-slider {
  flex-grow: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}

/* The slider itself */
.slider {
  position: relative;
  flex-grow: 1;
  width: 100%;
  height: 24px;
  background: #ddd;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #999;
}

/* Slider button */
.knob.main {
  position: absolute;
  top: 6px;
  width: 12px;
  height: 12px;
  background: blue;
  border-radius: 50%;
   /* test position */
  transform: translate3d(50px, 0, 0);
}

/* Legend button container */
#legend-wrapper {
  display: flex;
  align-items: center;
  padding-left: 10px;
  /* fine separator (line) */
  border-left: 1px solid #ccc;
}

/* The legend button itself */
#legend-button {
  background-color: white;
  border: none;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}