/* ==========================================================================
   MON-BALLONS-77.RU — ANIMATIONS STYLESHEET
   Industrial Contrast Design System — Micro-interactions
   ========================================================================== */

/* --------------------------------------------------------------------------
   KEYFRAMES
   -------------------------------------------------------------------------- */

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

/* Fade In Up */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Slide In Right */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

/* Slide Out Right */
@keyframes slideOutRight {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(100%);
  }
}

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

/* Pulse */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

/* Shake */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-4px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(4px);
  }
}

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

/* Glow Pulse */
@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 5px rgba(255, 94, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(255, 94, 0, 0.6), 0 0 30px rgba(255, 94, 0, 0.4);
  }
}

/* Slide Down */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Bounce In */
@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}

/* Flash */
@keyframes flash {
  0%, 50%, 100% {
    opacity: 1;
  }
  25%, 75% {
    opacity: 0.4;
  }
}

/* --------------------------------------------------------------------------
   UTILITY ANIMATION CLASSES
   -------------------------------------------------------------------------- */

.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

.animate-fade-in-up {
  animation: fadeInUp 0.4s ease-out;
}

.animate-fade-in-down {
  animation: fadeInDown 0.4s ease-out;
}

.animate-slide-in-right {
  animation: slideInRight 0.3s ease-out;
}

.animate-scale-in {
  animation: scaleIn 0.3s ease-out;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.animate-shake {
  animation: shake 0.5s ease-in-out;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.animate-glow-pulse {
  animation: glowPulse 2s ease-in-out infinite;
}

.animate-bounce-in {
  animation: bounceIn 0.5s ease-out;
}

.animate-flash {
  animation: flash 1s ease-in-out;
}

/* --------------------------------------------------------------------------
   HOVER ANIMATIONS
   -------------------------------------------------------------------------- */

/* Lift on Hover */
.hover-lift {
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}

.hover-lift:hover {
  transform: translateY(-4px);
}

/* Grow on Hover */
.hover-grow {
  transition: transform 0.15s ease-out;
}

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

/* Shrink on Hover */
.hover-shrink {
  transition: transform 0.15s ease-out;
}

.hover-shrink:hover {
  transform: scale(0.95);
}

/* Border Slide */
.hover-border-slide {
  position: relative;
  overflow: hidden;
}

.hover-border-slide::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-accent);
  transition: width 0.2s ease-out;
}

.hover-border-slide:hover::before {
  width: 100%;
}

/* Glow on Hover */
.hover-glow {
  transition: box-shadow 0.15s ease-out;
}

.hover-glow:hover {
  box-shadow: 0 2px 12px rgba(255, 94, 0, 0.4);
}

/* --------------------------------------------------------------------------
   LOADING STATES
   -------------------------------------------------------------------------- */

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 94, 0, 0.2);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.loading-dots {
  display: inline-flex;
  gap: 4px;
}

.loading-dots span {
  display: block;
  width: 8px;
  height: 8px;
  background-color: var(--color-accent);
  border-radius: 50%;
  animation: pulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

/* --------------------------------------------------------------------------
   PAGE LOAD ANIMATIONS
   -------------------------------------------------------------------------- */

.page-load-animation {
  animation: fadeInUp 0.6s ease-out;
}

.stagger-animation > * {
  opacity: 0;
  animation: fadeInUp 0.5s ease-out forwards;
}

.stagger-animation > *:nth-child(1) {
  animation-delay: 0.1s;
}

.stagger-animation > *:nth-child(2) {
  animation-delay: 0.2s;
}

.stagger-animation > *:nth-child(3) {
  animation-delay: 0.3s;
}

.stagger-animation > *:nth-child(4) {
  animation-delay: 0.4s;
}

.stagger-animation > *:nth-child(5) {
  animation-delay: 0.5s;
}

.stagger-animation > *:nth-child(6) {
  animation-delay: 0.6s;
}

/* --------------------------------------------------------------------------
   BUTTON PRESS ANIMATION
   -------------------------------------------------------------------------- */

.btn-press {
  transition: transform 0.08s ease-out;
}

.btn-press:active {
  transform: scale(0.96);
}

/* --------------------------------------------------------------------------
   CARD ANIMATIONS
   -------------------------------------------------------------------------- */

.card-entrance {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.5s ease-out forwards;
}

.card-hover-float {
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}

.card-hover-float:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 24px rgba(43, 43, 43, 0.15);
}

/* --------------------------------------------------------------------------
   TEXT ANIMATIONS
   -------------------------------------------------------------------------- */

.text-slide-up {
  display: inline-block;
  animation: fadeInUp 0.6s ease-out;
}

.text-flash-accent {
  animation: flash 1s ease-in-out;
  color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   SCROLL REVEAL (JS-triggered)
   -------------------------------------------------------------------------- */

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

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

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

.scroll-reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

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

.scroll-reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

/* --------------------------------------------------------------------------
   BADGE ANIMATIONS
   -------------------------------------------------------------------------- */

.badge-pop {
  animation: bounceIn 0.5s ease-out;
}

.badge-pulse {
  position: relative;
}

.badge-pulse::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 2px solid var(--color-accent);
  border-radius: inherit;
  opacity: 0;
  animation: pulse-ring 1.5s ease-out infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

/* --------------------------------------------------------------------------
   MENU ANIMATIONS
   -------------------------------------------------------------------------- */

.menu-slide-in {
  animation: slideInRight 0.3s ease-out;
}

.menu-fade-in {
  animation: fadeIn 0.2s ease-out;
}

/* --------------------------------------------------------------------------
   FORM ANIMATIONS
   -------------------------------------------------------------------------- */

.form-input-focus {
  transition: all 0.15s ease-out;
}

.form-input-focus:focus {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 94, 0, 0.15);
}

.form-error-shake {
  animation: shake 0.5s ease-in-out;
  border-color: #ef4444 !important;
}

.form-success-glow {
  animation: glowPulse 0.8s ease-out;
  border-color: #22c55e !important;
}

/* --------------------------------------------------------------------------
   MODAL ANIMATIONS
   -------------------------------------------------------------------------- */

.modal-backdrop-fade {
  animation: fadeIn 0.2s ease-out;
}

.modal-content-scale {
  animation: scaleIn 0.3s ease-out;
}

.modal-content-slide-down {
  animation: slideDown 0.3s ease-out;
}

/* --------------------------------------------------------------------------
   TOAST ANIMATIONS
   -------------------------------------------------------------------------- */

.toast-slide-in {
  animation: slideInRight 0.3s ease-out;
}

.toast-slide-out {
  animation: slideOutRight 0.3s ease-out forwards;
}

/* --------------------------------------------------------------------------
   ICON ANIMATIONS
   -------------------------------------------------------------------------- */

.icon-rotate {
  transition: transform 0.2s ease-out;
}

.icon-rotate:hover {
  transform: rotate(15deg);
}

.icon-bounce {
  animation: bounceIn 0.5s ease-out;
}

.icon-spin-hover {
  transition: transform 0.3s ease-out;
}

.icon-spin-hover:hover {
  transform: rotate(360deg);
}

/* --------------------------------------------------------------------------
   PROGRESS ANIMATIONS
   -------------------------------------------------------------------------- */

.progress-bar-fill {
  animation: progressFill 1.5s ease-out forwards;
}

@keyframes progressFill {
  from {
    width: 0;
  }
  to {
    width: var(--progress-width, 100%);
  }
}

/* --------------------------------------------------------------------------
   SKELETON LOADING
   -------------------------------------------------------------------------- */

.skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 0%,
    #e0e0e0 20%,
    #f0f0f0 40%,
    #f0f0f0 100%
  );
  background-size: 200% 100%;
  animation: skeletonLoading 1.5s ease-in-out infinite;
}

@keyframes skeletonLoading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* --------------------------------------------------------------------------
   NOTIFICATION DOT
   -------------------------------------------------------------------------- */

.notification-dot {
  position: relative;
}

.notification-dot::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 8px;
  background-color: var(--color-accent);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   RIPPLE EFFECT (JS-triggered)
   -------------------------------------------------------------------------- */

.ripple {
  position: relative;
  overflow: hidden;
}

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

.ripple:active::after {
  width: 300px;
  height: 300px;
  opacity: 1;
  transition: width 0s, height 0s, opacity 0s;
}

/* --------------------------------------------------------------------------
   SCROLL PROGRESS BAR
   -------------------------------------------------------------------------- */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background-color: var(--color-accent);
  z-index: 1000;
  transform-origin: left;
  transition: transform 0.1s ease-out;
}

/* --------------------------------------------------------------------------
   TYPEWRITER EFFECT (JS-triggered)
   -------------------------------------------------------------------------- */

.typewriter {
  overflow: hidden;
  border-right: 2px solid var(--color-accent);
  white-space: nowrap;
  animation: typing 3s steps(40, end), blink 0.75s step-end infinite;
}

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

@keyframes blink {
  0%, 100% {
    border-color: transparent;
  }
  50% {
    border-color: var(--color-accent);
  }
}

/* --------------------------------------------------------------------------
   PARALLAX SCROLL (JS-enhanced)
   -------------------------------------------------------------------------- */

.parallax {
  transition: transform 0.1s ease-out;
}

/* --------------------------------------------------------------------------
   FOCUS STATES
   -------------------------------------------------------------------------- */

.focus-ring:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.focus-glow:focus {
  box-shadow: 0 0 0 3px rgba(255, 94, 0, 0.3);
}

/* --------------------------------------------------------------------------
   REDUCE MOTION (Accessibility)
   -------------------------------------------------------------------------- */

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

  .scroll-reveal,
  .scroll-reveal-left,
  .scroll-reveal-right {
    opacity: 1;
    transform: none;
  }
}