/* AQUA Chain - Animations CSS */

/* Water Drop Animation */
.water-drop {
  position: absolute;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  transform-origin: center bottom;
  animation: drop linear forwards;
  z-index: 2;
  top: -10px;
}

@keyframes drop {
  0% {
    transform: scale(1) translateY(0);
    opacity: 0.7;
  }
  70% {
    transform: scale(0.9) translateY(500px);
    opacity: 0.7;
  }
  100% {
    transform: scale(2) translateY(500px);
    opacity: 0;
  }
}

/* Ripple Effect */
.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: ripple 1s linear;
  background-color: rgba(255, 255, 255, 0.3);
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Fade In Animation */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* Staggered Fade In for Multiple Elements */
.stagger-fade-in > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.stagger-fade-in.active > *:nth-child(1) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.1s;
}

.stagger-fade-in.active > *:nth-child(2) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.2s;
}

.stagger-fade-in.active > *:nth-child(3) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.3s;
}

.stagger-fade-in.active > *:nth-child(4) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.4s;
}

.stagger-fade-in.active > *:nth-child(5) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.5s;
}

.stagger-fade-in.active > *:nth-child(6) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.6s;
}

/* Pulse Animation */
.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 153, 204, 0.7);
  }
  
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(0, 153, 204, 0);
  }
  
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 153, 204, 0);
  }
}

/* Floating Animation */
.float {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

/* Water Flow Animation */
.water-flow {
  position: relative;
  overflow: hidden;
}

.water-flow::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(0, 153, 204, 0.1),
    rgba(0, 153, 204, 0.2)
  );
  transform: rotate(-45deg);
  animation: waterFlow 5s linear infinite;
}

@keyframes waterFlow {
  0% {
    transform: rotate(-45deg) translateY(-20%);
  }
  50% {
    transform: rotate(-45deg) translateY(0%);
  }
  100% {
    transform: rotate(-45deg) translateY(20%);
  }
}

/* Typing Animation */
.typing {
  overflow: hidden;
  border-right: 0.15em solid var(--primary-color);
  white-space: nowrap;
  margin: 0 auto;
  letter-spacing: 0.15em;
  animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

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

@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: var(--primary-color) }
}

/* Shimmer Effect */
.shimmer {
  position: relative;
  overflow: hidden;
}

.shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 150%;
  }
}

/* Counter Animation */
.counter {
  display: inline-block;
  font-weight: bold;
}

/* Blockchain Connection Animation */
.blockchain-connection {
  position: relative;
  height: 2px;
  background-color: var(--primary-color);
  transform: scaleX(0);
  transform-origin: left;
  animation: connect 1.5s ease-in-out forwards;
}

@keyframes connect {
  0% {
    transform: scaleX(0);
  }
  100% {
    transform: scaleX(1);
  }
}

/* Data Flow Animation */
.data-flow {
  position: relative;
}

.data-flow::before {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--accent-color);
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  animation: dataFlow 3s linear infinite;
}

@keyframes dataFlow {
  0% {
    left: 0;
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    left: 100%;
    opacity: 0;
  }
}

/* Rotate Animation */
.rotate {
  animation: rotate 10s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Scale In Animation */
.scale-in {
  transform: scale(0.8);
  opacity: 0;
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.scale-in.active {
  transform: scale(1);
  opacity: 1;
}

/* Bounce Animation */
.bounce {
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}

/* Form Message Styles */
.form-message {
  padding: 10px 15px;
  margin-top: 15px;
  border-radius: 5px;
  font-weight: 500;
}

.form-message.success {
  background-color: rgba(0, 204, 102, 0.1);
  color: #00cc66;
  border: 1px solid #00cc66;
}

.form-message.error {
  background-color: rgba(255, 51, 51, 0.1);
  color: #ff3333;
  border: 1px solid #ff3333;
}

.form-message.info {
  background-color: rgba(0, 153, 204, 0.1);
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

/* Water Wave Background */
.wave-bg {
  position: relative;
  overflow: hidden;
}

.wave-bg::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100px;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%230099cc" fill-opacity="0.2" d="M0,192L48,197.3C96,203,192,213,288,229.3C384,245,480,267,576,250.7C672,235,768,181,864,181.3C960,181,1056,235,1152,234.7C1248,235,1344,181,1392,154.7L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
  background-size: 100% 100px;
  animation: waveMove 20s linear infinite;
}

.wave-bg::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%230099cc" fill-opacity="0.3" d="M0,64L48,80C96,96,192,128,288,128C384,128,480,96,576,90.7C672,85,768,107,864,144C960,181,1056,235,1152,234.7C1248,235,1344,181,1392,154.7L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
  background-size: 100% 80px;
  animation: waveMove 15s linear infinite reverse;
}

@keyframes waveMove {
  0% {
    background-position-x: 0;
  }
  100% {
    background-position-x: 1440px;
  }
}

/* Bubble Animation */
.bubble {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  animation: bubble 4s ease-in infinite;
  opacity: 0;
}

@keyframes bubble {
  0% {
    transform: translateY(0) scale(0);
    opacity: 0;
  }
  20% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-800%) scale(2);
    opacity: 0;
  }
}

/* Create bubbles with JavaScript:
function createBubble() {
  const section = document.querySelector('.bubble-section');
  const bubble = document.createElement('div');
  bubble.classList.add('bubble');
  
  // Random size
  const size = Math.random() * 30 + 10;
  bubble.style.width = `${size}px`;
  bubble.style.height = `${size}px`;
  
  // Random position
  const posX = Math.random() * 100;
  bubble.style.left = `${posX}%`;
  bubble.style.bottom = '0';
  
  section.appendChild(bubble);
  
  // Remove bubble after animation completes
  setTimeout(() => {
    bubble.remove();
  }, 4000);
}

setInterval(createBubble, 300);
*/

/* Highlight Animation */
.highlight {
  position: relative;
  display: inline-block;
}

.highlight::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 30%;
  background-color: rgba(0, 204, 255, 0.2);
  z-index: -1;
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.5s ease;
}

.highlight:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* Glow Effect */
.glow {
  transition: all 0.3s ease;
}

.glow:hover {
  box-shadow: 0 0 15px rgba(0, 153, 204, 0.7);
}

/* Slide In Animation */
.slide-in-left {
  transform: translateX(-50px);
  opacity: 0;
  transition: all 0.5s ease;
}

.slide-in-right {
  transform: translateX(50px);
  opacity: 0;
  transition: all 0.5s ease;
}

.slide-in-left.active, .slide-in-right.active {
  transform: translateX(0);
  opacity: 1;
}

/* Flip Card Animation */
.flip-card {
  perspective: 1000px;
  height: 300px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 10px;
  overflow: hidden;
}

.flip-card-front {
  background-color: var(--white);
  color: var(--dark-color);
}

.flip-card-back {
  background: var(--gradient);
  color: var(--white);
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
}