/* Modern Animations */

/* Fade In Up Base Animation */
.fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
  /* Use immediate opacity state for base container to prevent flash */
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 
   Cascading Animations 
   Applues to children of .fade-in-up containers
*/

/* Cards Cascade */
.fade-in-up .card {
  opacity: 0;
  animation: fadeInUp 0.5s ease-out forwards;
}

.fade-in-up .card:nth-child(1) {
  animation-delay: 0.1s;
}

.fade-in-up .card:nth-child(2) {
  animation-delay: 0.15s;
}

.fade-in-up .card:nth-child(3) {
  animation-delay: 0.2s;
}

.fade-in-up .card:nth-child(4) {
  animation-delay: 0.25s;
}

.fade-in-up .card:nth-child(5) {
  animation-delay: 0.3s;
}

.fade-in-up .card:nth-child(n+6) {
  animation-delay: 0.35s;
}

/* Grid Columns Cascade (for dashboard stats etc) */
.fade-in-up .col-12:nth-child(1),
.fade-in-up .col-md-6:nth-child(1),
.fade-in-up .col-xl-3:nth-child(1) {
  animation-delay: 0.1s;
}

.fade-in-up .col-12:nth-child(2),
.fade-in-up .col-md-6:nth-child(2),
.fade-in-up .col-xl-3:nth-child(2) {
  animation-delay: 0.15s;
}

.fade-in-up .col-12:nth-child(3),
.fade-in-up .col-md-6:nth-child(3),
.fade-in-up .col-xl-3:nth-child(3) {
  animation-delay: 0.2s;
}

.fade-in-up .col-12:nth-child(4),
.fade-in-up .col-md-6:nth-child(4),
.fade-in-up .col-xl-3:nth-child(4) {
  animation-delay: 0.25s;
}

/* Table Rows Cascade */
.fade-in-up .table tbody tr {
  opacity: 0;
  animation: fadeInUp 0.4s ease-out forwards;
}

.fade-in-up .table tbody tr:nth-child(1) {
  animation-delay: 0.1s;
}

.fade-in-up .table tbody tr:nth-child(2) {
  animation-delay: 0.15s;
}

.fade-in-up .table tbody tr:nth-child(3) {
  animation-delay: 0.2s;
}

.fade-in-up .table tbody tr:nth-child(4) {
  animation-delay: 0.25s;
}

.fade-in-up .table tbody tr:nth-child(5) {
  animation-delay: 0.3s;
}

.fade-in-up .table tbody tr:nth-child(6) {
  animation-delay: 0.35s;
}

.fade-in-up .table tbody tr:nth-child(7) {
  animation-delay: 0.4s;
}

.fade-in-up .table tbody tr:nth-child(8) {
  animation-delay: 0.45s;
}

.fade-in-up .table tbody tr:nth-child(9) {
  animation-delay: 0.5s;
}

.fade-in-up .table tbody tr:nth-child(10) {
  animation-delay: 0.55s;
}

.fade-in-up .table tbody tr:nth-child(n+11) {
  animation-delay: 0.6s;
}


/* Icon Pulse */
.icon-pulse {
  animation: iconPulse 2s infinite;
}

@keyframes iconPulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Hover Lift */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Icon Spin on Hover */
.icon-spin-hover:hover .feather {
  animation: spin 1s linear infinite;
}

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

  to {
    transform: rotate(360deg);
  }
}

/* Progress Bar Animation */
.progress-bar-animated {
  background-size: 1rem 1rem;
  animation: progress-bar-stripes 1s linear infinite;
}

/* Status Dot Pulse */
.status-dot-pulse {
  position: relative;
}

.status-dot-pulse::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0;
  animation: ripple 1.5s infinite;
}

@keyframes ripple {
  0% {
    transform: scale(0.5);
    opacity: 1;
  }

  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}