﻿/* ==========================================================================
   CANADACORP — ANIMATIONS & MICRO-INTERACTIONS
   css/animations.css
   ========================================================================== */

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

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

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

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

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(197, 155, 39, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(197, 155, 39, 0);
  }
}

@keyframes lineDraw {
  from { width: 0; }
  to { width: 100%; }
}

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

/* --------------------------------------------------------------------------
   2. SCROLL REVEAL UTILITY CLASSES (IntersectionObserver Target)
   -------------------------------------------------------------------------- */
[data-anim] {
  opacity: 0;
  will-change: transform, opacity;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-anim="fade-up"] {
  transform: translateY(32px);
}

[data-anim="fade-down"] {
  transform: translateY(-24px);
}

[data-anim="fade-left"] {
  transform: translateX(40px);
}

[data-anim="fade-right"] {
  transform: translateX(-40px);
}

[data-anim="scale"] {
  transform: scale(0.92);
}

/* When In View */
[data-anim].in-view {
  opacity: 1;
  transform: translate(0) scale(1);
}

/* Stagger Children */
[data-stagger] > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-stagger].in-view > *:nth-child(1) { transition-delay: 0.05s; opacity: 1; transform: translateY(0); }
[data-stagger].in-view > *:nth-child(2) { transition-delay: 0.12s; opacity: 1; transform: translateY(0); }
[data-stagger].in-view > *:nth-child(3) { transition-delay: 0.19s; opacity: 1; transform: translateY(0); }
[data-stagger].in-view > *:nth-child(4) { transition-delay: 0.26s; opacity: 1; transform: translateY(0); }
[data-stagger].in-view > *:nth-child(5) { transition-delay: 0.33s; opacity: 1; transform: translateY(0); }
[data-stagger].in-view > *:nth-child(6) { transition-delay: 0.40s; opacity: 1; transform: translateY(0); }
[data-stagger].in-view > *:nth-child(7) { transition-delay: 0.47s; opacity: 1; transform: translateY(0); }
[data-stagger].in-view > *:nth-child(8) { transition-delay: 0.54s; opacity: 1; transform: translateY(0); }

/* --------------------------------------------------------------------------
   3. HOVER & INTERACTION MICRO-ANIMATIONS
   -------------------------------------------------------------------------- */
.hover-lift {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.hover-lift:hover {
  transform: translateY(-6px);
}

.img-zoom-container {
  overflow: hidden;
}
.img-zoom-container img {
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.img-zoom-container:hover img {
  transform: scale(1.05);
}

/* Floating Badges */
.float-animation {
  animation: floatSoft 4s ease-in-out infinite;
}

/* Pulse Dot */
.pulse-dot {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: var(--accent-gold);
  border-radius: 50%;
}
.pulse-dot::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid var(--accent-gold);
  animation: pulseGlow 2s infinite;
}

/* --------------------------------------------------------------------------
   4. REDUCED MOTION PREFERENCE
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

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