/* ==========================================================================
   Softzqua Labs — Micro-Animations & Tactile Motion Transitions
   Compliant with ui_design.text and Technical Design Specification
   ========================================================================== */

/* --------------------------------------------------------------------------
   Keyframes
   -------------------------------------------------------------------------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes subtlePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(35, 118, 234, 0.4);
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 0 4px rgba(35, 118, 234, 0);
    opacity: 0.85;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(35, 118, 234, 0);
    opacity: 1;
  }
}

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

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

@keyframes modalEnter {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

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

/* --------------------------------------------------------------------------
   Animation Utility Classes
   -------------------------------------------------------------------------- */
.animate-fade-in-up {
  animation: fadeInUp 0.35s ease-out forwards;
}

.animate-fade-in {
  animation: fadeIn 0.25s ease-out forwards;
}

/* Stagger Delays for Grid Elements */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }

/* Tactile Button & Element Transitions */
.btn, .btn-bouncy, .nav-link, .shortlink-pill, .card, .data-table tr {
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

/* Monochromatic Subtle Pulse on Active Status Pills */
.status-pulse, .badge-active {
  animation: subtlePulse 2.5s infinite ease-in-out;
}

/* Modal Animations */
.modal-overlay.is-open .modal-container {
  animation: modalEnter 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Toast Animations */
.toast-msg {
  animation: toastSlideIn 0.2s ease-out forwards;
}

.toast-msg.is-hiding {
  animation: toastSlideOut 0.2s ease-in forwards;
}

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.6s linear infinite;
}

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