/* ============================================================
   animations.css — Keyframes y efectos de ApuntesHub
   ============================================================ */

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

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(60px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

/* ─── Cards ──────────────────────────────────────────────── */
@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ─── Vote / Like ────────────────────────────────────────── */
@keyframes bounceVote {
  0%   { transform: scale(1); }
  25%  { transform: scale(1.4) rotate(-8deg); }
  50%  { transform: scale(0.9) rotate(4deg); }
  75%  { transform: scale(1.1) rotate(-2deg); }
  100% { transform: scale(1) rotate(0deg); }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(88, 101, 242, 0.5); }
  50%       { box-shadow: 0 0 0 10px rgba(88, 101, 242, 0); }
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14%      { transform: scale(1.2); }
  28%      { transform: scale(1); }
  42%      { transform: scale(1.15); }
  70%      { transform: scale(1); }
}

/* ─── Loading / Skeleton ─────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%       { opacity: 0.8; transform: scale(1.03); }
}

/* ─── Modal ──────────────────────────────────────────────── */
@keyframes backdropFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes modalSlideOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
}

/* ─── Toast / Notifications ──────────────────────────────── */
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(110%); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(110%); }
}

/* ─── Ripple ─────────────────────────────────────────────── */
@keyframes rippleEffect {
  from {
    opacity: 0.6;
    transform: scale(0);
  }
  to {
    opacity: 0;
    transform: scale(4);
  }
}

/* ─── Floating elements ──────────────────────────────────── */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-8px); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(88, 101, 242, 0.3); }
  50%       { box-shadow: 0 0 40px rgba(88, 101, 242, 0.6), 0 0 80px rgba(155, 89, 182, 0.3); }
}

/* ─── Background decorations ─────────────────────────────── */
@keyframes orbitSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ─── Utility animation classes ──────────────────────────── */
.animate-fadeIn      { animation: fadeIn 0.3s ease forwards; }
.animate-fadeInUp    { animation: fadeInUp 0.4s ease forwards; }
.animate-slideInUp   { animation: slideInUp 0.4s cubic-bezier(0.34, 1.2, 0.64, 1) forwards; }
.animate-scaleIn     { animation: scaleIn 0.3s cubic-bezier(0.34, 1.4, 0.64, 1) forwards; }
.animate-spin        { animation: spin 1s linear infinite; }
.animate-pulse       { animation: pulse 2s ease infinite; }
.animate-float       { animation: float 3s ease-in-out infinite; }
.animate-glow        { animation: glow 2s ease-in-out infinite; }
.animate-breathe     { animation: breathe 2s ease-in-out infinite; }

/* Staggered card animations */
.note-card:nth-child(1)  { animation-delay: 0.05s; }
.note-card:nth-child(2)  { animation-delay: 0.10s; }
.note-card:nth-child(3)  { animation-delay: 0.15s; }
.note-card:nth-child(4)  { animation-delay: 0.20s; }
.note-card:nth-child(5)  { animation-delay: 0.25s; }
.note-card:nth-child(6)  { animation-delay: 0.30s; }
.note-card:nth-child(7)  { animation-delay: 0.35s; }
.note-card:nth-child(8)  { animation-delay: 0.40s; }
.note-card:nth-child(n+9){ animation-delay: 0.45s; }

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