/* ═══════════════════════════════════════════════════════════════
   MediaVault — animations.css
   Micro-animations, Keyframes, Transitions
   ═══════════════════════════════════════════════════════════════ */

/* ─── Keyframes ───────────────────────────────────────────────── */
@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 slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

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

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

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

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

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-12px); }
}

@keyframes indeterminate {
  0%   { width: 10%; margin-left: -10%; }
  50%  { width: 60%; margin-left: 20%; }
  100% { width: 10%; margin-left: 110%; }
}

@keyframes progressPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.7; }
}

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

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

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(124,58,237,0.3); }
  50%       { box-shadow: 0 0 40px rgba(124,58,237,0.6), 0 0 60px rgba(219,39,119,0.2); }
}

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

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

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

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

/* ─── Animation Utility Classes ───────────────────────────────── */
.animate-fadeIn       { animation: fadeIn 0.4s ease both; }
.animate-fadeInUp     { animation: fadeInUp 0.5s ease both; }
.animate-fadeInDown   { animation: fadeInDown 0.4s ease both; }
.animate-slideUp      { animation: slideUp 0.4s ease both; }
.animate-scaleIn      { animation: scaleIn 0.3s ease both; }
.animate-spin         { animation: spin 1s linear infinite; }
.animate-pulse        { animation: pulse 2s ease-in-out infinite; }
.animate-float        { animation: float 3s ease-in-out infinite; }
.animate-glow         { animation: glow 2s ease-in-out infinite; }
.animate-bounceIn     { animation: bounceIn 0.6s ease both; }

/* Delay utilities */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }

/* ─── Hero Gradient Background ────────────────────────────────── */
.hero-gradient {
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

.hero-gradient::before {
  content: '';
  position: absolute;
  top: -30%;
  left: -20%;
  width: 60%;
  height: 80%;
  background: radial-gradient(ellipse, rgba(124,58,237,0.15) 0%, transparent 70%);
  pointer-events: none;
  animation: float 6s ease-in-out infinite;
}

.hero-gradient::after {
  content: '';
  position: absolute;
  bottom: -20%;
  right: -10%;
  width: 50%;
  height: 70%;
  background: radial-gradient(ellipse, rgba(219,39,119,0.1) 0%, transparent 70%);
  pointer-events: none;
  animation: float 8s ease-in-out infinite reverse;
}

/* ─── Animated Gradient Text ──────────────────────────────────── */
.gradient-animated {
  background: linear-gradient(270deg, #7c3aed, #db2777, #3b82f6, #7c3aed);
  background-size: 400% 400%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 6s ease infinite;
}

/* ─── Particle Dots ───────────────────────────────────────────── */
.particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--accent-purple);
  opacity: 0.15;
  animation: float 4s ease-in-out infinite;
}

/* ─── Hover Lift Effect ───────────────────────────────────────── */
.hover-lift {
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}
.hover-lift:hover { transform: translateY(-4px); box-shadow: var(--shadow-raised); }

/* ─── Hover Glow Effect ───────────────────────────────────────── */
.hover-glow {
  transition: box-shadow var(--transition-normal);
}
.hover-glow:hover { box-shadow: var(--shadow-glow), var(--shadow-card); }

/* ─── Click Ripple ────────────────────────────────────────────── */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
  opacity: 0;
  transform: scale(0);
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.ripple:active::after {
  transform: scale(2);
  opacity: 1;
  transition: 0s;
}

/* ─── Progress Animation ──────────────────────────────────────── */
.progress-bar {
  height: 4px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-main);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 1.5s infinite;
}

/* ─── Loading Spinner ─────────────────────────────────────────── */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-normal);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-lg { width: 40px; height: 40px; border-width: 3px; }
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }

/* ─── Page Transitions ────────────────────────────────────────── */
.page-enter {
  animation: fadeInUp 0.4s ease both;
}

/* Staggered children animation */
.stagger-children > * {
  opacity: 0;
  animation: fadeInUp 0.4s ease both;
}

.stagger-children > *:nth-child(1)  { animation-delay: 0.0s; }
.stagger-children > *:nth-child(2)  { animation-delay: 0.05s; }
.stagger-children > *:nth-child(3)  { animation-delay: 0.1s; }
.stagger-children > *:nth-child(4)  { animation-delay: 0.15s; }
.stagger-children > *:nth-child(5)  { animation-delay: 0.2s; }
.stagger-children > *:nth-child(6)  { animation-delay: 0.25s; }
.stagger-children > *:nth-child(7)  { animation-delay: 0.3s; }
.stagger-children > *:nth-child(8)  { animation-delay: 0.35s; }
.stagger-children > *:nth-child(9)  { animation-delay: 0.4s; }
.stagger-children > *:nth-child(10) { animation-delay: 0.45s; }
.stagger-children > *:nth-child(11) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(12) { animation-delay: 0.55s; }

/* ─── 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;
  }
}
