/* Animations & Keyframes
   Extracted from z/styles/animations.css with motion safety */

/* ==================== Like Icon Animations ==================== */

/* Base transitions for heart parts */
.main-body,
.core,
.sparks {
  fill: transparent;
  transition: fill 0.3s linear;
  transition-delay: 0s;
}

.contour {
  transition: fill 0.1s linear;
}

/* Hover states */
.like-icon:hover .core {
  fill: var(--accent-color);
  transition-delay: 0s;
}

.like-icon:not(:hover) .core {
  fill: transparent;
  transition-delay: 0.03s;
}

.like-icon:hover .main-body {
  fill: var(--accent-color);
  transition-delay: 0.05s;
}

.like-icon:not(:hover) .main-body {
  fill: transparent;
  transition-delay: 0s;
}

.like-icon:hover .contour {
  fill: var(--accent-color);
}

/* Active states */
.like-icon:active .core {
  fill: var(--animation-fill-color);
}

.like-icon:active .main-body {
  fill: var(--animation-fill-color);
  transition-delay: 0.05s;
}

.like-icon:not(:active) .core {
  transition-delay: 0.03s;
}

/* Liked state (is-liked class) */
.like-icon.is-liked .core {
  fill: var(--animation-fill-color);
  transition-delay: 0s;
}

.like-icon.is-liked .main-body {
  fill: var(--animation-fill-color);
  transition-delay: 0.05s;
}

.like-icon.is-liked .contour {
  fill: var(--animation-fill-color);
  transition-delay: 0.06s;
}

.like-icon.is-liked .heart {
  animation: pulse 0.3s ease-in-out 0.06s 1 forwards;
  transform-origin: center;
}

.like-icon.is-liked .sparks {
  animation: spark 0.3s ease-in-out 0.12s 1 forwards;
}

/* Keyframes */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.25);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes spark {
  0% {
    fill: none;
  }
  50% {
    fill: var(--animation-fill-color);
  }
  100% {
    fill: none;
  }
}

/* ==================== Button Animations ==================== */

.button {
  transition: color 0.3s ease, background 0.3s ease;
}

.button::before {
  transition: transform 0.5s ease-in-out;
}

.card__icon-button {
  transition: border 0.3s ease;
}

/* ==================== Motion Safety ==================== */

@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;
  }
  
  /* Simplify button animations */
  .button::before {
    transition: none;
  }
  
  /* Disable like icon animations */
  .like-icon.is-liked .heart {
    animation: none;
  }
  
  .like-icon.is-liked .sparks {
    animation: none;
  }
}

