/**
 * WebTheme.shop - Premium Animation System
 * Version: 1.0.0
 * 60fps GPU-Accelerated | Mobile-First | Accessibility Friendly
 */

/* ============================================
   0. REDUCED MOTION - Accessibility
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .wt-scroll-reveal,
  .wt-stagger-item,
  .wt-hero-item {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}

/* ============================================
   1. SCROLL REVEAL - Disabled for Performance
   ============================================ */

html.wt-js-ready .wt-scroll-reveal {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
  transition: none !important;
}

.wt-scroll-reveal.wt-visible {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}

/* ============================================
   2. STAGGER ANIMATION - Disabled for Performance
   ============================================ */

html.wt-js-ready .wt-stagger-item {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

.wt-stagger-item.wt-visible {
  opacity: 1 !important;
  transform: none !important;
}

.wt-stagger-item:nth-child(n) { transition-delay: 0ms !important; }

/* ============================================
   3. HERO SECTION - Instant Render
   ============================================ */

html.wt-js-ready .wt-hero-item {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
  transition: none !important;
}

.wt-hero-item.wt-hero-visible {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}

.wt-hero-item:nth-child(n) { transition-delay: 0ms !important; }

/* Hero Background Shapes */
.wt-hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.wt-hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.15;
  animation: none !important;
}

.wt-hero-blob:nth-child(1) {
  width: 400px;
  height: 400px;
  background: var(--mts-primary);
  top: -10%;
  left: -5%;
  animation-delay: 0s;
}

.wt-hero-blob:nth-child(2) {
  width: 300px;
  height: 300px;
  background: #a29bfe;
  top: 50%;
  right: -8%;
  animation-delay: -7s;
}

.wt-hero-blob:nth-child(3) {
  width: 250px;
  height: 250px;
  background: #74b9ff;
  bottom: -5%;
  left: 30%;
  animation-delay: -14s;
}

@keyframes wt-blob-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -20px) scale(1.05); }
  50% { transform: translate(-20px, 30px) scale(0.95); }
  75% { transform: translate(20px, 20px) scale(1.02); }
}

/* ============================================
   4. HEADER - Scroll Effects
   ============================================ */
.main-header {
  transition: background 0.3s ease,
              box-shadow 0.3s ease,
              backdrop-filter 0.3s ease,
              -webkit-backdrop-filter 0.3s ease;
  will-change: background, box-shadow;
}

.main-header.wt-scrolled {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  box-shadow: 0 4px 30px rgba(108, 92, 231, 0.1),
              0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

/* Navigation active indicator slide */
.main-navigation a {
  position: relative;
  transition: color 0.2s ease;
}

.main-navigation a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--mts-gradient);
  border-radius: 1px;
  transform: translateX(-50%);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.main-navigation a:hover::after,
.main-navigation li.current-menu-item a::after {
  width: 100%;
}

/* ============================================
   5. SEARCH BOX - Focus Effects
   ============================================ */
.products-search-form {
  position: relative;
  transition: box-shadow 0.4s ease,
              transform 0.3s ease;
}

.products-search-form:focus-within {
  box-shadow: 0 8px 40px rgba(108, 92, 231, 0.2),
              0 0 0 3px rgba(108, 92, 231, 0.1);
  transform: translateY(-2px);
}

.products-search-form input {
  transition: border-color 0.3s ease,
              box-shadow 0.3s ease;
}

.products-search-form input:focus {
  border-color: var(--mts-primary);
  box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.1);
}

/* Search icon animation */
.products-search-form button span {
  display: inline-block;
  transition: transform 0.3s ease;
}

.products-search-form:focus-within button span {
  transform: scale(1.2);
}

/* ============================================
   6. BUTTONS - Hover & Click Effects
   ============================================ */
.button,
.wt-btn,
.woocommerce-button,
.wt-buy-btn-primary,
.wt-offer-cta,
.wt-exit-join-btn,
.wt-wa-chat-btn,
.try-themes-button {
  position: relative;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.25s ease;
  will-change: transform;
}

/* Hover scale + shadow */
.button:hover,
.wt-btn:hover,
.woocommerce-button:hover,
.try-themes-button:hover {
  transform: translateY(-2px) scale(1.02) translateZ(0);
  box-shadow: 0 8px 25px rgba(108, 92, 231, 0.3);
}

/* Active click */
.button:active,
.wt-btn:active,
.woocommerce-button:active,
.try-themes-button:active {
  transform: translateY(0) scale(0.98) translateZ(0);
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.2);
}

/* Ripple effect */
.button::after,
.try-themes-button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255, 255, 255, 0.3) 0%, transparent 60%);
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.5s, transform 0.5s;
  pointer-events: none;
}

.button.ripple::after,
.try-themes-button.ripple::after {
  opacity: 1;
  transform: scale(2.5);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Gradient shimmer on hover */
.button.yellow {
  background-size: 200% 100%;
  transition: background-position 0.4s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.button.yellow:hover {
  background-position: 100% 0;
}

/* ============================================
   7. PRODUCT CARDS - Hover Effects
   ============================================ */
.product-archive-item {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s ease;
  will-change: transform;
}

.product-archive-item:hover {
  transform: translateY(-10px) translateZ(0);
  box-shadow: 0 20px 60px rgba(108, 92, 231, 0.15),
              0 8px 20px rgba(0, 0, 0, 0.06);
}

/* Image zoom */
.featured-thumbnail img {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.product-archive-item:hover .featured-thumbnail img {
  transform: scale(1.08);
}

/* Border glow on hover */
.product-archive-item::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: var(--mts-gradient);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.product-archive-item:hover::before {
  opacity: 0.15;
}

/* SALE badge bounce */
.sale-badge {
  animation: wt-badge-pulse 2s ease-in-out infinite;
}

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

/* Links slide up from bottom */
.links-wrap {
  transform: translateY(10px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.product-archive-item:hover .links-wrap {
  transform: translateY(0);
  opacity: 1;
}

/* ============================================
   8. CATEGORY BOXES - Hover Effects
   ============================================ */
.featured-cat-item {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s ease;
  will-change: transform;
  overflow: hidden;
}

.featured-cat-item:hover {
  transform: translateY(-8px) scale(1.02) translateZ(0);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

/* Gradient shift on hover */
.featured-cat-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.featured-cat-item:hover::before {
  opacity: 1;
}

/* Icon float */
.featured-cat-icon {
  transition: transform 0.4s ease;
}

.featured-cat-item:hover .featured-cat-icon {
  transform: translateY(-5px) scale(1.1);
}

/* ============================================
   9. FEATURE ICONS - Float & Pulse
   ============================================ */
.feature-box-icon {
  transition: transform 0.4s ease;
}

.feature-box:hover .feature-box-icon {
  transform: translateY(-5px) rotate(5deg);
}

/* Background pulse */
.feature-box-icon svg,
.feature-box-icon {
  animation: wt-icon-float 4s ease-in-out infinite;
}

.feature-box:nth-child(2) .feature-box-icon { animation-delay: -1s; }
.feature-box:nth-child(3) .feature-box-icon { animation-delay: -2s; }
.feature-box:nth-child(4) .feature-box-icon { animation-delay: -3s; }

@keyframes wt-icon-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ============================================
   10. DARK CTA SECTION - Reveal
   ============================================ */
#benefits .benefits-inner {
  position: relative;
}

#benefits .benefits-inner::before {
  content: '';
  position: absolute;
  inset: -20px;
  background: radial-gradient(ellipse at center, rgba(108, 92, 231, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}

#benefits .benefits-inner.wt-visible::before {
  opacity: 1;
}

/* Button pulse */
#benefits .button.yellow {
  animation: wt-btn-glow 3s ease-in-out infinite;
}

@keyframes wt-btn-glow {
  0%, 100% { box-shadow: 0 4px 15px rgba(108, 92, 231, 0.2); }
  50% { box-shadow: 0 4px 30px rgba(108, 92, 231, 0.4); }
}

/* ============================================
   11. TESTIMONIALS - Reveal & Slider
   ============================================ */
.testimonial-slide {
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.testimonial-slide.active {
  opacity: 1;
  transform: scale(1);
}

/* Controls */
.testimonial-arrow {
  transition: transform 0.2s ease, background 0.2s ease;
}

.testimonial-arrow:hover {
  transform: scale(1.1);
}

.testimonial-arrow:active {
  transform: scale(0.95);
}

/* Dots */
.testimonial-dot {
  transition: width 0.3s ease, background 0.3s ease;
}

.testimonial-dot.active {
  width: 24px;
  background: var(--mts-primary);
}

/* ============================================
   12. FOOTER - Reveal
   ============================================ */
.main-footer {
  position: relative;
}

.footer-grid {
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.main-footer.wt-visible .footer-grid {
  opacity: 1;
  transform: translateY(0);
}

/* Social icons hover */
.footer-connect a {
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.footer-connect a:hover {
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

/* ============================================
   13. MICRO INTERACTIONS
   ============================================ */

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 80px;
  right: 24px;
  width: 42px;
  height: 42px;
  background: var(--mts-dark);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 998;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.back-to-top:hover {
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 8px 30px rgba(108, 92, 231, 0.4);
}

.back-to-top:active {
  transform: translateY(0) scale(0.95);
}

/* Image lazy load fade */
.wt-lazy-img {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.wt-lazy-img.loaded {
  opacity: 1;
}

/* ============================================
   14. WHATSAPP FLOAT - Bounce
   ============================================ */
.wt-wa-float {
  animation: wt-wa-bounce 2s ease-in-out infinite;
}

@keyframes wt-wa-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.wt-wa-float:hover {
  animation: none;
  transform: scale(1.1);
}

/* ============================================
   15. OFFER POPUP - Entrance
   ============================================ */
.wt-offer-overlay.active .wt-offer-popup {
  animation: wt-popup-enter 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes wt-popup-enter {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Timer countdown pulse */
.wt-timer-item span {
  transition: transform 0.2s ease;
}

/* ============================================
   17. MOBILE - Touch Optimized
   ============================================ */
@media (max-width: 768px) {
  .product-archive-item:active {
    transform: scale(0.98);
  }

  .featured-cat-item:active {
    transform: scale(0.97);
  }

  .button:active {
    transform: scale(0.96);
  }

  /* Disable hover effects on touch */
  .product-archive-item:hover {
    transform: none;
    box-shadow: none;
  }

  .featured-cat-item:hover {
    transform: none;
    box-shadow: none;
  }
}

/* ============================================
   18. SMOOTH SCROLL
   ============================================ */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
