/**
 * Luxury Animations System - WangiWorld
 * ======================================
 * Premium micro-interactions and scroll animations
 * Following black & white luxury design philosophy
 */

/* =====================================================
   1. ICON MICRO-INTERACTIONS
   ===================================================== */

/* Base icon transition */
.icon-interactive {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.2s ease;
}

/* Hover: Scale up with gentle bounce */
.icon-interactive:hover {
  transform: scale(1.1);
}

/* Active: Press down effect */
.icon-interactive:active {
  transform: scale(0.95);
}

/* Search Icon - Expand animation */
.icon-search {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.icon-search:hover {
  transform: scale(1.15) rotate(-5deg);
}

/* Cart Icon - Bounce animation */
.icon-cart {
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.icon-cart:hover {
  transform: translateY(-2px) scale(1.1);
}

.icon-cart:active {
  transform: translateY(0) scale(0.95);
}

/* Cart badge bounce on update */
@keyframes cart-badge-bounce {
  0%, 100% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.3);
  }
  50% {
    transform: scale(0.9);
  }
  75% {
    transform: scale(1.1);
  }
}

.cart-badge-animate {
  animation: cart-badge-bounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Wishlist Heart Icon - Pulse animation */
.icon-wishlist {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              color 0.2s ease;
}

.icon-wishlist:hover {
  transform: scale(1.2);
}

.icon-wishlist.active {
  color: #000 !important;
}

@keyframes heart-pulse {
  0% {
    transform: scale(1);
  }
  15% {
    transform: scale(1.3);
  }
  30% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.2);
  }
  60% {
    transform: scale(1);
  }
}

.icon-wishlist-pulse {
  animation: heart-pulse 0.6s ease-in-out;
}

/* Menu Icon - Hamburger to X transformation */
.icon-menu {
  transition: transform 0.3s ease;
}

.icon-menu:hover {
  transform: scale(1.1);
}

.icon-menu.is-open {
  transform: rotate(180deg);
}

/* User/Account Icon - Subtle rotate */
.icon-user {
  transition: transform 0.3s ease;
}

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

/* Share Icons - Pop effect */
.icon-share {
  transition: transform 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55),
              opacity 0.15s ease;
}

.icon-share:hover {
  transform: scale(1.2);
}

.icon-share:active {
  transform: scale(0.9);
}

/* Arrow Icons - Slide animation */
.icon-arrow {
  transition: transform 0.3s ease;
}

.icon-arrow-right:hover {
  transform: translateX(4px);
}

.icon-arrow-left:hover {
  transform: translateX(-4px);
}

.icon-arrow-down:hover {
  transform: translateY(4px);
}

.icon-arrow-up:hover {
  transform: translateY(-4px);
}


/* =====================================================
   2. SCROLL REVEAL ANIMATIONS
   ===================================================== */

/* Base scroll animation class */
[data-scroll-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.1, 0.25, 1),
              transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

[data-scroll-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children animation */
[data-scroll-reveal-stagger] > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease,
              transform 0.6s ease;
}

[data-scroll-reveal-stagger].is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

[data-scroll-reveal-stagger].is-visible > *:nth-child(1) { transition-delay: 0ms; }
[data-scroll-reveal-stagger].is-visible > *:nth-child(2) { transition-delay: 80ms; }
[data-scroll-reveal-stagger].is-visible > *:nth-child(3) { transition-delay: 160ms; }
[data-scroll-reveal-stagger].is-visible > *:nth-child(4) { transition-delay: 240ms; }
[data-scroll-reveal-stagger].is-visible > *:nth-child(5) { transition-delay: 320ms; }
[data-scroll-reveal-stagger].is-visible > *:nth-child(6) { transition-delay: 400ms; }
[data-scroll-reveal-stagger].is-visible > *:nth-child(7) { transition-delay: 480ms; }
[data-scroll-reveal-stagger].is-visible > *:nth-child(8) { transition-delay: 560ms; }

/* Fade variations */
[data-scroll-reveal="fade-up"] {
  opacity: 0;
  transform: translateY(40px);
}

[data-scroll-reveal="fade-down"] {
  opacity: 0;
  transform: translateY(-40px);
}

[data-scroll-reveal="fade-left"] {
  opacity: 0;
  transform: translateX(-40px);
}

[data-scroll-reveal="fade-right"] {
  opacity: 0;
  transform: translateX(40px);
}

[data-scroll-reveal="fade-scale"] {
  opacity: 0;
  transform: scale(0.95);
}

[data-scroll-reveal].is-visible {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

/* Section header animation */
.luxury-section-header[data-scroll-reveal] .luxury-section-label {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.luxury-section-header[data-scroll-reveal] .luxury-section-title {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease 0.1s, transform 0.6s ease 0.1s;
}

.luxury-section-header[data-scroll-reveal] .luxury-section-subtitle {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.5s ease 0.2s, transform 0.5s ease 0.2s;
}

.luxury-section-header[data-scroll-reveal].is-visible .luxury-section-label,
.luxury-section-header[data-scroll-reveal].is-visible .luxury-section-title,
.luxury-section-header[data-scroll-reveal].is-visible .luxury-section-subtitle {
  opacity: 1;
  transform: translateY(0);
}


/* =====================================================
   3. BUTTON ANIMATIONS
   ===================================================== */

/* Luxury button hover effect */
.btn-luxury {
  position: relative;
  overflow: hidden;
  transition: color 0.3s ease, transform 0.2s ease;
}

.btn-luxury::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.5s ease;
}

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

.btn-luxury:active {
  transform: scale(0.98);
}

/* Add to cart button animation */
.btn-add-to-cart {
  position: relative;
  overflow: hidden;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-add-to-cart:hover {
  transform: translateY(-1px);
}

.btn-add-to-cart:active {
  transform: translateY(0) scale(0.98);
}

/* Success state for add to cart */
@keyframes checkmark-draw {
  0% {
    stroke-dashoffset: 50;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.btn-add-to-cart.success .checkmark-icon {
  stroke-dasharray: 50;
  animation: checkmark-draw 0.4s ease forwards;
}


/* =====================================================
   4. IMAGE ANIMATIONS
   ===================================================== */

/* Product image hover zoom */
.img-zoom-container {
  overflow: hidden;
}

.img-zoom-container img {
  transition: transform 0.7s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.img-zoom-container:hover img {
  transform: scale(1.05);
}

/* Parallax effect for hero images */
.img-parallax {
  will-change: transform;
  transition: transform 0.1s linear;
}

/* Skeleton loading shimmer */
@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton-loading {
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e0e0e0 50%,
    #f0f0f0 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
}


/* =====================================================
   5. NAVIGATION ANIMATIONS
   ===================================================== */

/* Mobile menu slide in */
@keyframes slide-in-right {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slide-out-right {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.drawer-enter {
  animation: slide-in-right 0.3s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

.drawer-exit {
  animation: slide-out-right 0.3s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

/* Dropdown menu animation */
@keyframes dropdown-fade-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-menu-enter {
  animation: dropdown-fade-in 0.2s ease forwards;
}

/* Nav link underline animation */
.nav-link-animated {
  position: relative;
}

.nav-link-animated::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: currentColor;
  transition: width 0.3s ease;
}

.nav-link-animated:hover::after {
  width: 100%;
}


/* =====================================================
   6. CARD ANIMATIONS
   ===================================================== */

/* Product card hover lift */
.card-hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Brand card reveal */
.brand-card {
  opacity: 0.4;
  filter: grayscale(100%);
  transition: opacity 0.4s ease, filter 0.4s ease, transform 0.3s ease;
}

.brand-card:hover {
  opacity: 1;
  filter: grayscale(0%);
  transform: scale(1.02);
}


/* =====================================================
   7. REDUCED MOTION SUPPORT
   ===================================================== */

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

  [data-scroll-reveal],
  [data-scroll-reveal-stagger] > * {
    opacity: 1 !important;
    transform: none !important;
  }
}


/* =====================================================
   8. LOADING STATES
   ===================================================== */

/* Spinner animation */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  animation: spin 0.8s linear infinite;
}

/* Pulse animation */
@keyframes pulse-soft {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.pulse-loading {
  animation: pulse-soft 1.5s ease-in-out infinite;
}

/* Bounce loading dots */
@keyframes bounce-loading {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

.bounce-dot {
  animation: bounce-loading 1.4s ease-in-out infinite both;
}

.bounce-dot:nth-child(1) { animation-delay: -0.32s; }
.bounce-dot:nth-child(2) { animation-delay: -0.16s; }
.bounce-dot:nth-child(3) { animation-delay: 0; }
