/* Basic Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 40px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translate3d(-40px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translate3d(40px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

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

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

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

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

@keyframes scaleIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 1s ease forwards;
}

.fade-in-up {
  animation: fadeInUp 1s ease forwards;
}

.fade-in-left {
  animation: fadeInLeft 1s ease forwards;
}

.fade-in-right {
  animation: fadeInRight 1s ease forwards;
}

.pulse {
  animation: pulse 2s infinite;
}

.float {
  animation: float 6s ease-in-out infinite;
}

.bounce {
  animation: bounce 2s infinite;
}

.spin {
  animation: spin 2s linear infinite;
}

.scale-in {
  animation: scaleIn 0.5s ease forwards;
}

/* Animated Elements - Initial State */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* Hover Animations */
.hover-scale {
  transition: transform 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-float {
  transition: transform 0.3s ease;
}

.hover-float:hover {
  transform: translateY(-5px);
}

.hover-rotate {
  transition: transform 0.3s ease;
}

.hover-rotate:hover {
  transform: rotate(5deg);
}

/* Button Animations */
.btn-pulse {
  animation: pulse 2s infinite;
}

/* Image Animations */
.img-zoom {
  overflow: hidden;
}

.img-zoom img {
  transition: transform 0.3s ease;
}

.img-zoom:hover img {
  transform: scale(1.1);
}

/* Loader Animation */
.loader {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 174, 239, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s ease-in-out infinite;
}

/* Progress Animation */
@keyframes progress {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

.progress-animate {
  animation: progress 3s linear forwards;
}

/* Advanced Animation Delays */
.delay-100 {
  animation-delay: 0.1s !important;
}

.delay-200 {
  animation-delay: 0.2s !important;
}

.delay-300 {
  animation-delay: 0.3s !important;
}

.delay-400 {
  animation-delay: 0.4s !important;
}

.delay-500 {
  animation-delay: 0.5s !important;
}

.delay-600 {
  animation-delay: 0.6s !important;
}

.delay-700 {
  animation-delay: 0.7s !important;
}

.delay-800 {
  animation-delay: 0.8s !important;
}

.delay-900 {
  animation-delay: 0.9s !important;
}

.delay-1000 {
  animation-delay: 1s !important;
}

/* Special Effects */
@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.ripple-effect {
  position: relative;
  overflow: hidden;
}

.ripple-effect::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150%;
  height: 150%;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  animation: ripple 0.6s linear;
}

/* Text Animation */
@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blinkCursor {
  from {
    border-right-color: rgba(0, 174, 239, 0.75);
  }
  to {
    border-right-color: transparent;
  }
}

.typewriter {
  display: inline-block;
  overflow: hidden;
  border-right: 3px solid rgba(0, 174, 239, 0.75);
  white-space: nowrap;
  margin: 0 auto;
  animation: 
    typewriter 4s steps(40) 1s 1 normal both,
    blinkCursor 0.7s steps(40) infinite normal;
}

/* Number Counter Animation */
@keyframes count {
  from {
    content: "0";
  }
  to {
    content: attr(data-count);
  }
}

.counter:after {
  content: "0";
  animation: count 2s linear forwards;
}

.counter.visible:after {
  content: attr(data-count);
}

/* Path Animation for SVG */
@keyframes dash {
  to {
    stroke-dashoffset: 0;
  }
}

.animate-path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: dash 5s linear forwards;
}

/* Shake Animation */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

.shake {
  animation: shake 0.8s cubic-bezier(.36,.07,.19,.97) both;
}

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

.gradient-animate {
  background: linear-gradient(-45deg, var(--primary), var(--primary-dark), var(--primary-light), var(--primary));
  background-size: 400% 400%;
  animation: gradient 15s ease infinite;
}