/* =====================================================
   MOORE'S DOORS AND TRIM - ANIMATIONS
   ===================================================== */

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

/* Fade In Up - Primary entrance animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Down */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Left */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade In Right */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade In - Simple opacity */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Scale In */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Slide In Bottom */
@keyframes slideInBottom {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* Pulse - Subtle attention */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Bounce - Button hover effect */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* Float - Subtle floating effect */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Shimmer - Loading effect */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* =====================================================
   HERO ANIMATIONS (Page Load)
   ===================================================== */
.hero-badge {
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.hero-title {
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

.hero-subtitle {
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.hero-cta {
  animation: fadeInUp 0.6s ease-out 0.4s both;
}

.hero-trust {
  animation: fadeInUp 0.6s ease-out 0.5s both;
}

/* =====================================================
   SCROLL ANIMATIONS (Intersection Observer)
   ===================================================== */

/* Base state for animated elements */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* Fade variants */
.animate-fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-fade-up.animated {
  opacity: 1;
  transform: translateY(0);
}

.animate-fade-down {
  opacity: 0;
  transform: translateY(-30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-fade-down.animated {
  opacity: 1;
  transform: translateY(0);
}

.animate-fade-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-fade-left.animated {
  opacity: 1;
  transform: translateX(0);
}

.animate-fade-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-fade-right.animated {
  opacity: 1;
  transform: translateX(0);
}

.animate-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-scale.animated {
  opacity: 1;
  transform: scale(1);
}

/* =====================================================
   STAGGER ANIMATIONS (Cards, Grid Items)
   ===================================================== */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.stagger-children.animated > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.animated > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.animated > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-children.animated > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-children.animated > *:nth-child(5) { transition-delay: 0.25s; }
.stagger-children.animated > *:nth-child(6) { transition-delay: 0.3s; }
.stagger-children.animated > *:nth-child(7) { transition-delay: 0.35s; }
.stagger-children.animated > *:nth-child(8) { transition-delay: 0.4s; }

.stagger-children.animated > * {
  opacity: 1;
  transform: translateY(0);
}

/* =====================================================
   HOVER ANIMATIONS
   ===================================================== */

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

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

/* Image zoom on hover */
.hover-zoom {
  overflow: hidden;
}

.hover-zoom img {
  transition: transform 0.5s ease;
}

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

/* Icon rotate on hover */
.hover-rotate-icon:hover svg {
  transform: rotate(15deg);
  transition: transform 0.3s ease;
}

/* Link underline grow */
.hover-underline {
  position: relative;
}

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

.hover-underline:hover::after {
  width: 100%;
}

/* Arrow slide on hover */
.hover-arrow-slide {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.hover-arrow-slide svg {
  transition: transform 0.3s ease;
}

.hover-arrow-slide:hover svg {
  transform: translateX(4px);
}

/* =====================================================
   LOADING STATES
   ===================================================== */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-gray-100) 25%,
    var(--color-gray-300) 50%,
    var(--color-gray-100) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
}

.skeleton-title {
  height: 2rem;
  width: 60%;
  margin-bottom: 1rem;
}

.skeleton-image {
  width: 100%;
  aspect-ratio: 16/9;
}

/* =====================================================
   PAGE TRANSITIONS
   ===================================================== */
.page-transition-enter {
  opacity: 0;
}

.page-transition-enter-active {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.page-transition-exit {
  opacity: 1;
}

.page-transition-exit-active {
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

  .animate-on-scroll,
  .animate-fade-up,
  .animate-fade-down,
  .animate-fade-left,
  .animate-fade-right,
  .animate-scale,
  .stagger-children > * {
    opacity: 1;
    transform: none;
  }
}

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

/* Gradient text animation */
.gradient-text {
  background: linear-gradient(
    90deg,
    var(--color-primary),
    var(--color-accent),
    var(--color-primary)
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0%, 100% {
    background-position: 0% center;
  }
  50% {
    background-position: 100% center;
  }
}

/* Parallax helper */
.parallax {
  will-change: transform;
}

/* Counter animation helper */
.counter {
  display: inline-block;
}

/* Ripple effect for buttons */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.ripple:active::before {
  width: 300px;
  height: 300px;
}
