/* Animations & Effects for Anissa & Hamzah's Wedding */

/* Sparkling Stars Effect */
.stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.star {
  position: absolute;
  width: 3px;
  height: 3px;
  background-color: #d4af37;
  border-radius: 50%;
  opacity: 0;
  animation: twinkle var(--duration) ease-in-out infinite;
  animation-delay: var(--delay);
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0;
    transform: scale(0.5);
  }
  50% {
    opacity: 0.8;
    transform: scale(1);
  }
}

/* Gold Particles Effect */
.particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background-color: #d4af37;
  border-radius: 50%;
  opacity: 0.4;
  pointer-events: none;
  animation: float 15s linear infinite;
}

@keyframes float {
  0% {
    transform: translateY(100vh) translateX(0);
    opacity: 0;
  }
  20% {
    opacity: 0.4;
  }
  80% {
    opacity: 0.4;
  }
  100% {
    transform: translateY(-100px) translateX(calc(var(--random) * 200px));
    opacity: 0;
  }
}

/* Fade In Animation for Sections */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s ease, transform 1s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Pulse Animation for the Names */
@keyframes pulse {
  0% {
    text-shadow: 0 0 5px rgba(212, 175, 55, 0.1);
  }
  50% {
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5),
      0 0 30px rgba(212, 175, 55, 0.3);
  }
  100% {
    text-shadow: 0 0 5px rgba(212, 175, 55, 0.1);
  }
}

.pulse-glow {
  animation: pulse 4s infinite;
}

/* Heart Beat Animation */
@keyframes heartbeat {
  0%,
  100% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.1);
  }
  50% {
    transform: scale(1);
  }
  75% {
    transform: scale(1.1);
  }
}

.heartbeat {
  animation: heartbeat 2s infinite;
}

/* Shining Border Animation */
.shine-border {
  position: relative;
  overflow: hidden;
}

.shine-border::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0) 40%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(255, 255, 255, 0) 60%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(45deg);
  animation: shine 4s infinite;
  pointer-events: none;
}

@keyframes shine {
  0% {
    transform: translateX(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) rotate(45deg);
  }
}

/* Opening Animation for Envelope */
@keyframes envelope-open {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.envelope-animation {
  animation: envelope-open 1.5s ease-out;
}

/* Typewriter Effect */
.typewriter {
  overflow: hidden;
  white-space: nowrap;
  margin: 0 auto;
  letter-spacing: 0.15em;
  animation: typing 3.5s steps(40, end);
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}
