/* Variabler */
:root {
  --fish-small-w: 14vw;
  --fish-medium-w: 17vw;
  --fish-big-w: 23vw;
  --luk-border: rgb(211, 38, 15);
  --luk-bg:rgb(240, 123, 105);
  --knap-border:rgb(211, 83, 15);
  --knap-bg:  rgb(245, 203, 32);
}

/* Klasse til font */
.font-finger-paint {
  font-family: "Finger Paint", sans-serif;
  font-weight: 400;
  font-style: normal;
}


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

/* ---------------- */
/* Baggrund og body */
/* ---------------- */
body {
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}
.scene {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -1;
}


/* ---- */
/* Fisk */
/* ---- */

/* Fisk container */
.fisk-container {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 2;
  overflow: visible;
}


/* Fælles stil for alle fisk */
.fisk-container div img {
  position: absolute;
  height: auto;
  display: block;
  z-index: 3;
}


/* ---------------- */
/* Fisk animationer */
/* ---------------- */

/* Animation til klovnfisk */
.fish1 {
  position: absolute;
  bottom: 50vh;
  width: var(--fish-medium-w);
  left: calc(-1 * var(--fish-medium-w));
  animation: fish1 12s linear infinite;
  animation-delay: 0s;
  rotate: 4deg;
  z-index: 2;
}
@keyframes fish1 {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(100vw + var(--fish-medium-w)));
  }
}

/* Animation til sandspiser-gobi */
.fish2 {
  position: absolute;
  bottom: 20vh;
  width: var(--fish-small-w);
  right: calc(-1 * var(--fish-small-w));
  animation: fish2 9s linear infinite;
  animation-delay: 2s;
  rotate: 3deg;
  z-index: 3;
}
@keyframes fish2 {
  0% {
    transform: translateX(0) rotateY(180deg);
  }
  100% {
    transform: translateX(calc(-100vw - var(--fish-small-w))) rotateY(180deg);
  }
}

/* Animation til rævefisken */
.fish3 {
  position: absolute;
  bottom: 10vh;
  width: var(--fish-big-w);
  left: calc(-1 * var(--fish-big-w));
  animation: fish3 8s linear infinite;
  animation-delay: 4s;
  rotate: -5deg;
  z-index: 1;
}
@keyframes fish3 {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(100vw + var(--fish-big-w)));
  }
}

/* Animation til pindsvinefisken */
.fish4 {
  position: absolute;
  bottom: 65vh;
  width: var(--fish-big-w);
  right: calc(-1 * var(--fish-big-w));
  animation: fish4 16s linear infinite;
  animation-delay: 6s;
  will-change: transform;
  rotate: -1deg;
  z-index: 3;
}
@keyframes fish4 {
  0% {
    transform: translateX(0) rotateY(180deg);
  }
  100% {
    transform: translateX(calc(-100vw - var(--fish-big-w))) rotateY(180deg);
  }
}

/* Animation til pudsefisken */
.fish5 {
  position: absolute;
  bottom: 20vh;
  width: var(--fish-small-w);
  left: calc(-1 * var(--fish-small-w));
  animation: fish5 10s linear infinite;
  animation-delay: 8s;
  rotate: -2deg;
  z-index: 1;
}
@keyframes fish5 {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(100vw + var(--fish-small-w)));
  }
}

/* Animation til kirurgfisken */
.fish6 {
  position: absolute;
  bottom: 40vh;
  width: var(--fish-big-w);
  right: calc(-1 * var(--fish-big-w));
  animation: fish6 8s linear infinite;
  animation-delay: 4s;
  will-change: transform;
  rotate: 3deg;
  z-index: 3;
}
@keyframes fish6 {
  0% {
    transform: translateX(0) rotateY(180deg);
  }
  100% {
    transform: translateX(calc(-100vw - var(--fish-big-w))) rotateY(180deg);
  }
}

/* Animation til blå chromis */
.fish7 {
  position: absolute;
  bottom: 30vh;
  left: calc(-1 * var(--fish-small-w));
  width: var(--fish-small-w);
  animation: fish7 7s linear infinite;
  animation-delay: 4s;
  rotate: 3deg;
  z-index: 1;
}
@keyframes fish7 {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(100vw + var(--fish-small-w)));
  }
}


/* ------------- */
/* Akvariemanden */
/* ------------- */

.akvariemanden img {
  bottom: -1vh;
  max-width: 45vh;
  position: absolute;
  z-index: 10;
}


/* Akvariemandens tekstbokse */
#start-tekstboks {
  border: 1.5px solid var(--knap-border);
  background-color:var(--knap-bg);
  max-width: fit-content;
  padding: 2vh;
  border-radius: 1rem;
  position: absolute;
  top: 90vh;
  z-index: 12;
  left: 5.9vw;
  font-family: "Finger Paint", sans-serif;
  animation: pulse 2.5s infinite;
}

.akvariemand-slut-tekstboks {
  background-color: rgb(255, 255, 255);
  max-width: fit-content;
  padding: 2vh;
  border-radius: 1rem;
  top: 75vh;
  position: absolute;
  z-index: 13;
  left: 22vw;
  font-family: "Finger Paint", sans-serif;
  opacity: 0;
}


/* Laver en klasse der gør akvariemandens slut tekstboks synlig */
.akvariemand-slut-tekstboks.is-visible {
  opacity: 1;
}


/* -------------------- */
/* "Klik på mig!" -knap */
/* -------------------- */


/* Animation til "klik på mig" knappen */
@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
  }
}


/* ---------------------------- */
/* "Luk"-knap til akvariemanden */
/* ---------------------------- */
.close-btn-am {
  position: absolute;
  left: 23vw;
  top: 67vh;
  font-size: 20px;
  font-weight: bold;
  font-family: "Finger Paint", sans-serif;
  border: 1.5px solid var(--luk-border);
  background-color: var(--luk-bg);
  padding: 1vh;
  border-radius: 0.5rem;  
  opacity: 0;
  z-index: 10;
}

.close-btn-am.visible {
  opacity: 1;
}


/* --------------------------- */
/* Bobler animation og styling */
/* --------------------------- */

.bubbles {
  position: fixed; /* dækker hele viewport */
  inset: 0; /* top:0; right:0; bottom:0; left:0; */ 
  overflow: visible;  /* Sikrer at boblerne kan animeres uden at blive cuttet af */
  z-index: 2;
}


.bubble {
  position: absolute;
  bottom: -8vh;
  border-radius: 50%;
  aspect-ratio: 1 / 1; /* Sørger for at boblen forbliver en cirkel */
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(133, 220, 249, 0.65) 20%,
    rgba(85, 140, 186, 0.12) 90px
  );
  opacity: 0;
  animation-name: rise;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform, opacity; /* Fortæller at boblerne vil ændre transform og opacity, giver bedre performance */
}

@keyframes rise {
  0% {
    opacity: 0;
    transform: translateY(0) translateX(0) scale(0.9);
  }
  8% {
    opacity: 0.95;
  }
  50% {
    transform: translateY(-50vh) translateX(20px) scale(1.03);
    opacity: 0.7;
  }
  100% {
    opacity: 0;
    transform: translateY(-120vh) translateX(-20px) scale(1.15);
  }
}

.bubble:nth-child(1) {
  width: clamp(6px, 2.5vw, 36px);
  animation-duration: 6s;
  animation-delay: 0s;
}
.bubble:nth-child(2) {
  width: clamp(8px, 3vw, 40px);
  animation-duration: 8.5s;
  animation-delay: 1s;
}
.bubble:nth-child(3) {
  width: clamp(5px, 2vw, 28px);
  animation-duration: 5.8s;
  animation-delay: 0.4s;
}
.bubble:nth-child(4) {
  width: clamp(10px, 3.8vw, 48px);
  animation-duration: 11s;
  animation-delay: 2.2s;
}
.bubble:nth-child(5) {
  width: clamp(7px, 3vw, 36px);
  animation-duration: 7.5s;
  animation-delay: 1s;
}
.bubble:nth-child(6) {
  width: clamp(12px, 4.2vw, 48px);
  animation-duration: 12.5s;
  animation-delay: 3s;
}
.bubble:nth-child(7) {
  width: clamp(6px, 2.2vw, 28px);
  animation-duration: 8.2s;
  animation-delay: 0.3s;
}
.bubble:nth-child(8) {
  width: clamp(9px, 3.6vw, 40px);
  animation-duration: 9.5s;
  animation-delay: 1.8s;
}
.bubble:nth-child(9) {
  width: clamp(6px, 2.4vw, 32px);
  animation-duration: 6.4s;
  animation-delay: 0.6s;
}
.bubble:nth-child(10) {
  width: clamp(11px, 4vw, 48px);
  animation-duration: 13s;
  animation-delay: 2.6s;
}
.bubble:nth-child(11) {
  width: clamp(7px, 3vw, 36px);
  animation-duration: 7.2s;
  animation-delay: 1.1s;
}
.bubble:nth-child(12) {
  width: clamp(5px, 2vw, 28px);
  animation-duration: 5.6s;
  animation-delay: 0.2s;
}
.bubble:nth-child(13) {
  width: clamp(14px, 4.5vw, 56px);
  animation-duration: 14s;
  animation-delay: 3.4s;
}
.bubble:nth-child(14) {
  width: clamp(8px, 3.2vw, 40px);
  animation-duration: 8.8s;
  animation-delay: 0.9s;
}
.bubble:nth-child(15) {
  width: clamp(6px, 2.6vw, 32px);
  animation-duration: 6.9s;
  animation-delay: 0.5s;
}
.bubble:nth-child(16) {
  width: clamp(10px, 3.8vw, 48px);
  animation-duration: 10.5s;
  animation-delay: 2s;
}
.bubble:nth-child(17) {
  width: clamp(7px, 3vw, 36px);
  animation-duration: 9.8s;
  animation-delay: 1.3s;
}
.bubble:nth-child(18) {
  width: clamp(9px, 3.6vw, 40px);
  animation-duration: 11.8s;
  animation-delay: 2.8s;
}


/* -------------------------------- */
/* Tooltip/Taleboblerne til fiskene */
/* -------------------------------- */

.tooltip {
  position: fixed;
  top: 42vh;
  left: 65vw;
  transform: translate(-50%, -50%);
  background-image: url("../img/tekstbobbel.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  min-width: 39vw;
  height: 69vh;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px 60px;
}

.tooltip.is-visible {
  opacity: 1;
  visibility: visible;
}

.tooltip-content img{
  flex-shrink: 0;
  height: auto;
  width: 7vw;
  align-self: flex-start;
}

.tooltip-content h3 {
  margin: 0 0 15px 0;
  font-size: 24px;
  color: black;
}

.tooltip-content p {
  margin: 10px 0;
  line-height: 1.4;
  font-size: 14px;
  color: black;
}

/* Display style til tooltip */
.display-style {
  display: flex;
  gap: 1vw;
}

/* "Luk"-knap til tooltip */
.close-btn {
  position: absolute;
  top: 58vh;
  right: 17vw;
  font-size: 24px;
  font-weight: bold;
  font-family: "Finger Paint", sans-serif;
  border: 1.5px solid var(--luk-border);
  background-color: var(--luk-bg);
  padding: 1vh;
  border-radius: 0.5rem;  
}

/* "Lær mere!"-knap til tooltip */
.learn-more-btn {
  position: absolute;
  top: 58vh;
  right: 5vw;
  font-size: 24px;
  font-weight: bold;
  font-family: "Finger Paint", sans-serif;
  border: 1.5px solid var(--knap-border);
  background-color: var(--knap-bg);
  padding: 1vh;
  border-radius: 0.5rem; 
}

/* Styling af det realistiske billede i tooltip */
.real-fish-img {
  margin-top: 4vh;
}


/* -------------------------------------------------------- */
/* Styling til de fisk der dukker op når man klikker på dem */
/* -------------------------------------------------------- */

.info-fish img {
  width: 25vw;
  position: absolute;
  top: 70vh;
  left: 30vw;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}


#klovnfisk-info {
  top: 55vh;
  width: 33vw;
  left: 25vw;
}


#sandspiser-info {
 top: 43vh;
 width: 30vw;
 left: 27vw;
}


#raevefisk-info {
  width: 33vw;
  left: 25vw;
  top: 55vh;
}


#pindsvinefisk-info {
  top: 45vh;
  width: 35vw;
  left: 22vw;
}


#kirurgfisk-info {
  top: 50vh;
  width: 40vw;
  left: 18vw;
}


#blue-chromis-info {
  top: 60vh;
  width: 30vw;
  left: 25vw;
}

#pudsefisk-info {
  top: 60vh;
  width: 30vw;
  left: 27vw;
}

