/* ══════════════════════════════════════════════════════════
   PIPELINETRACK — animations.css
   All keyframes and animation utility classes.
   Loaded after the other CSS files so selectors here win.
   ══════════════════════════════════════════════════════════ */

/* ─── View crossfade ────────────────────────────────────── */
@keyframes viewFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

.view-enter {
  animation: viewFadeIn 0.22s ease forwards;
}

/* ─── Modal slide-up entrance ───────────────────────────── */
@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.97);
  }

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

/* Fires whenever the modal becomes .open */
.modal-overlay.open .modal {
  animation: modalSlideUp 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ─── Kanban card stagger entrance ─────────────────────── */
@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

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

.card-enter {
  opacity: 0;
  animation: cardSlideIn 0.28s ease forwards;
}

/* ─── Skill tag pop-in ──────────────────────────────────── */
@keyframes skillPop {
  0% {
    opacity: 0;
    transform: scale(0.4);
  }

  65% {
    transform: scale(1.18);
  }

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

.skill-pop {
  animation: skillPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ─── Stat value reveal ─────────────────────────────────── */
@keyframes statReveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

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

.stat-reveal {
  animation: statReveal 0.38s ease forwards;
}

/* ─── Pipeline / coverage bar fill ─────────────────────── */
/* The bars already have `transition: width .4s` in their
   own files; animations.js resets them to 0 then lets the
   transition play — no extra keyframes needed here.        */

/* ─── Stat card hover lift ──────────────────────────────── */
.stat-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* ─── Deadline banner pulse (urgent state only) ─────────── */
@keyframes deadlinePulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }

  50% {
    box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.18);
  }
}

.deadline-banner.deadline-banner--urgent {
  animation: deadlinePulse 2.4s ease-in-out infinite;
}

/* ─── Calendar view transitions ─────────────────────────── */
@keyframes calFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes calSlideFromRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }

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

@keyframes calSlideFromLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }

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

#cal-view-body.cal-anim-fade {
  animation: calFadeIn 0.22s ease;
}

#cal-view-body.cal-anim-from-right {
  animation: calSlideFromRight 0.22s ease;
}

#cal-view-body.cal-anim-from-left {
  animation: calSlideFromLeft 0.22s ease;
}

/* ─── Profile Skills filter animations ──────────────────── */

/* Exit: container fades + collapses upward slightly */
@keyframes skillFilterExit {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
}

#skill-tags-container.skill-filter-exit {
  animation: skillFilterExit 0.11s ease forwards;
  pointer-events: none;
}

/* Entrance: each pill pops in with spring + stagger */
@keyframes skillPillIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.88);
  }

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

#skill-tags-container .skill-tag {
  animation: skillPillIn 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--skill-i, 0) * 30ms);
}

/* Group labels slide in a touch faster */
@keyframes skillLabelIn {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }

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

#skill-tags-container .skill-group-label {
  animation: skillLabelIn 0.18s ease both;
  animation-delay: calc(var(--skill-i, 0) * 40ms);
}

/* ─── Compare Jobs animations ───────────────────────────── */
@keyframes compareColIn {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.97);
  }

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

.compare-col-enter {
  animation: compareColIn 0.34s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes compareViewOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(-18px);
  }
}

@keyframes compareViewIn {
  from {
    opacity: 0;
    transform: translateX(18px);
  }

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

.compare-view-in {
  animation: compareViewIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes comparePickerItemIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }

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

.compare-picker-item {
  animation: comparePickerItemIn 0.2s ease both;
}

/* --- Theme change flourish -------------------------------- */
body,
.sidebar,
.topbar,
.view,
.modal,
.stat-card,
.dash-card,
.job-card,
.text-input,
.text-area,
.select-input,
.btn-primary,
.btn-secondary,
.btn-ghost,
.nav-link,
.scope-notice {
  transition:
    background-color 0.32s ease,
    border-color 0.32s ease,
    color 0.32s ease,
    box-shadow 0.32s ease,
    filter 0.32s ease,
    opacity 0.2s ease,
    transform 0.2s ease;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at calc(100% - 92px) 34px,
      color-mix(in srgb, var(--accent) 42%, transparent) 0 9%,
      color-mix(in srgb, var(--accent-dim) 54%, transparent) 24%,
      transparent 58%);
  transform: scale(0.72);
  transform-origin: top right;
}

html.theme-shift body::before {
  animation: themeSweep 0.68s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

html.theme-shift .main,
html.theme-shift .sidebar {
  animation: themeSettle 0.46s ease-out both;
}

.theme-shift-pop {
  animation: themeControlPop 0.46s cubic-bezier(0.2, 1.45, 0.32, 1) both;
}


html.theme-motion-off.theme-shift body::before,
html.theme-motion-off.theme-shift .main,
html.theme-motion-off.theme-shift .sidebar,
html.theme-motion-off .theme-shift-pop {
  animation: none !important;
}

@keyframes themeSweep {
  0% {
    opacity: 0;
    transform: scale(0.58);
  }

  35% {
    opacity: 0.9;
  }

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

@keyframes themeSettle {
  0% {
    filter: saturate(1.18) brightness(1.06);
  }

  100% {
    filter: saturate(1) brightness(1);
  }
}

@keyframes themeControlPop {
  0% {
    transform: scale(1) rotate(0deg);
  }

  45% {
    transform: scale(1.22) rotate(8deg);
  }

  100% {
    transform: scale(1) rotate(0deg);
  }
}

@media (prefers-reduced-motion: reduce) {

  body,
  .sidebar,
  .topbar,
  .view,
  .modal,
  .stat-card,
  .dash-card,
  .job-card,
  .text-input,
  .text-area,
  .select-input,
  .btn-primary,
  .btn-secondary,
  .btn-ghost,
  .nav-link,
  .scope-notice {
    transition-duration: 0.01ms;
  }

  html.theme-shift body::before,
  html.theme-shift .main,
  html.theme-shift .sidebar,
  .theme-shift-pop {
    animation: none;
  }
}