/* 
  Massroufak Landing Page - Animation Styles
*/

/* ===== Reset animation styles for hero section ===== */
/* Make hero section elements always visible by default */
.hero .animate-on-scroll {
  opacity: 1 !important;
  transform: translateY(0) !important;
  transition: none !important;
}

/* ===== Animation Classes ===== */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* Different animation delays for items in sequence */
.animate-on-scroll:nth-child(1) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(2) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.3s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.4s; }
.animate-on-scroll:nth-child(5) { transition-delay: 0.5s; }

/* ===== Hover Effects ===== */
.feature-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover .feature-icon {
  transform: scale(1.1) rotate(5deg);
}

.feature-icon {
  transition: transform 0.3s ease;
}

/* Hero section animations */
.hero-background .shape {
  animation: pulse 10s ease-in-out infinite alternate;
}

.shape-1 {
  animation-delay: 0s;
}

.shape-2 {
  animation-delay: 2s;
}

.shape-3 {
  animation-delay: 4s;
}

.shape-4, .shape-5 {
  animation-delay: 1s;
}

@keyframes pulse {
  0% {
    opacity: 0.1;
    transform: scale(1) translate(0, 0);
  }
  50% {
    opacity: 0.3;
    transform: scale(1.05) translate(10px, -10px);
  }
  100% {
    opacity: 0.1;
    transform: scale(1) translate(0, 0);
  }
}

/* Subtle floating animation for feature images */
.floating-image {
  animation: float 6s ease-in-out infinite;
}

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

/* Button hover animations */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 100%;
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.5s, opacity 0.5s;
}

.btn:active::after {
  transform: scale(20);
  opacity: 1;
  transition: 0s;
}

/* Hover effect for nav links */
.nav-links a {
  position: relative;
  transition: color 0.3s ease;
}

/* Custom loader animation */
.loader {
  display: inline-block;
  position: relative;
  width: 40px;
  height: 40px;
}

.loader div {
  display: inline-block;
  position: absolute;
  left: 8px;
  width: 8px;
  background: var(--primary-color);
  animation: loader 1.2s cubic-bezier(0, 0.5, 0.5, 1) infinite;
}

.loader div:nth-child(1) {
  left: 0;
  animation-delay: -0.24s;
}

.loader div:nth-child(2) {
  left: 16px;
  animation-delay: -0.12s;
}

.loader div:nth-child(3) {
  left: 32px;
  animation-delay: 0;
}

@keyframes loader {
  0% {
    top: 8px;
    height: 32px;
  }
  50%, 100% {
    top: 16px;
    height: 16px;
  }
}

/* Mobile menu toggle animation */
.mobile-menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Fade animations for mobile menu */
.mobile-menu {
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}

.mobile-menu.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Scale animation for feature icons */
.feature-icon {
  position: relative;
}

.feature-icon::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--primary-light);
  opacity: 0.2;
  transform: scale(0);
  transition: transform 0.3s ease-out;
}

.feature-card:hover .feature-icon::before {
  transform: scale(1.4);
}

/* Mouse parallax effect */
.parallax {
  transition: transform 0.1s ease-out;
}

/* Glare effect for card hover */
.feature-card::before {
  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.05) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(30deg);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.6s ease;
  pointer-events: none;
}

.feature-card:hover::before {
  opacity: 1;
  transform: rotate(0deg);
}

/* Scroll progress indicator */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background-color: var(--primary-color);
  z-index: 9999;
  transition: width 0.1s ease;
}