/*=============== NEW UNDERWATER ABOUT SECTION ===============*/

/* --- Main container setup --- */
#underwater-about {
  position: relative;
  padding-block: 5rem 1rem;
  overflow: hidden;
  background-image: linear-gradient(0deg, #7c90c3, #7c8db2, #94adec, #8195be, #8491b0, #b3c6e2);
}

/* --- Content box styling (from original site) --- */
/* This ensures the content box with text and image sits nicely on top of the animation */
.about__container {
    position: relative;
    z-index: 5; 
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(3px);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.7);
}

/* --- Animated background --- */
.ocean {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1; /* Behind the content */
}

.ocean::after,
.ocean::before {
  background-color: white;
  width: 120%;
  height: 120px;
  position: absolute;
  content: "";
  top: -80px;
  left: -10%;
  border-radius: 100%;
  animation: waves 10s ease infinite;
  opacity: 0.2;
}

.ocean::before {
  top: -60px;
  animation-delay: 5s;
  opacity: 0.1;
  left: -5%;
}

@keyframes waves {
  0%, 100% {
    transform: rotate(-2deg);
  }
  50% {
    transform: rotate(2deg);
  }
}

/* --- Bubbles --- */
.bubbles {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  animation: bubbles-sway 10s linear infinite;
}

@keyframes bubbles-sway {
  0%, 100% {
    transform: rotate(-5deg);
  }
  50% {
    transform: rotate(5deg);
  }
}

.bubbles span {
  width: 50px;
  height: 50px;
  border-radius: 100%;
  position: absolute;
  background-color: white;
  bottom: -10%;
  animation: bubble-rise 10s ease-in-out infinite;
}

@keyframes bubble-rise {
  0% {
    bottom: -10%;
    opacity: 0;
  }
  100% {
    bottom: 100%;
  }
}
.bubbles span:nth-child(1) {
  width: 50px;
  height: 50px;
  opacity: 0.2;
  left: 10%;
  animation-delay: 3s;
  animation-duration: 10s;
}

.bubbles span:nth-child(2) {
  width: 30px;
  height: 30px;
  opacity: 0.1;
  left: 40%;
  animation-delay: 1s;
  animation-duration: 5s;
}

.bubbles span:nth-child(3) {
  width: 10px;
  height: 10px;
  opacity: 0.3;
  left: 30%;
  animation-delay: 5s;
  animation-duration: 20s;
}

.bubbles span:nth-child(4) {
  width: 35px;
  height: 35px;
  opacity: 0.2;
  left: 40%;
  animation-delay: 8s;
  animation-duration: 8s;
}

.bubbles span:nth-child(5) {
  width: 45px;
  height: 45px;
  opacity: 0.1;
  left: 60%;
  animation-delay: 10s;
  animation-duration: 15s;
}

.bubbles span:nth-child(6) {
  width: 40px;
  height: 40px;
  opacity: 0.4;
  left: 80%;
  animation-delay: 3s;
  animation-duration: 30s;
}

.bubbles span:nth-child(7) {
  width: 15px;
  height: 15px;
  opacity: 0.3;
  left: 90%;
  animation-duration: 25s;
}

.bubbles span:nth-child(8) {
  width: 20px;
  height: 20px;
  opacity: 0.2;
  left: 50%;
  animation-duration: 10s;
}

/* --- Animated Fish --- */
.fish {
  width: 150px;
  height: 150px;
  border-radius: 100%;
  background-color: #b86e7b;
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  box-shadow: inset 0px -6px 0px rgba(0, 0, 0, 0.1);
  animation: fish-swim 40s ease-in infinite;
  z-index: 2; /* Fish is above general ocean but below content */
}

@keyframes fish-swim {
  0% {
    left: calc(100% + 150px);
    top: 60%;
    transform: scaleX(1);
  }
  49.99% {
    top: 40%;
    transform: scaleX(1);
  }
  50% {
    left: -150px;
    top: 40%;
    transform: scaleX(-1);
  }
  99.99% {
    top: 55%;
    transform: scaleX(-1);
  }
  100% {
    left: calc(100% + 150px);
    top: 60%;
    transform: scaleX(1);
  }
}

.fish::after, .fish::before {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  background-color: inherit;
  content: "";
  position: absolute;
  top: 30%;
  right: -20px;
  transform: rotate(-20deg);
  z-index: -1;
  animation: tail 2s ease infinite;
}

.fish::before {
  top: 42%;
  transform: rotate(20deg);
}

@keyframes tail {
  0%, 100% {
    right: -20px;
  }
  50% {
    right: -10px;
  }
}

.fish span {
  content: "";
  position: absolute;
}

.fish span:nth-child(1),
.fish span:nth-child(2) {
  border-radius: 100%;
  width: 30px;
  height: 30px;
  background-color: white;
  box-shadow: inset 0px -5px 0px rgba(0, 0, 0, 0.1);
  top: 20px;
  z-index: -2;
}

.fish span:nth-child(2) {
  z-index: 0;
  left: 35px;
  top: 25px;
}

.fish span:nth-child(1)::after,
.fish span:nth-child(2)::after {
  border-radius: 100%;
  width: 10px;
  height: 10px;
  background-color: #2a2a2a;
  content: "";
  position: absolute;
  z-index: 1;
  top: 6px;
  left: 6px;
  box-shadow: inset 0px 2px 0px rgba(255, 255, 255, 0.5);
  animation: eyes 4s ease infinite;
}

@keyframes eyes {
  0%, 100% {
    top: 4px;
  }
  50% {
    top: 10px;
  }
}

.fish span:nth-child(3) {
  border-radius: 100%;
  width: 25px;
  height: 15px;
  background-color: brown;
  box-shadow: inset 0px -5px 0px rgba(0, 0, 0, 0.3);
  top: 50px;
  left: -5px;
  z-index: 1;
  transform: rotate(5deg);
  border: solid 5px orange;
  animation: mouth 4s ease infinite;
}

@keyframes mouth {
  0%, 100% {
    height: 25px;
    width: 15px;
  }
  50% {
    height: 15px;
    width: 8px;
  }
}

.fish span:nth-child(4),
.fish span:nth-child(5),
.fish span:nth-child(6) {
  border-radius: 100%;
  width: 30px;
  height: 30px;
  background-color: white;
  box-shadow: inset 0px 5px 0px rgba(0, 0, 0, 0.3);
  top: 20px;
  left: -30px;
  z-index: -2;
  opacity: 0.3;
  animation: fishbubbles 4s ease infinite;
  z-index: 2;
}

.fish span:nth-child(5) {
  animation-delay: 0.5s;
  width: 20px;
  height: 20px;
}

.fish span:nth-child(6) {
  animation-delay: 1s;
  width: 10px;
  height: 10px;
}

@keyframes fishbubbles {
  0% {
    width: 0;
    height: 0;
    top: 70px;
    left: 2px;
  }
  50% {
    left: -20px;
  }
  100% {
    top: -80px;
    opacity: 0;
  }
}

/* --- Dark Mode adjustments --- */
.dark-theme #underwater-about {
    background-image: linear-gradient(0deg, #1a2a4f, #2a395f, #3a496f, #213559, #242e40, #334662);
}

.dark-theme .fish {
    background-color: #d88e9b;
}

.dark-theme .bubbles span {
    background-color: rgba(200, 220, 255, 0.7);
    box-shadow: 0 0 10px rgba(200, 220, 255, 0.5);
}
/* --- Seabed Plants --- */
.seabed {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 200px; /* Max height of plants */
  z-index: 3; /* Above fish and ocean, below content */
  pointer-events: none;
}

.plant {
  position: absolute;
  bottom: -10px; /* Start slightly below the edge */
  transform-origin: bottom center;
}

/* Style 1: Tall, wavy kelp */
.plant--style1 {
  width: 15px;
  height: 150px;
  background: linear-gradient(to top, #3a7d44, #5dbb63);
  border-radius: 10px 10px 0 0;
  animation: sway 8s ease-in-out infinite;
}

/* Style 2: Bushy, round plant */
.plant--style2 {
  width: 80px;
  height: 80px;
  background-color: #d86c78;
  border-radius: 50%;
  box-shadow: 10px 10px 0 #c75b68, -10px 5px 0 #e08b95;
  animation: sway 10s ease-in-out infinite;
}

/* Style 3: Spiky plant */
.plant--style3 {
    width: 0;
    height: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-bottom: 100px solid #8e44ad;
    position: relative;
    animation: sway 6s ease-in-out infinite;
}
.plant--style3::before, .plant--style3::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 70px solid #9b59b6;
    bottom: -80px; /* position relative to parent */
}
.plant--style3::before {
    left: -25px;
    transform: rotate(-20deg);
}
.plant--style3::after {
    right: -25px;
    transform: rotate(20deg);
}


/* Positioning */
.plant--pos1 { left: 10%; height: 120px; animation-delay: 1s; }
.plant--pos2 { left: 25%; animation-delay: 2.5s; }
.plant--pos3 { left: 40%; height: 180px; }
.plant--pos4 { left: 60%; animation-delay: 0.5s; }
.plant--pos5 { left: 80%; width: 60px; height: 60px; animation-delay: 1.5s; }
.plant--pos6 { left: 90%; height: 100px; animation-delay: 2s; }

/* General sway animation for all plants */
@keyframes sway {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}