/* ============================================
   ANIMATIONS & MICRO-INTERACTIONS
   ============================================ */

/* === Keyframes === */
@keyframes kenBurns {
  0% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(1.08) translate(-1%, -1%); }
  100% { transform: scale(1.05) translate(1%, 0.5%); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); }
}

@keyframes progressGlow {
  0%, 100% { opacity: 0; }
  50% { opacity: 0.8; }
}

@keyframes recordPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 20px rgba(231, 76, 60, 0.4); }
  50% { transform: scale(1.08); box-shadow: 0 6px 40px rgba(231, 76, 60, 0.7); }
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  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);
  }
}

@keyframes slideInFromBottom {
  from {
    opacity: 0;
    transform: translateY(60px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-10deg) scale(0.9);
  }
  to {
    opacity: 1;
    transform: rotate(0) scale(1);
  }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes borderGlow {
  0%, 100% { border-color: var(--glass-border); }
  50% { border-color: var(--accent-gold); }
}

@keyframes particleFloat {
  0%, 100% { transform: translateY(0) translateX(0); opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateY(-100px) translateX(20px); opacity: 0; }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes typewriter {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* === Scroll-triggered Animations === */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

.animate-on-scroll.fade-left {
  transform: translateX(-40px);
}

.animate-on-scroll.fade-left.animated {
  transform: translateX(0);
}

.animate-on-scroll.fade-right {
  transform: translateX(40px);
}

.animate-on-scroll.fade-right.animated {
  transform: translateX(0);
}

.animate-on-scroll.scale-in {
  transform: scale(0.85);
}

.animate-on-scroll.scale-in.animated {
  transform: scale(1);
}

/* Stagger children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-children.animated > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.animated > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.animated > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-children.animated > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-children.animated > *:nth-child(5) { transition-delay: 0.25s; }
.stagger-children.animated > *:nth-child(6) { transition-delay: 0.3s; }
.stagger-children.animated > *:nth-child(7) { transition-delay: 0.35s; }
.stagger-children.animated > *:nth-child(8) { transition-delay: 0.4s; }

.stagger-children.animated > * {
  opacity: 1;
  transform: translateY(0);
}

/* === Hover Micro-animations === */
.hover-lift {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.hover-glow {
  transition: box-shadow var(--transition-fast);
}

.hover-glow:hover {
  box-shadow: 0 0 30px rgba(212, 168, 67, 0.2);
}

.hover-scale {
  transition: transform var(--transition-fast);
}

.hover-scale:hover {
  transform: scale(1.05);
}

/* === Gold Shimmer Text Effect === */
.shimmer-text {
  background: linear-gradient(
    90deg,
    var(--accent-gold) 0%,
    var(--accent-gold-light) 25%,
    var(--accent-gold) 50%,
    var(--accent-gold-light) 75%,
    var(--accent-gold) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

/* === Particle Background (decorative) === */
.particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--accent-gold);
  border-radius: var(--radius-full);
  opacity: 0;
  animation: particleFloat 8s ease-in-out infinite;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 6s; }
.particle:nth-child(2) { left: 25%; animation-delay: 1s; animation-duration: 7s; }
.particle:nth-child(3) { left: 40%; animation-delay: 2s; animation-duration: 8s; }
.particle:nth-child(4) { left: 55%; animation-delay: 3s; animation-duration: 6.5s; }
.particle:nth-child(5) { left: 70%; animation-delay: 1.5s; animation-duration: 7.5s; }
.particle:nth-child(6) { left: 85%; animation-delay: 2.5s; animation-duration: 9s; }
.particle:nth-child(7) { left: 15%; animation-delay: 4s; animation-duration: 8.5s; }
.particle:nth-child(8) { left: 60%; animation-delay: 0.5s; animation-duration: 7s; }

/* === Gradient Border Animation === */
.gradient-border {
  position: relative;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(45deg, var(--accent-gold), var(--accent-emerald), var(--accent-gold), var(--accent-emerald));
  background-size: 400% 400%;
  border-radius: inherit;
  z-index: -1;
  animation: gradientShift 6s ease infinite;
  opacity: 0;
  transition: opacity var(--transition-med);
}

.gradient-border:hover::before {
  opacity: 1;
}

/* === Loading Spinner === */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--accent-gold);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === Success Animation === */
.success-animation {
  animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* === Reveal Line Animation === */
.reveal-line {
  position: relative;
  overflow: hidden;
}

.reveal-line::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-emerald));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-line:hover::after {
  transform: scaleX(1);
}

/* === Counter Animation === */
.counter-animate {
  display: inline-block;
  animation: countUp 0.6s ease-out;
}

/* === Toast Notification === */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 14px 28px;
  background: rgba(10, 22, 40, 0.95);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  z-index: var(--z-toast);
  opacity: 0;
  transition: all var(--transition-med);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  border-color: var(--accent-emerald);
}

.toast.error {
  border-color: var(--accent-red);
}