/* ================================================
   HR CRM — Animations CSS
   ================================================ */

/* ---- Keyframes ---- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0);    }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(22px); }
  to   { opacity: 1; transform: translateX(0);    }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-22px); }
  to   { opacity: 1; transform: translateX(0);     }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1);    }
}
@keyframes pulse {
  0%, 100% { opacity: 1;   }
  50%       { opacity: 0.4; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 10px var(--color-primary-glow); }
  50%       { box-shadow: 0 0 28px hsla(258, 89%, 66%, 0.5); }
}
@keyframes growUp {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}
@keyframes float {
  0%, 100% { transform: translateY(0);   }
  50%       { transform: translateY(-5px); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0);     }
}

/* ---- Page transitions ---- */
.content { animation: fadeIn 0.25s ease; }

/* ---- Stat cards stagger ---- */
.stat-card { animation: fadeInUp 0.3s ease backwards; }
.stat-card:nth-child(1) { animation-delay: 0ms;   }
.stat-card:nth-child(2) { animation-delay: 55ms;  }
.stat-card:nth-child(3) { animation-delay: 110ms; }
.stat-card:nth-child(4) { animation-delay: 165ms; }
.stat-card:nth-child(5) { animation-delay: 220ms; }

/* ---- Kanban cards ---- */
.kanban-card { animation: scaleIn 0.2s ease; }

/* ---- Toast ---- */
.toast { animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1); }

/* ---- Skeleton loader ---- */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-surface) 25%,
    var(--color-surface-hover) 50%,
    var(--color-surface) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

/* ---- Spinner ---- */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-full);
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* ---- Chart bar grow ---- */
.chart-bar {
  transform-origin: bottom;
  animation: growUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
.chart-bar:nth-child(1) { animation-delay: 0ms;    }
.chart-bar:nth-child(2) { animation-delay: 80ms;   }
.chart-bar:nth-child(3) { animation-delay: 160ms;  }
.chart-bar:nth-child(4) { animation-delay: 240ms;  }
.chart-bar:nth-child(5) { animation-delay: 320ms;  }
.chart-bar:nth-child(6) { animation-delay: 400ms;  }

/* ---- Pulse dot ---- */
.pulse-dot {
  width: 8px; height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-danger);
  animation: pulse 2s infinite;
}

/* ---- Float animation for empty state icon ---- */
.empty-state-icon {
  animation: float 3s ease-in-out infinite;
  display: inline-block;
}

/* ---- Card hover glow variant ---- */
.card-glow:hover {
  animation: glow 2s infinite;
}

/* ---- Number counter animation ---- */
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}
.count-animate { animation: countUp 0.45s ease; }

/* ---- Drag Over Indicator ---- */
.kanban-col-body.drag-over::after {
  content: '⬇ Bu yerga tashlang';
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  border: 2px dashed var(--color-primary);
  border-radius: var(--radius-md);
  color: var(--color-primary);
  font-size: 12.5px;
  font-weight: 600;
  margin-top: var(--space-2);
  animation: pulse 1.2s infinite;
}

/* ---- Nav link ripple ---- */
.nav-link {
  -webkit-tap-highlight-color: transparent;
}

/* ---- Modal fade-in for backdrop ---- */
.modal-overlay.open { animation: fadeIn 0.2s ease; }

/* ---- Sidebar overlay on mobile ---- */
.sidebar-backdrop {
  position: fixed; inset: 0; z-index: 290;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

/* ---- Transition helpers ---- */
.transition-all { transition: all var(--transition); }
.transition-colors { transition: color var(--transition), background var(--transition), border-color var(--transition); }

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