@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 slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

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

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

@keyframes checkPop {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(103, 80, 164, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(103, 80, 164, 0); }
}

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

@keyframes confetti {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(-100px) rotate(720deg); opacity: 0; }
}

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

.anim-fade-in { animation: fadeIn 0.4s ease-out forwards; }
.anim-fade-in-up { animation: fadeInUp 0.5s ease-out forwards; }
.anim-fade-in-down { animation: fadeInDown 0.5s ease-out forwards; }
.anim-slide-left { animation: slideInLeft 0.5s ease-out forwards; }
.anim-slide-right { animation: slideInRight 0.5s ease-out forwards; }
.anim-scale-in { animation: scaleIn 0.3s ease-out forwards; }
.anim-check { animation: checkPop 0.4s ease-out forwards; }
.anim-pulse { animation: pulseGlow 2s ease-in-out infinite; }

.anim-delay-1 { animation-delay: 0.1s; }
.anim-delay-2 { animation-delay: 0.2s; }
.anim-delay-3 { animation-delay: 0.3s; }
.anim-delay-4 { animation-delay: 0.4s; }
.anim-delay-5 { animation-delay: 0.5s; }

.anim-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.anim-stagger > *:nth-child(2) { animation-delay: 0.1s; }
.anim-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.anim-stagger > *:nth-child(4) { animation-delay: 0.2s; }
.anim-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.anim-stagger > *:nth-child(6) { animation-delay: 0.3s; }

.anim-stagger > * {
  opacity: 0;
  animation: fadeInUp 0.4s ease-out forwards;
}

.skeleton {
  background: linear-gradient(90deg, var(--md-surface-container) 25%, var(--md-surface-container-high) 50%, var(--md-surface-container) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--md-radius-md);
}

.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-text.short { width: 60%; }
.skeleton-text.medium { width: 80%; }

.skeleton-heading {
  height: 24px;
  width: 50%;
  margin-bottom: 16px;
}

.skeleton-card {
  height: 200px;
  margin-bottom: 16px;
}

.btn, .card, .nav-link, .pricing-tier, a {
  transition: all var(--transition-standard);
}

.card-elevated:hover {
  transform: translateY(-2px);
}

.pricing-tier:hover {
  transform: translateX(4px);
}

[data-animate] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

[data-animate].visible {
  opacity: 1;
  transform: translateY(0);
}

.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, var(--md-primary) 10%, transparent 10.01%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10);
  opacity: 0;
  transition: transform 0.5s, opacity 1s;
}

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

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring circle {
  transition: stroke-dashoffset var(--transition-emphasized);
}

.badge-unlock {
  animation: scaleIn 0.3s ease-out, fadeInUp 0.5s ease-out;
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--md-error);
}

.notification-dot::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--md-error);
  animation: pulseGlow 2s ease-in-out infinite;
}

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