/* ==========================================================================
   ZenClips Cinematic Smooth Animations
   - Inspired by Apple, Linear, and Stripe design systems
   - Easing: Apple Spring / Ease-Out-Expo: cubic-bezier(0.16, 1, 0.3, 1)
   - Staggered cascade delays for cards, hero content, and sections
   - 60fps / 120fps GPU-Accelerated (transform3d & opacity only)
   - Zero layout shifts, 100% reliable content visibility
   ========================================================================== */

/* 1. Global Header Entrance: Top to Down Animation */
@keyframes headerSlideDown {
  0% {
    opacity: 0;
    transform: translate3d(-50%, -40px, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(-50%, 0, 0);
  }
}

@keyframes headerSlideDownMobile {
  0% {
    opacity: 0;
    transform: translate3d(-50%, -24px, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(-50%, 0, 0);
  }
}

header,
#global-header {
  animation: headerSlideDown 0.75s cubic-bezier(0.16, 1, 0.3, 1) both !important;
  will-change: transform, opacity;
}

@media (max-width: 768px) {
  header,
  #global-header {
    animation: headerSlideDownMobile 0.7s cubic-bezier(0.16, 1, 0.3, 1) both !important;
  }
}

/* 2. Core Cinematic Easing Keyframes */
@keyframes zenFadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes zenFadeUp {
  0% {
    opacity: 0;
    transform: translate3d(0, 26px, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes zenFadeDown {
  0% {
    opacity: 0;
    transform: translate3d(0, -22px, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes zenScaleUp {
  0% {
    opacity: 0;
    transform: scale3d(0.94, 0.94, 1) translate3d(0, 16px, 0);
  }
  100% {
    opacity: 1;
    transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
  }
}

/* 3. Hero & Page Header Cascade (Staggered Cinematic Delays) */
.carousel-slide.active .hero-badge,
.hero-badge {
  animation: zenFadeDown 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}

.carousel-slide.active .hero-title,
.hero-title {
  animation: zenFadeUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
}

.carousel-slide.active .hero-description,
.hero-description {
  animation: zenFadeUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}

.carousel-slide.active .hero-actions,
.hero-actions {
  animation: zenFadeUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.55s both;
}

/* Page Headers (Category, Profile, Legal, CapCut) */
.category-header,
.profile-header,
.legal-header,
.app-header {
  animation: zenFadeDown 0.75s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.download-container,
.download-card,
.clip-player-wrapper {
  animation: zenScaleUp 0.75s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}

/* 4. Section & Cards: Always Visible, Smooth Staggered Cascades */
.category-section {
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
}

.section-header {
  animation: zenFadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

/* Clip Cards Entrance Cascade */
.clip-card,
.category-card,
.template-card,
.stat-card {
  animation: zenFadeUp 0.75s cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: transform, opacity;
}

/* Stagger delays for grid items */
.clips-grid > *:nth-child(1), .categories-grid > *:nth-child(1), .templates-grid > *:nth-child(1), .stats-container > *:nth-child(1) { animation-delay: 0.06s; }
.clips-grid > *:nth-child(2), .categories-grid > *:nth-child(2), .templates-grid > *:nth-child(2), .stats-container > *:nth-child(2) { animation-delay: 0.12s; }
.clips-grid > *:nth-child(3), .categories-grid > *:nth-child(3), .templates-grid > *:nth-child(3), .stats-container > *:nth-child(3) { animation-delay: 0.18s; }
.clips-grid > *:nth-child(4), .categories-grid > *:nth-child(4), .templates-grid > *:nth-child(4), .stats-container > *:nth-child(4) { animation-delay: 0.24s; }
.clips-grid > *:nth-child(5), .categories-grid > *:nth-child(5), .templates-grid > *:nth-child(5), .stats-container > *:nth-child(5) { animation-delay: 0.30s; }
.clips-grid > *:nth-child(6), .categories-grid > *:nth-child(6), .templates-grid > *:nth-child(6), .stats-container > *:nth-child(6) { animation-delay: 0.36s; }
.clips-grid > *:nth-child(7), .categories-grid > *:nth-child(7), .templates-grid > *:nth-child(7), .stats-container > *:nth-child(7) { animation-delay: 0.42s; }
.clips-grid > *:nth-child(8), .categories-grid > *:nth-child(8), .templates-grid > *:nth-child(8), .stats-container > *:nth-child(8) { animation-delay: 0.48s; }
.clips-grid > *:nth-child(9), .categories-grid > *:nth-child(9), .templates-grid > *:nth-child(9) { animation-delay: 0.54s; }
.clips-grid > *:nth-child(10), .categories-grid > *:nth-child(10), .templates-grid > *:nth-child(10) { animation-delay: 0.60s; }
.clips-grid > *:nth-child(11), .categories-grid > *:nth-child(11), .templates-grid > *:nth-child(11) { animation-delay: 0.66s; }
.clips-grid > *:nth-child(12), .categories-grid > *:nth-child(12), .templates-grid > *:nth-child(12) { animation-delay: 0.72s; }
.clips-grid > *:nth-child(n+13), .categories-grid > *:nth-child(n+13) { animation-delay: 0.78s; }

/* 5. Luxurious Card Hover Interactions */
.clip-card,
.category-card,
.template-card,
.stat-card,
.discord-card,
.trust-item,
.faq-item {
  transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.42s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.42s ease,
              background 0.42s ease !important;
}

.clip-card:hover,
.category-card:hover,
.template-card:hover {
  transform: translate3d(0, -8px, 0) scale3d(1.01, 1.01, 1) !important;
  box-shadow: 0 20px 40px -8px rgba(255, 42, 133, 0.35), 0 8px 16px rgba(0, 0, 0, 0.6) !important;
  border-color: rgba(255, 42, 133, 0.5) !important;
}

/* Card Image Scale on Hover */
.clip-thumbnail img,
.template-thumbnail img,
.category-card img {
  transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.clip-card:hover .clip-thumbnail img,
.template-card:hover .template-thumbnail img,
.category-card:hover img {
  transform: scale3d(1.06, 1.06, 1) !important;
}

/* 6. Buttons & Interactive Controls (Smooth elevation & tactile response) */
.btn,
.btn-download,
.btn-outline,
.view-all,
.download-btn,
.filter-btn,
.subcategory-btn {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.35s ease,
              border-color 0.35s ease,
              color 0.35s ease !important;
}

.btn:hover,
.btn-download:hover,
.download-btn:hover {
  transform: translate3d(0, -3px, 0) !important;
  box-shadow: 0 12px 30px rgba(255, 42, 133, 0.45) !important;
}

.btn:active,
.btn-download:active,
.download-btn:active {
  transform: translate3d(0, -1px, 0) scale3d(0.97, 0.97, 1) !important;
  transition-duration: 0.15s !important;
}

.view-all:hover {
  transform: translate3d(6px, 0, 0) !important;
}

/* Tag Pills Micro-Interactions */
.tag1,
.clip-tag,
.tag {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.3s ease,
              border-color 0.3s ease,
              box-shadow 0.3s ease,
              color 0.3s ease !important;
}

.tag1:hover,
.clip-tag:hover,
.tag:hover {
  transform: translate3d(0, -3px, 0) !important;
  box-shadow: 0 6px 18px rgba(255, 42, 133, 0.3) !important;
}

/* Discord Card Lift */
.discord-card:hover {
  transform: translate3d(0, -4px, 0) !important;
  box-shadow: 0 16px 40px rgba(88, 101, 242, 0.25) !important;
  border-color: rgba(88, 101, 242, 0.4) !important;
}

/* 7. Accessibility: Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
