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

body {
  background-color: #74bfba;
  font-family: 'Playfair Display', serif;
  font-weight: 500;
  color: #138987;
}

/* RESPONSIVE TEXT */
h1 {
  text-align: left;
  margin-top: 1.5rem;
  padding-left: 3rem;
  font-size: clamp(3rem, 10vw, 8rem);
}

h2 {
  text-align: left;
  font-weight: bold;
  color: #ffffff;
  font-size: clamp(2rem, 8vw, 6rem);
}

h3 {
  font-size: clamp(0.8rem, 2.5vw, 1.5rem);
  text-align: center;
  line-height: 1.5;
  color: #ffffff;
  margin: 0;
}

p {
  position: relative;
  font-size: clamp(1rem, 2.5vw, 2rem);
  text-align: left;
  line-height: 1.5;
  color: #ffffff;
  margin: 0;
  z-index: 5;
}

a {
  color: white;
  text-decoration: none;
  transition: color 0.3s;
  font-size: clamp(0.9rem, 2vw, 1.2rem);
}

a:hover {
  color: #bceeff;
}

button,
#loadChartBtn {
  font-size: clamp(0.9rem, 2vw, 1.2rem);
  cursor: pointer;
}

/* Wellen-Container */
.wellen {
  position: relative;
  overflow: hidden;
  width: 100vw;
  max-width: 100%;
  height: 120vh;
  max-height: 90vw;
  padding-top: 1rem;
  pointer-events: none;

  background: url('./wellen/wellen_alle.svg'), url('./wellen/wolken.svg'), #bceeff;
  background-size: 100%, 70%, auto;
  background-position: center calc(100% + 1px), -240% 10%, center;
  background-repeat: no-repeat, no-repeat, repeat;

  /* Dauer wird über CSS‑Variable gesteuert (gesetzt von weather.js) */
  animation: moveWolken var(--cloud-speed) linear infinite;
}

@keyframes moveWolken {
  0% {
    background-position: center calc(100% + 1px), -240% 10%, center;
  }
  100% {
    background-position: center calc(100% + 1px), 340% 10%, center;
  }
}

.wellen #weather p {
  font-size: clamp(1rem, 2.5vw, 2rem);
  line-height: 1.5;
  color: #138987;
  padding-left: 3rem;
  padding-right: 5px;
  text-align: left;
  display: block;
}

.info {
  width: 80vw;
  margin: auto;
}

.inseln-container {
  position: relative;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  overflow: hidden;
}

.inseln-container .maps {
  width: 100vw;
  height: auto;
  display: block;
  padding: 5rem 0;
}

.inseln-container .bojen {
  width: 100vw;
  height: auto;
  display: block;
  padding: 5rem 0;
  position: absolute;
  top: 0;
}

.boje-icon {
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
  overflow: visible;
  border-radius: 100px;
  transform-box: fill-box;
  transform-origin: center;
  filter: url('#dropshadow');
}

.boje-icon:hover {
  transform: scale(1.1);
  filter: url('#dropshadow-hover')
}


/* POPUP */
.popup {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(3px);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup-content {
  background: white;
  width: 80vw;
  max-width: 800px;
  height: 60vh;
  max-height: 700px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  position: relative;
  animation: fadeIn 0.3s ease;
  display: flex;
  flex-direction: column;
}

.popup-content .header {
  background-color: #c96b52;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
}

.popup-content .header h2 {
  margin: 0;
  font-size: clamp(1.5rem, 5vw, 3rem);
  text-align: center;
}

.popup-content .header span {
  font-size: clamp(1rem, 3vw, 1.5rem);
}

.popup-content .header .close-btn {
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  position: relative;
}

.popup-content .header .close-btn:before, .popup-content .header .close-btn:after {
  position: absolute;
  top: 0;
  left: 15px;
  content: ' ';
  height: 33px;
  width: 2px;
  background-color: white;
}
.popup-content .header .close-btn:before {
  transform: rotate(45deg);
}
.popup-content .header .close-btn:after {
  transform: rotate(-45deg);
}

.popup-content .body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  height: 100%;
  padding: 2rem;
}

.wind-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #1b7a7f;
  font-size: clamp(1.5rem, 4vw, 3rem);
}

.arrow {
  position: absolute;
  top: 55%;
  transform: translateY(-50%);
  background: #c96b52;
  color: white;
  border: none;
  font-size: 2rem;
  padding: 12px 20px;
  cursor: pointer;
}
.arrow.left {
  left: -2rem;
}
.arrow.right {
  right: -2rem;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Chart-Slides */
.chart-slide {
  display: none;
  opacity: 0;
  height: 100%;
  width: 100%;
}
.chart-slide.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  opacity: 1;
}
.chart-slide .chart-canvas {
  width: 100%;
  height: 100%;
}
.chart-slide h3 {
  font-size: clamp(1rem, 3vw, 2rem);
  color: #138987;
}

/* Charts in Container */
.chart-container {
  width: 95%;
  max-width: 1000px;
  margin: 3rem auto;
}
.chart-container h2 {
  font-size: clamp(2rem, 6vw, 6rem);
  color: #ffffff;
}
.chart-container p {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
}
.chart-container canvas {
  width: 100% !important;
  height: auto !important;
  max-height: 600px;
  display: block;
  padding: 10px;
}

/* Datepicker */
.chart-datepicker {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.3rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.chart-datepicker label {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: #ffffff;
  margin: 0 0 2px 0.5rem;
}
.chart-datepicker input[type='date'] {
  all: unset;
  font-size: clamp(0.9rem, 2vw, 1rem);
  border: solid 1px white;
  padding: 0 1rem;
  border-radius: 5px;
}

/* Footer */
footer {
  text-align: center;
  padding: 1rem;
  margin-top: 3rem;
  font-size: clamp(0.7rem, 2vw, 0.9rem);
  color: white;
}

/* MOBILE MEDIA QUERY (optional für extra kleine Screens) */
@media (max-width: 400px) {
  h1 {
    font-size: clamp(2rem, 8vw, 6rem);
  }
  h2 {
    font-size: clamp(1.5rem, 6vw, 5rem);
  }
  p,
  a,
  button,
  .chart-datepicker label {
    font-size: clamp(0.9rem, 2vw, 1rem);
  }

  .chart-datepicker input[type='date'] {
    font-size: clamp(0.7rem, 1.8vw, 0.8rem);
  }

  .boje-icon {
    transform: scale(2);
  }

  .boje-icon:hover {
    transform: scale(2.2);
  }
}

:root {
  /* Default, wird von JS überschrieben */
  --cloud-speed: 20s;
}

/* Beispiel: einzelne Wolken-Elemente */
.cloud {
  position: absolute;
  top: 10%;
  left: -30%;
  /* lineare, unendliche Bewegung von links nach rechts */
  animation-name: moveClouds;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-duration: var(--cloud-speed);
  /* optional: weichere Bewegung */
  will-change: transform;
}

/* Variiere Geschwindigkeit pro Ebene */
.cloud.layer-fast {
  animation-duration: calc(var(--cloud-speed) * 0.6); 
}
.cloud.layer-slow {
  animation-duration: calc(var(--cloud-speed) * 1.3); 
}

@keyframes moveClouds {
  from {
    transform: translateX(-40%);
  }
  to {
    transform: translateX(140%);
  }
}
