/* ========================================
   animations.css - Transitions & Keyframes
   Replaces Framer Motion animations
   ======================================== */


/* ========================================
   Keyframes
   ======================================== */

/* --- Fade in with upward slide --- */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Fade in with scale --- */
@keyframes fade-in-scale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* --- Fade in (simple) --- */
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* --- Slide in from right --- */
@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* --- Slide out to left --- */
@keyframes slide-out-left {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-20px);
  }
}

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

/* --- Pulse (background decorative) --- */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}


/* ========================================
   Animation Utility Classes
   ======================================== */

.anim-fade-in-up {
  animation: fade-in-up var(--transition-normal) both;
}

.anim-fade-in-scale {
  animation: fade-in-scale var(--transition-normal) both;
}

.anim-fade-in {
  animation: fade-in var(--transition-normal) both;
}

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

.anim-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}


/* ========================================
   Question Content Transitions
   (replaces AnimatePresence for question switching)
   ======================================== */

.question__content {
  /* デフォルトではアニメーションなし */
}

.question__content.slide-enter {
  animation: slide-in-right 300ms ease both;
}

.question__content.is-leaving {
  animation: slide-out-left var(--transition-normal) both;
}


/* ========================================
   Screen Transitions
   ======================================== */

.screen.is-visible .top__content {
  animation: fade-in-up var(--transition-slow) both;
}

.screen.is-visible .route-select__inner {
  animation: fade-in-scale var(--transition-slow) both;
}

.screen.is-visible .loading__content {
  animation: fade-in var(--transition-slow) both;
}

.screen.is-visible .question__inner {
  animation: fade-in-up var(--transition-slow) both;
}

.screen.is-visible .result__card {
  animation: fade-in-scale var(--transition-slow) both;
}
