/* --------------------------------------index.html------------------------------------------ */
/* --- GENERELT LAYOUT --- */

:root {
  --off-fish1: 200px;
  --off-fish2: 200px;
  --off-fish3: 200px;
  --off-fish4: 300px;
  --off-fish5: 400px;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Poppins", "Comic Neue", sans-serif;
  background: linear-gradient(to bottom, #68c3f8 0%, #0077b6 100%);
  overflow-x: hidden;
  color: #fff;
  line-height: 1.6;
  overflow: hidden;
}

.container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-sizing: border-box;
}

/* --- TOOLBAR OMRÅDET --- */
#toolbar {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 12px 16px;
  margin-bottom: 12px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  width: 95%;
  max-width: 900px;
}

#toolbar + div {
  position: relative;
  width: 70%;
  max-width: 960px;
  height: 55vh;
  margin: 0 auto;
  border-radius: 20px;
}

.subheading {
  font-size: 1.1rem;
  color: #ffffff;
  margin: 8px 0;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
}

/* --- FARVER OG STØRRELSES-KNAPPER --- */
#colors-sizes-row,
#color-sizes-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  margin: 12px 0;
}

#colors,
#sizes {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  margin: 6px 0;
}

.color,
.size {
  border: 3px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.color:hover,
.size:hover {
  transform: scale(1.2);
  border-color: #ffd166;
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.8);
}

.color.selected,
.size.selected {
  border-color: #ffb703;
  transform: scale(1.25);
  box-shadow: 0 0 14px rgba(255, 183, 3, 0.9);
}

.size .dot {
  margin: auto;
  background: #333;
  border-radius: 50%;
}

/* --- FISKE-TEMPLATES --- */
#FiskeTemplates {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin: 12px 0;
}

#FiskeTemplates .FiskeTemplate {
  aspect-ratio: 4 / 3;
  height: 90px;
  width: auto;
  object-fit: contain;
  border: 3px solid #fff;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
}

#FiskeTemplates .FiskeTemplate:hover {
  transform: scale(1.05);
  border-color: #ffd166;
}

#FiskeTemplates .FiskeTemplate.selected {
  transform: scale(1.08);
}

/* ------------------- Havfrue2 ------------------- */
.havfrue2 {
  position: fixed;
  left: 0;
  top: 20px;
  width: 120px;
  height: 180px;
  z-index: 100;
}

.havfrue2 img {
  width: 850px;
  height: auto;
  object-fit: contain;
}

/* Havfrue2 fade-out */
#havfrue2 {
  animation-name: havfrue-disappear;
  animation-duration: 1s;
  animation-delay: 6s;
  animation-fill-mode: forwards;
  animation-timing-function: ease-out;
}

@keyframes havfrue-disappear {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    pointer-events: none;
  }
}

.havfrue2 {
  position: fixed;
  left: 0;
  top: 20px;
  will-change: transform;
  animation: havfrue-bob 3s ease-in-out infinite;
}

@keyframes havfrue-bob {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-24px);
  } /* hvor langt hun går op */
  100% {
    transform: translateY(0);
  }
}

/* --- KNAPPER --- */
#colors .color {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 16px;
}

#toolbar button {
  background: linear-gradient(135deg, #00b4d8, #48cae4);
  border: none;
  border-radius: 14px;
  color: white;
  font-size: 1rem;
  padding: 8px 14px;
  margin: 6px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s, background 0.3s, box-shadow 0.3s;
}

#toolbar button:hover {
  background: linear-gradient(135deg, #48cae4, #90e0ef);
  transform: scale(1.05);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
}

#toolbar button:active {
  transform: scale(0.98);
}

#template-layer {
  background: #ffffff;
  border-radius: 20px;
}

#drawing-board {
  background: transparent;
}

#template-layer,
#drawing-board {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#drawing-board {
  border: 3px solid #fff;
  border-radius: 20px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}
canvas {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

@media (max-width: 768px) {
  #toolbar {
    width: 100%;
    padding: 12px;
    max-width: 100%;
  }

  #toolbar h1 {
    font-size: 1.4rem;
  }

  #FiskeTemplates .FiskeTemplate {
    height: 70px;
  }
}

#canva {
  position: relative;
  width: 100%;
  max-width: 950px;
  height: 70vh;
  margin: 0 auto;
  border-radius: 20px;
}

#canva > div {
  position: relative;
  width: 100%;
  height: 100%;
}

#template-layer,
#drawing-board {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#template-layer {
  background: #fff;
  border-radius: 20px;
}
#drawing-board {
  border: 3px solid #fff;
  border-radius: 20px;
  width: 895px;
}

canvas {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

#colors-sizes-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  margin: 12px 0;
}

#saveFish {
  position: static;
}

/* -------------------------------------------------------------------------- */

/* --------------------------forside---------------------------------------- */
#forside.html body {
  margin: 0;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: sticky;
}

#forside-btn .btn-t {
  position: fixed;
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  padding: 18px 70px;
  background-color: #f4aa43;
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

#baggrund-forside {
  position: fixed;
  z-index: -1;
}

.havfrue1 {
  position: fixed;
  left: 20px;
  top: 20px;
  width: 120px;
  height: 180px;
  z-index: 100;
}

.havfrue1 img {
  width: 850px;
  height: auto;
  object-fit: contain;
}

body {
  background-image: url("img/background2.png");
  background-size: 100% auto;
  background-repeat: no-repeat;
  background-position: bottom center;
}

.fish1 {
  position: absolute;
  bottom: 15.4vh;
  width: 150px;
  max-width: 28vw;
  z-index: 1;
  left: calc(-1 * var(--off-fish1));
  will-change: transform;
  animation: fish1 16s linear infinite;
}

@keyframes fish1 {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(100vw + var(--off-fish1)));
  }
}

.fish2 {
  position: absolute;
  bottom: 36.8vh;
  width: 150;
  max-width: 28vw;
  right: calc(-1 * var(--off-fish2));
  z-index: 1;
  animation: fish2 25s linear infinite;
}

@keyframes fish2 {
  0% {
    transform: translateX(0);
  }
  90%,
  100% {
    transform: translateX(calc(-100vw - var(--off-fish2)));
  }
}

.fish3 {
  position: absolute;
  bottom: 5.8vh;
  width: 150;
  max-width: 28vw;
  right: calc(-1 * var(--off-fish3));
  z-index: 1;
  animation: fish3 40s linear infinite;
}

@keyframes fish3 {
  0% {
    transform: translateX(0);
  }
  90%,
  100% {
    transform: translateX(calc(-100vw - var(--off-fish1)));
  }
}

.fish4 {
  position: absolute;
  bottom: 70.8vh;
  width: 150px;
  max-width: 28vw;
  left: calc(-1 * var(--off-fish4));
  z-index: 1;
  animation: fish4 40s linear infinite;
}

@keyframes fish4 {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(100vw + var(--off-fish4)));
  }
}

.fish5 {
  position: absolute;
  bottom: 83.8vh;
  width: 150px;
  max-width: 28vw;
  left: calc(-1 * var(--off-fish5));
  z-index: 1;
  animation: fish5 15s linear infinite;
}

@keyframes fish5 {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(100vw + var(--off-fish5)));
  }
}

.fish6 {
  position: absolute;
  bottom: 58.8vh;
  width: 150;
  max-width: 28vw;
  right: calc(-1 * var(--off-fish3));
  z-index: 1;
  animation: fish6 16s linear infinite;
}

.kiste {
  position: absolute;
  bottom: 19px;
  width: 700px;
  max-width: 60vw;
  left: 44%;
  transform: translateX(-50%);
  z-index: -1;
}

@keyframes fish6 {
  0% {
    transform: translateX(0);
  }
  90%,
  100% {
    transform: translateX(calc(-100vw - var(--off-fish1)));
  }
}

.havfrue1 {
  position: fixed;
  left: 0;
  top: 20px;
  will-change: transform;
  animation: havfrue-bob 3s ease-in-out infinite;
}

@keyframes havfrue-bob {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-24px);
  } /* hvor langt hun går op */
  100% {
    transform: translateY(0);
  }
}

/*-----------------------------------------------------------------------------------------*/
/*----------------------------------- tooltip forside -------------------------------------*/

.tooltip {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background-color: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.35;
  max-width: min(320px, 90vw);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none; /* så den ikke fanger når du flytter musen henover */
  z-index: 1000;
}

.tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/*-----------------------------------------------------------------------------------------*/
/*----------------------------------- akvarium side ---------------------------------------*/

.fishOne {
  position: absolute;
  bottom: 15.4vh;
  width: 150px;
  max-width: 28vw;
  z-index: 1;
  left: calc(-1 * var(--off-fish1));
  will-change: transform;
  animation: fishOne 16s linear infinite;
}

@keyframes fishOne {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(100vw + var(--off-fish1)));
  }
}

.fishTwo {
  position: absolute;
  bottom: 36.8vh;
  width: 150;
  max-width: 28vw;
  right: calc(-1 * var(--off-fish2));
  z-index: 1;
  animation: fishTwo 25s linear infinite;
}

@keyframes fishTwo {
  0% {
    transform: translateX(0);
  }
  90%,
  100% {
    transform: translateX(calc(-100vw - var(--off-fish2)));
  }
}

.fishTree {
  position: absolute;
  bottom: 5.8vh;
  width: 150;
  max-width: 28vw;
  right: calc(-1 * var(--off-fish3));
  z-index: 1;
  animation: fishTree 40s linear infinite;
}

@keyframes fishTree {
  0% {
    transform: translateX(0);
  }
  90%,
  100% {
    transform: translateX(calc(-100vw - var(--off-fish1)));
  }
}

.fishFour {
  position: absolute;
  bottom: 70.8vh;
  width: 150px;
  max-width: 28vw;
  left: calc(-1 * var(--off-fish4));
  z-index: 1;
  animation: fishFour 40s linear infinite;
}

@keyframes fishFour {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(100vw + var(--off-fish4)));
  }
}

.fishFive {
  position: absolute;
  bottom: 83.8vh;
  width: 150px;
  max-width: 28vw;
  left: calc(-1 * var(--off-fish5));
  z-index: 1;
  animation: fishFive 15s linear infinite;
}

@keyframes fishFive {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(100vw + var(--off-fish5)));
  }
}

.fishSix {
  position: absolute;
  bottom: 58.8vh;
  width: 150;
  max-width: 28vw;
  right: calc(-1 * var(--off-fish3));
  z-index: 1;
  animation: fishSix 9s linear infinite;
}

@keyframes fishSix {
  0% {
    transform: translateX(0);
  }
  90%,
  100% {
    transform: translateX(calc(-100vw - var(--off-fish1)));
  }
}

#fishDrawing {
  position: absolute;
  width: 350px;
  max-width: 28vw;
  left: calc(-1 * var(--off-fish5));
  top: 38%;
  transform: translateY(-50%);
  z-index: 1;
  animation: fishFive 15s linear infinite;
}

/* ---------------- MODAL ---------------- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);

  justify-content: center;
  align-items: center;
}

.modal-content {
  background: #fff;
  padding: 40px 60px;
  border-radius: 20px;
  width: auto;
  max-width: 700px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);

  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;

  position: relative;
  box-sizing: border-box;
}

.close {
  position: absolute;
  top: 16px;
  right: 20px;
  color: #666;
  font-size: 28px;
  cursor: pointer;
  transition: color 0.2s ease;
}
.close:hover {
  color: #000;
}

#fishPreview {
  display: block;
  max-width: 80%;
  max-height: 55vh;
  object-fit: contain;
  margin: 0 auto 25px auto;
}

.fish-title {
  font-family: "Poppins", sans-serif;
  font-size: 56px;
  font-weight: 700;
  color: #1b4b7a;
  margin-bottom: 25px;
  text-align: center;
}

#fishName {
  display: block;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 16px 20px;
  font-size: 22px;
  border: 2px solid #ccc;
  border-radius: 10px;
  width: 320px;
  text-align: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#fishName:focus {
  border-color: #4aa3df;
  box-shadow: 0 0 6px rgba(74, 163, 223, 0.4);
  outline: none;
}

#saveFishName {
  background-color: #4aa3df;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 14px 28px;
  font-size: 20px;
  margin-top: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}
#saveFishName:hover {
  background-color: #3a93cf;
}
#saveFishName:active {
  transform: scale(0.97);
}
