/* Cool Animations for Homepage */

/* Floating animation for icons */
@keyframes floatUp {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-8px) rotate(-2deg);
  }
  50% {
    transform: translateY(-5px) rotate(0deg);
  }
  75% {
    transform: translateY(-8px) rotate(2deg);
  }
}

/* Glow pulse animation */
@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 4px 16px rgba(52, 73, 94, 0.2);
  }
  50% {
    box-shadow: 0 4px 24px rgba(52, 73, 94, 0.4), 0 0 20px rgba(52, 73, 94, 0.1);
  }
}

/* Slide in from left */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide in from right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale up on load */
@keyframes scaleUp {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Gradient animation */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Apply animations to research cards */
.research-area-card {
  animation: scaleUp 0.6s ease-out forwards;
  animation-delay: calc(var(--card-index, 0) * 0.1s);
  opacity: 0;
}

.research-area-card:nth-child(1) {
  --card-index: 0;
}

.research-area-card:nth-child(2) {
  --card-index: 1;
}

.research-area-card:nth-child(3) {
  --card-index: 2;
}

/* Hover effect enhancements */
.research-area-card:hover .area-icon {
  animation: floatUp 1s ease-in-out infinite;
}

/* Hero section animation */
#hero {
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

/* Statistics counter animation */
.stat-number {
  display: inline-block;
  animation: scaleUp 0.8s ease-out forwards;
}

/* Button hover effects */
.btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

/* Parallax scroll effect */
.parallax-element {
  transition: transform 0.6s ease-out;
}

/* Loading animation for images */
.image-loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Interactive card tilt effect */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}

.tilt-card:hover {
  transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

/* Text reveal animation */
@keyframes textReveal {
  from {
    clip-path: polygon(0 0, 0 0, 0 100%, 0% 100%);
  }
  to {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  }
}

.reveal-text {
  animation: textReveal 1s ease-out forwards;
}

/* Smooth scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 50px;
  border: 2px solid #34495e;
  border-radius: 15px;
  cursor: pointer;
  animation: bounce 2s infinite;
}

.scroll-indicator::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 10px;
  background: #34495e;
  border-radius: 2px;
  animation: scrollDown 2s infinite;
}

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

@keyframes scrollDown {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(0);
  }
  40% {
    opacity: 1;
  }
  80% {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
}