/* ==========================================
   KEYFRAME ANIMATIONS
   ========================================== */

/* Floating animation for hero image */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-15px);
  }
}

/* Bounce animation for scroll indicator */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}

/* Fade in from bottom animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Gradient animation (optional subtle background effect) */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Pulse animation for emphasis */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

/* ==========================================
   HERO SECTION ANIMATIONS
   ========================================== */

/* Apply floating animation to hero image */
.hero-image {
  animation: float 6s ease-in-out infinite;
}

.hero-image:hover {
  animation-play-state: paused;
  transform: scale(1.05);
}

/* Scroll indicator bounce */
.scroll-indicator {
  animation: bounce 1.5s ease-in-out infinite;
}

/* ==========================================
   APP CARD ANIMATIONS
   ========================================== */

/* 3D Hover Effect for App Cards */
.app-card:hover {
  transform: translateY(-12px) translateZ(20px);
  box-shadow:
    0 25px 50px -12px rgba(139, 92, 246, 0.3),
    0 15px 30px -10px rgba(139, 92, 246, 0.15);
}

/* 3D Icon Animation on Card Hover */
.app-card:hover .app-icon {
  transform: scale(1.15) rotateY(8deg) rotateX(-5deg);
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.2));
}

/* Fade In Animation for Cards (triggered by JavaScript) */
.app-card.fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

/* Initially hide cards before fade-in */
.app-card {
  opacity: 0;
  transform: translateY(30px);
}

.app-card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation delays for each card */
.app-card:nth-child(1) {
  animation-delay: 0.1s;
}

.app-card:nth-child(2) {
  animation-delay: 0.2s;
}

.app-card:nth-child(3) {
  animation-delay: 0.3s;
}

.app-card:nth-child(4) {
  animation-delay: 0.4s;
}

.app-card:nth-child(5) {
  animation-delay: 0.5s;
}

/* ==========================================
   BUTTON ANIMATIONS
   ========================================== */

/* Enhanced button hover effect */
.download-btn:hover {
  animation: pulse 2s ease-in-out infinite;
}

/* ==========================================
   SOCIAL BUTTON ANIMATIONS
   ========================================== */

/* Individual social button hover effects */
.social-btn:hover {
  transform: scale(1.2) rotate(8deg);
}

.social-btn:active {
  transform: scale(1.05) rotate(0deg);
}

/* Specific animations for each social platform */
.social-btn.youtube:hover {
  box-shadow:
    0 15px 35px -5px rgba(255, 0, 0, 0.4),
    0 8px 12px -4px rgba(255, 0, 0, 0.2);
}

.social-btn.instagram:hover {
  box-shadow:
    0 15px 35px -5px rgba(245, 133, 41, 0.4),
    0 8px 12px -4px rgba(221, 42, 123, 0.2);
}

.social-btn.twitter:hover {
  box-shadow:
    0 15px 35px -5px rgba(29, 161, 242, 0.4),
    0 8px 12px -4px rgba(29, 161, 242, 0.2);
}

/* ==========================================
   SECTION ANIMATIONS
   ========================================== */

/* Fade in section titles */
.section-title {
  animation: fadeInUp 0.8s ease-out;
}

/* ==========================================
   ADVANCED 3D EFFECTS
   ========================================== */

/* Perspective for 3D transforms */
.apps-grid {
  perspective: 1000px;
  perspective-origin: center center;
}

/* Card tilt effect - enhanced by JavaScript */
.app-card.tilt {
  transition: transform 0.1s ease-out;
}

/* Smooth transition when mouse leaves */
.app-card {
  transition:
    transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1),
    box-shadow 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* ==========================================
   PERFORMANCE OPTIMIZATIONS
   ========================================== */

/* Will-change for elements that animate frequently */
.hero-image,
.app-card,
.app-icon,
.download-btn,
.social-btn {
  will-change: transform;
}

/* Remove will-change after animation completes to save resources */
.app-card.animation-complete {
  will-change: auto;
}

/* ==========================================
   LOADING STATES
   ========================================== */

/* Skeleton loading animation (optional) */
@keyframes skeleton {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 0px, #f8f8f8 40px, #f0f0f0 80px);
  background-size: 200px 100%;
  animation: skeleton 1.5s infinite;
}

/* ==========================================
   REDUCED MOTION
   ========================================== */

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero-image {
    animation: none;
  }

  .scroll-indicator {
    animation: none;
  }

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

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

/* ==========================================
   SPECIAL EFFECTS
   ========================================== */

/* Gradient text animation for brand name */
.brand-name {
  background-size: 200% auto;
  animation: gradientShift 4s ease infinite;
}

/* Subtle glow effect on hover */
.app-card:hover::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 2rem;
  padding: 2px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(236, 72, 153, 0.3));
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.app-card:hover::before {
  opacity: 1;
}

/* Shine effect on cards */
.app-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transform: rotate(45deg) translateX(-100%);
  transition: transform 0.6s ease;
}

.app-card:hover::after {
  transform: rotate(45deg) translateX(100%);
}

/* ==========================================
   ENTRANCE ANIMATIONS
   ========================================== */

/* Initial page load animations */
@keyframes heroEntrance {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.hero-content {
  animation: heroEntrance 1s ease-out;
}

/* Text reveal animation */
@keyframes textReveal {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.brand-name {
  animation: textReveal 0.8s ease-out 0.3s both;
}

.tagline {
  animation: textReveal 0.8s ease-out 0.5s both;
}

.scroll-indicator {
  animation: bounce 1.5s ease-in-out infinite, textReveal 0.8s ease-out 0.7s both;
}
