/* ============================================
   animations.css — Keyframes & Transitions
   Math Tutor | Motion Design
   ============================================ */

/* ─── Orb Float ─────────────────────────────── */
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(30px, -30px) scale(1.05); }
  66%       { transform: translate(-20px, 20px) scale(0.95); }
}

/* ─── Shimmer (Skeleton Loader) ─────────────── */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

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

/* ─── Fade Out ──────────────────────────────── */
@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ─── Slide Up ──────────────────────────────── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

/* ─── Slide In Left (sidebar) ───────────────── */
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── Pulse (timer warning) ─────────────────── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* ─── Spin (send button loading) ────────────── */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ─── Bounce In (modal) ─────────────────────── */
@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(0.85); }
  60%  { opacity: 1; transform: scale(1.03); }
  100% { transform: scale(1); }
}

/* ─── Toast Slide In ────────────────────────── */
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Toast Slide Out ───────────────────────── */
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-20px); }
}

/* ─── Glow Pulse (send button) ──────────────── */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(124, 111, 255, 0.4); }
  50%       { box-shadow: 0 0 24px rgba(124, 111, 255, 0.7), 0 0 40px rgba(0, 217, 255, 0.3); }
}

/* ─── Page Load Sequence ────────────────────── */
.anim-bg {
  animation: fadeIn 400ms ease forwards;
}

.anim-orb {
  animation: fadeIn 300ms 100ms ease both;
}

.anim-header {
  animation: slideDown 300ms 200ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

.anim-sidebar {
  animation: slideInLeft 300ms 300ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

.anim-chat {
  animation: fadeIn 300ms 400ms ease both;
}

.anim-input {
  animation: slideUp 300ms 500ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ─── Message Animations ────────────────────── */
.msg-enter {
  animation: slideUp 200ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.skeleton-enter {
  animation: fadeIn 200ms 200ms ease both;
}

/* ─── Utility Animation Classes ─────────────── */
.fade-in   { animation: fadeIn 300ms ease forwards; }
.fade-out  { animation: fadeOut 300ms ease forwards; }
.slide-up  { animation: slideUp 250ms cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.pulse     { animation: pulse 1.2s ease-in-out infinite; }
.spinning  { animation: spin 0.8s linear infinite; }
