/* 
  Animations for Xploit Security Landing Page
  Author: Development Team
  Version: 1.0
*/

/* ----- Keyframes ----- */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideLeft {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideRight {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes glowPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
}

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

@keyframes shimmer {
  0% {
    background-position: -500px 0;
  }
  100% {
    background-position: 500px 0;
  }
}

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

/* ----- Animation Classes ----- */
.animate-on-scroll {
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animated {
  opacity: 1;
}

.fade-in {
  animation: fadeIn 0.6s ease forwards;
}

.slide-up {
  animation: slideUp 0.6s ease forwards;
}

.slide-down {
  animation: slideDown 0.6s ease forwards;
}

.slide-left {
  animation: slideLeft 0.6s ease forwards;
}

.slide-right {
  animation: slideRight 0.6s ease forwards;
}

.scale-up {
  animation: scaleUp 0.6s ease forwards;
}

.pulse {
  animation: pulse 2s ease infinite;
}

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

.glow {
  animation: glowPulse 2s infinite;
}

.shimmer {
  background: linear-gradient(90deg, 
    rgba(255, 255, 255, 0) 0%, 
    rgba(255, 255, 255, 0.2) 50%, 
    rgba(255, 255, 255, 0) 100%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

.rotate {
  animation: rotate 10s linear infinite;
}

/* ----- Staggered Animations ----- */
.stagger-children > * {
  opacity: 0;
}

.stagger-children.animated > *:nth-child(1) {
  animation: slideUp 0.4s ease forwards;
  animation-delay: 0.1s;
}

.stagger-children.animated > *:nth-child(2) {
  animation: slideUp 0.4s ease forwards;
  animation-delay: 0.2s;
}

.stagger-children.animated > *:nth-child(3) {
  animation: slideUp 0.4s ease forwards;
  animation-delay: 0.3s;
}

.stagger-children.animated > *:nth-child(4) {
  animation: slideUp 0.4s ease forwards;
  animation-delay: 0.4s;
}

.stagger-children.animated > *:nth-child(5) {
  animation: slideUp 0.4s ease forwards;
  animation-delay: 0.5s;
}

.stagger-children.animated > *:nth-child(6) {
  animation: slideUp 0.4s ease forwards;
  animation-delay: 0.6s;
}

/* ----- Element-specific animations ----- */

/* Hero animations */
.hero-content {
  animation: fadeIn 1s ease forwards;
}

.hero-badge {
  animation: slideDown 0.6s ease forwards;
  animation-delay: 0.2s;
  opacity: 0;
  animation-fill-mode: forwards;
}

.hero-title {
  animation: slideUp 0.6s ease forwards;
  animation-delay: 0.4s;
  opacity: 0;
  animation-fill-mode: forwards;
}

.hero-description {
  animation: slideUp 0.6s ease forwards;
  animation-delay: 0.6s;
  opacity: 0;
  animation-fill-mode: forwards;
}

.hero-actions {
  animation: slideUp 0.6s ease forwards;
  animation-delay: 0.8s;
  opacity: 0;
  animation-fill-mode: forwards;
}

.hero-stats {
  animation: slideUp 0.6s ease forwards;
  animation-delay: 1s;
  opacity: 0;
  animation-fill-mode: forwards;
}

/* Service card hover effects */
.service-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 
              0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Expertise card hover effects */
.expertise-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.expertise-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 
              0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Button hover animations */
.btn {
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.btn::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 150%;
  height: 150%;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.5s ease;
  z-index: 0;
  pointer-events: none;
}

.btn:hover::after {
  transform: translate(-50%, -50%) scale(1);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transition: left 0.7s ease;
  z-index: 0;
}

.btn-primary:hover::before {
  left: 100%;
}

/* Mobile nav toggle animation */
.nav-toggle.active .nav-toggle-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle.active .nav-toggle-line:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active .nav-toggle-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Loading animations */
.loading-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: rotate 1s linear infinite;
}

.form-success svg {
  animation: scaleUp 0.5s ease forwards;
}

/* Logo Animation and Highlight */
.nav-logo {
  position: relative;
  filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.2));
  animation: logoPulse 5s infinite ease-in-out;
}

@keyframes logoPulse {
  0%, 100% {
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.2));
  }
  50% {
    filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.3));
  }
}

.footer-logo {
  filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.2));
}
