/*
 * Notification bell, panel, modal queue and fault banner motion.
 * Curves and timings follow the approved notifications mock. Radix sets
 * data-state on each surface and waits for the exit animation before it
 * unmounts. Every utility in this build is !important, so these rules carry
 * !important and a body prefix to outrank the shadcn tw-animate classes.
 */
:root {
  --psfa-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --psfa-ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes psfa-nx-fade-in {
  from { opacity: 0; }
}

@keyframes psfa-nx-fade-out {
  to { opacity: 0; }
}

@keyframes psfa-nx-pop-in {
  from { opacity: 0; transform: scale(0.97) translateY(-4px); }
}

@keyframes psfa-nx-dialog-in {
  from { opacity: 0; transform: scale(0.96); }
}

@keyframes psfa-nx-dialog-out {
  to { opacity: 0; transform: scale(0.98); }
}

@keyframes psfa-nx-sheet-in {
  from { transform: translateY(100%); }
}

@keyframes psfa-nx-sheet-out {
  to { transform: translateY(100%); }
}

@keyframes psfa-nx-swap-in {
  from { opacity: 0; filter: blur(2px); transform: translateY(6px); }
}

@keyframes psfa-nx-swap-out {
  to { opacity: 0; filter: blur(2px); transform: translateY(-4px); }
}

@keyframes psfa-nx-badge-pop {
  from { transform: scale(0.6); }
}

body .psfa-nx-popover {
  transform-origin: var(--radix-popover-content-transform-origin) !important;
}
body .psfa-nx-popover[data-state="open"] {
  animation: psfa-nx-pop-in 180ms var(--psfa-ease-out) both !important;
}
body .psfa-nx-popover[data-state="closed"] {
  animation: psfa-nx-fade-out 120ms ease both !important;
}

body .psfa-nx-overlay--panel[data-state="open"] {
  animation: psfa-nx-fade-in 240ms ease both !important;
}
body .psfa-nx-overlay--panel[data-state="closed"] {
  animation: psfa-nx-fade-out 200ms ease both !important;
}
body .psfa-nx-sheet--panel[data-state="open"] {
  animation: psfa-nx-sheet-in 340ms var(--psfa-ease-drawer) both !important;
}
body .psfa-nx-sheet--panel[data-state="closed"] {
  animation: psfa-nx-sheet-out 220ms var(--psfa-ease-drawer) both !important;
}

body .psfa-nx-overlay--queue[data-state="open"] {
  animation: psfa-nx-fade-in 200ms ease both !important;
}
body .psfa-nx-overlay--queue[data-state="closed"] {
  animation: psfa-nx-fade-out 160ms ease both !important;
}
body .psfa-nx-dialog {
  transform-origin: 50% 40% !important;
}
body .psfa-nx-dialog[data-state="open"] {
  animation: psfa-nx-dialog-in 220ms var(--psfa-ease-out) both !important;
}
body .psfa-nx-dialog[data-state="closed"] {
  animation: psfa-nx-dialog-out 150ms ease-out both !important;
}
body .psfa-nx-sheet--queue[data-state="open"] {
  animation: psfa-nx-sheet-in 360ms var(--psfa-ease-drawer) both !important;
}
body .psfa-nx-sheet--queue[data-state="closed"] {
  animation: psfa-nx-sheet-out 220ms var(--psfa-ease-drawer) both !important;
}
@media (max-width: 781px) {
  body .psfa-nx-overlay--queue[data-state="open"] {
    animation-duration: 260ms !important;
  }
}

body .psfa-nx-swap-in {
  animation: psfa-nx-swap-in 220ms var(--psfa-ease-out) both;
}
body .psfa-nx-swap-out {
  animation: psfa-nx-swap-out 120ms ease-out both;
  pointer-events: none;
}

body .psfa-nx-badge-pop {
  animation: psfa-nx-badge-pop 260ms var(--psfa-ease-out);
}

#psfa-admin-root .psfa-nx-banner {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 220ms var(--psfa-ease-out), opacity 160ms ease;
}
#psfa-admin-root .psfa-nx-banner--gone {
  grid-template-rows: 0fr;
  opacity: 0;
}
#psfa-admin-root .psfa-nx-banner-in {
  animation: psfa-nx-fade-in 160ms ease both;
}

@media (prefers-reduced-motion: reduce) {
  body .psfa-nx-dialog[data-state="open"],
  body .psfa-nx-sheet--panel[data-state="open"],
  body .psfa-nx-sheet--queue[data-state="open"],
  body .psfa-nx-overlay--panel[data-state="open"],
  body .psfa-nx-overlay--queue[data-state="open"] {
    animation: psfa-nx-fade-in 160ms ease both !important;
  }
  body .psfa-nx-popover[data-state="open"] {
    animation: psfa-nx-fade-in 120ms ease both !important;
  }
  body .psfa-nx-popover[data-state="closed"],
  body .psfa-nx-sheet--panel[data-state="closed"],
  body .psfa-nx-overlay--panel[data-state="closed"] {
    animation: psfa-nx-fade-out 120ms ease both !important;
  }
  body .psfa-nx-dialog[data-state="closed"],
  body .psfa-nx-sheet--queue[data-state="closed"],
  body .psfa-nx-overlay--queue[data-state="closed"] {
    animation: psfa-nx-fade-out 150ms ease both !important;
  }
  body .psfa-nx-swap-in {
    animation: psfa-nx-fade-in 160ms ease both;
  }
  body .psfa-nx-swap-out {
    animation: psfa-nx-fade-out 120ms ease both;
  }
  body .psfa-nx-badge-pop {
    animation: none;
  }
  #psfa-admin-root .psfa-nx-banner {
    transition: none;
  }
}
