/* ==========================================================================
   ExamVerse — Subtle Micro-Interactions & Transitions (css/animations.css)
   Restrained timing: 180ms - 260ms cubic-bezier(0.22, 1, 0.36, 1)
   ========================================================================== */

:root {
  --ease-out-quart: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 180ms;
  --duration-normal: 240ms;
}

/* Smooth theme transitions */
body,
.ev-sidebar,
.ev-topbar,
.ev-bottom-nav,
.ev-card,
.ev-btn,
.ev-option-btn,
.ev-input,
.ev-select,
.ev-modal-panel,
.ev-badge-pill,
.ev-stat-box {
  transition:
    background-color var(--duration-normal) var(--ease-out-quart),
    border-color var(--duration-normal) var(--ease-out-quart),
    color var(--duration-fast) var(--ease-out-quart),
    box-shadow var(--duration-fast) var(--ease-out-quart),
    transform var(--duration-fast) var(--ease-out-quart);
}

/* Page / View Transition */
@keyframes evFadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ev-view-animate {
  animation: evFadeSlideIn 220ms var(--ease-out-quart) forwards;
}

/* Interactive Card Hover */
.ev-card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-primary-border);
}

.ev-card-interactive:active {
  transform: translateY(0);
}

/* Button Micro-interactions */
.ev-btn:active:not(:disabled) {
  transform: scale(0.985);
}

/* Progress Bar Fill Animation */
.ev-progress-fill {
  transition: width 300ms var(--ease-out-quart);
}

/* Streak Flame Active Subtle Pulse */
@keyframes evFlamePulse {
  0%, 100% {
    filter: drop-shadow(0 0 3px rgba(245, 158, 11, 0.35));
  }
  50% {
    filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.6));
  }
}

.ev-streak-pill.is-active .ev-flame-svg {
  color: #F59E0B;
  animation: evFlamePulse 2.8s ease-in-out infinite;
}

.ev-streak-pill.is-muted .ev-flame-svg {
  color: var(--text-faint);
  filter: none;
}

/* Answer Option Feedback Transitions */
@keyframes evCorrectPop {
  0% { transform: scale(0.992); }
  50% { transform: scale(1.006); }
  100% { transform: scale(1); }
}

.ev-option-btn.is-correct {
  animation: evCorrectPop 220ms var(--ease-out-quart);
}

/* Toast Notification Animation */
@keyframes evToastSlideUp {
  from {
    opacity: 0;
    transform: translate(-50%, 12px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.ev-toast.is-visible {
  animation: evToastSlideUp 220ms var(--ease-out-quart) forwards;
}

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