/* Keyframe Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-10deg) scale(0.8);
  }
  to {
    opacity: 1;
    transform: rotate(0deg) scale(1);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes kenBurns {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.1);
  }
}

@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes glow {
  0%,
  100% {
    filter: drop-shadow(0 0 10px rgba(123, 204, 228, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 20px rgba(123, 204, 228, 0.6));
  }
}

@keyframes pulseGlow {
  0%,
  100% {
    filter: drop-shadow(0 0 15px rgba(123, 204, 228, 0.4)) drop-shadow(0 0 30px rgba(235, 195, 184, 0.2));
  }
  50% {
    filter: drop-shadow(0 0 25px rgba(123, 204, 228, 0.7)) drop-shadow(0 0 50px rgba(235, 195, 184, 0.4));
  }
}

@keyframes pulseButton {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(123, 204, 228, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(123, 204, 228, 0);
  }
}

@keyframes bounceGentle {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes scrollWheel {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes pulseRing {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.2);
    opacity: 0;
  }
}

@keyframes ping {
  75%,
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Hero Specific Animations */
@keyframes heroLogoIn {
  from {
    opacity: 0;
    transform: scale(0.75) translateY(2rem);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes heroTitleIn {
  from {
    opacity: 0;
    transform: translateY(3rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroSubtitleIn {
  from {
    opacity: 0;
    transform: translateY(2rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroButtonsIn {
  from {
    opacity: 0;
    transform: translateY(2rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scrollIndicatorIn {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animation Classes */
.animate-fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fade-in-left {
  animation: fadeInLeft 0.8s ease-out forwards;
}

.animate-fade-in-right {
  animation: fadeInRight 0.8s ease-out forwards;
}

.animate-scale-in {
  animation: scaleIn 0.8s ease-out forwards;
}

.animate-slide-in-up {
  animation: slideInUp 0.8s ease-out forwards;
}

.animate-rotate-in {
  animation: rotateIn 0.8s ease-out forwards;
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-ken-burns {
  animation: kenBurns 20s ease-in-out infinite alternate;
}

.animate-gradient-shift {
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
}

.animate-shimmer {
  background-size: 300% 100%;
  animation: shimmer 3s ease-in-out infinite;
}

.animate-glow {
  animation: glow 3s ease-in-out infinite;
}

.animate-pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

.animate-pulse-button {
  animation: pulseButton 2s infinite;
}

.animate-bounce-gentle {
  animation: bounceGentle 2s ease-in-out infinite;
}

.animate-scroll-indicator {
  animation: scrollWheel 2s ease-in-out infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.animate-spin-slow {
  animation: spin 20s linear infinite;
}

.animate-bounce {
  animation: bounce 1s infinite;
}

.animate-bounce-slow {
  animation: bounce 3s ease-in-out infinite;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-pulse-slow {
  animation: pulse 4s ease-in-out infinite;
}

.animate-pulse-ring {
  animation: pulseRing 2s ease-out infinite;
}

.animate-ping {
  animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Intersection Observer Animation Classes */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.animate-on-scroll.animate {
  opacity: 1;
  transform: translateY(0);
}

.animate-on-scroll[data-animate="fade-in-up"] {
  opacity: 0;
  transform: translateY(30px);
}

.animate-on-scroll[data-animate="fade-in-up"].animate {
  opacity: 1;
  transform: translateY(0);
}

.animate-on-scroll[data-animate="fade-in-left"] {
  opacity: 0;
  transform: translateX(-30px);
}

.animate-on-scroll[data-animate="fade-in-left"].animate {
  opacity: 1;
  transform: translateX(0);
}

.animate-on-scroll[data-animate="fade-in-right"] {
  opacity: 0;
  transform: translateX(30px);
}

.animate-on-scroll[data-animate="fade-in-right"].animate {
  opacity: 1;
  transform: translateX(0);
}

.animate-on-scroll[data-animate="scale-in"] {
  opacity: 0;
  transform: scale(0.8);
}

.animate-on-scroll[data-animate="scale-in"].animate {
  opacity: 1;
  transform: scale(1);
}

.animate-on-scroll[data-animate="slide-in-up"] {
  opacity: 0;
  transform: translateY(40px);
}

.animate-on-scroll[data-animate="slide-in-up"].animate {
  opacity: 1;
  transform: translateY(0);
}

.animate-on-scroll[data-animate="rotate-in"] {
  opacity: 0;
  transform: rotate(-10deg) scale(0.8);
}

.animate-on-scroll[data-animate="rotate-in"].animate {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Delay Classes */
.animate-on-scroll[data-delay="150"] {
  transition-delay: 150ms;
}

.animate-on-scroll[data-delay="200"] {
  transition-delay: 200ms;
}

.animate-on-scroll[data-delay="300"] {
  transition-delay: 300ms;
}

.animate-on-scroll[data-delay="400"] {
  transition-delay: 400ms;
}

.animate-on-scroll[data-delay="450"] {
  transition-delay: 450ms;
}

.animate-on-scroll[data-delay="600"] {
  transition-delay: 600ms;
}

/* Hover Animations */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.hover-scale {
  transition: transform 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-rotate {
  transition: transform 0.3s ease;
}

.hover-rotate:hover {
  transform: rotate(5deg);
}

/* Loading Animations */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(123, 204, 228, 0.3);
  border-top: 4px solid var(--afandy-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-dots {
  display: flex;
  gap: 4px;
}

.loading-dot {
  width: 8px;
  height: 8px;
  background: var(--afandy-blue);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out;
}

.loading-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
  animation-delay: -0.16s;
}

.loading-dot:nth-child(3) {
  animation-delay: 0s;
}

/* Stagger Animation */
.stagger-animation > * {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease-out forwards;
}

.stagger-animation > *:nth-child(1) {
  animation-delay: 0.1s;
}
.stagger-animation > *:nth-child(2) {
  animation-delay: 0.2s;
}
.stagger-animation > *:nth-child(3) {
  animation-delay: 0.3s;
}
.stagger-animation > *:nth-child(4) {
  animation-delay: 0.4s;
}
.stagger-animation > *:nth-child(5) {
  animation-delay: 0.5s;
}
.stagger-animation > *:nth-child(6) {
  animation-delay: 0.6s;
}

/* Parallax Effect */
.parallax {
  transform: translateZ(0);
  will-change: transform;
}

/* Smooth Transitions */
.smooth-transition {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.smooth-transition-slow {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Performance Optimizations */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll,
  .animate-fade-in-up,
  .animate-fade-in-left,
  .animate-fade-in-right,
  .animate-scale-in,
  .animate-slide-in-up,
  .animate-rotate-in,
  .animate-float,
  .animate-ken-burns,
  .animate-gradient-shift,
  .animate-shimmer,
  .animate-glow,
  .animate-pulse-glow,
  .animate-pulse-button,
  .animate-bounce-gentle,
  .animate-scroll-indicator,
  .animate-spin,
  .animate-spin-slow,
  .animate-bounce,
  .animate-bounce-slow,
  .animate-pulse,
  .animate-pulse-slow,
  .animate-pulse-ring,
  .animate-ping {
    animation: none !important;
    transition: none !important;
  }

  .animate-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
}
