/* MineHubX - Floating Island Animation */

.floating-island-scene {
  position: relative;
  width: 400px;
  height: 400px;
  perspective: 1200px;
  transform-style: preserve-3d;
  margin: 0 auto;
}

/* Main Island */
.island-container {
  position: absolute;
  width: 300px;
  height: 200px;
  top: 50%;
  left: 50%;
  transform-style: preserve-3d;
  transform: translate(-50%, -50%) rotateX(15deg) rotateY(0deg);
  animation: floatIsland 12s ease-in-out infinite;
}

.island-base {
  position: absolute;
  width: 300px;
  height: 100px;
  transform-style: preserve-3d;
  transform: translateZ(0);
}

/* Top surface of island */
.island-top {
  position: absolute;
  width: 300px;
  height: 200px;
  background: linear-gradient(to bottom right, #7fb238 0%, #8bc34a 100%);
  border-radius: 50% 50% 45% 45%;
  transform: translateZ(40px);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

/* Grass texture overlay */
.island-top::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(139, 195, 74, 0.8) 5px, transparent 5px),
    radial-gradient(circle at 40% 70%, rgba(139, 195, 74, 0.8) 4px, transparent 4px),
    radial-gradient(circle at 60% 40%, rgba(139, 195, 74, 0.8) 6px, transparent 6px),
    radial-gradient(circle at 80% 60%, rgba(139, 195, 74, 0.8) 5px, transparent 5px);
  background-size: 50px 50px;
  opacity: 0.7;
}

/* Bottom of island */
.island-bottom {
  position: absolute;
  width: 280px;
  height: 180px;
  background: linear-gradient(to bottom, #8d6e63 20%, #5d4037 100%);
  border-radius: 45% 45% 50% 50%;
  transform: translateZ(0) translateY(30px) translateX(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Side of island */
.island-side {
  position: absolute;
  width: 300px;
  height: 40px;
  background: linear-gradient(to bottom, #8bc34a 0%, #8d6e63 100%);
  transform: rotateX(90deg) translateZ(20px) translateY(-20px);
  border-radius: 50%;
}

/* Trees */
.tree {
  position: absolute;
  transform-style: preserve-3d;
  transform-origin: bottom center;
}

.tree-trunk {
  position: absolute;
  width: 10px;
  height: 30px;
  background: linear-gradient(to bottom, #8d6e63, #5d4037);
  transform: translateX(-5px) translateY(-30px) translateZ(0);
}

.tree-top {
  position: absolute;
  width: 40px;
  height: 40px;
  background: linear-gradient(to bottom, #2e7d32, #1b5e20);
  border-radius: 50% 50% 10% 10%;
  transform: translateX(-20px) translateY(-60px) translateZ(0);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Tree positions */
.tree:nth-child(1) {
  top: 40%;
  left: 30%;
  transform: scale(1.2) translateZ(45px);
}

.tree:nth-child(2) {
  top: 30%;
  left: 60%;
  transform: scale(0.9) translateZ(45px);
}

.tree:nth-child(3) {
  top: 60%;
  left: 70%;
  transform: scale(1.1) translateZ(45px);
}

.tree:nth-child(4) {
  top: 50%;
  left: 20%;
  transform: scale(0.8) translateZ(45px);
}

/* Floating rocks */
.floating-rock {
  position: absolute;
  background: linear-gradient(to bottom, #9e9e9e, #616161);
  border-radius: 50%;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.floating-rock:nth-child(1) {
  width: 40px;
  height: 30px;
  top: 70%;
  left: 10%;
  animation: floatRock 8s ease-in-out infinite;
}

.floating-rock:nth-child(2) {
  width: 30px;
  height: 25px;
  top: 30%;
  left: 85%;
  animation: floatRock 7s ease-in-out infinite 1s;
}

.floating-rock:nth-child(3) {
  width: 25px;
  height: 20px;
  top: 80%;
  left: 80%;
  animation: floatRock 9s ease-in-out infinite 2s;
}

/* Water feature */
.water-feature {
  position: absolute;
  width: 40px;
  height: 40px;
  top: 45%;
  left: 50%;
  transform: translateZ(45px);
}

.water {
  position: absolute;
  width: 40px;
  height: 20px;
  background: linear-gradient(to bottom, #29b6f6, #0288d1);
  border-radius: 50%;
  transform: translateX(-50%) translateY(-50%);
  box-shadow: 0 0 10px rgba(41, 182, 246, 0.7);
  animation: waterShimmer 4s ease-in-out infinite;
}

.waterfall {
  position: absolute;
  width: 10px;
  height: 100px;
  background: linear-gradient(to bottom, #29b6f6, rgba(41, 182, 246, 0));
  top: 10px;
  left: 15px;
  transform-origin: top center;
  transform: rotateX(80deg);
  opacity: 0.7;
  filter: blur(2px);
}

/* Clouds */
.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  filter: blur(5px);
  opacity: 0.7;
}

.cloud:nth-child(1) {
  width: 100px;
  height: 50px;
  top: 20%;
  left: 0%;
  animation: floatCloud 20s linear infinite;
}

.cloud:nth-child(2) {
  width: 80px;
  height: 40px;
  top: 10%;
  left: 30%;
  animation: floatCloud 25s linear infinite 5s;
}

.cloud:nth-child(3) {
  width: 120px;
  height: 60px;
  top: 15%;
  left: 60%;
  animation: floatCloud 22s linear infinite 10s;
}

/* Glow effect */
.island-glow {
  position: absolute;
  width: 350px;
  height: 200px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -40%);
  background: radial-gradient(ellipse at center, rgba(139, 195, 74, 0.3) 0%, rgba(139, 195, 74, 0) 70%);
  border-radius: 50%;
  filter: blur(20px);
  animation: glowPulse 4s ease-in-out infinite;
}

/* Fireflies/Particles */
.firefly {
  position: absolute;
  width: 4px;
  height: 4px;
  background-color: rgba(255, 255, 150, 0.8);
  border-radius: 50%;
  filter: blur(1px);
  box-shadow: 0 0 5px rgba(255, 255, 150, 0.8);
  animation: firefly-float 10s ease-in-out infinite;
  opacity: 0.7;
}

.firefly:nth-child(1) {
  top: 30%;
  left: 20%;
  animation-duration: 12s;
  animation-delay: 0s;
}

.firefly:nth-child(2) {
  top: 40%;
  left: 60%;
  animation-duration: 15s;
  animation-delay: 2s;
}

.firefly:nth-child(3) {
  top: 60%;
  left: 40%;
  animation-duration: 10s;
  animation-delay: 4s;
}

.firefly:nth-child(4) {
  top: 20%;
  left: 70%;
  animation-duration: 14s;
  animation-delay: 1s;
}

.firefly:nth-child(5) {
  top: 70%;
  left: 30%;
  animation-duration: 11s;
  animation-delay: 3s;
}

/* Animations */
@keyframes floatIsland {
  0%, 100% {
    transform: translate(-50%, -50%) rotateX(15deg) rotateY(0deg) translateY(0);
  }
  50% {
    transform: translate(-50%, -50%) rotateX(15deg) rotateY(5deg) translateY(-10px);
  }
}

@keyframes firefly-float {
  0%, 100% {
    transform: translateY(0) translateX(0);
    opacity: 0.7;
  }
  25% {
    transform: translateY(-15px) translateX(10px);
    opacity: 1;
  }
  50% {
    transform: translateY(0) translateX(20px);
    opacity: 0.7;
  }
  75% {
    transform: translateY(15px) translateX(10px);
    opacity: 1;
  }
}

@keyframes floatRock {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-15px) rotate(5deg);
  }
}

@keyframes waterShimmer {
  0%, 100% {
    opacity: 0.8;
    transform: translateX(-50%) translateY(-50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) translateY(-50%) scale(1.1);
  }
}

@keyframes floatCloud {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(400px);
  }
}

@keyframes glowPulse {
  0%, 100% {
    opacity: 0.5;
    transform: translate(-50%, -40%) scale(1);
  }
  50% {
    opacity: 0.7;
    transform: translate(-50%, -40%) scale(1.1);
  }
}

/* Media Queries */
@media (max-width: 768px) {
  .floating-island-scene {
    width: 300px;
    height: 300px;
  }

  .island-container {
    width: 250px;
    transform: translate(-50%, -50%) rotateX(15deg) rotateY(0deg) scale(0.8);
  }
}
