/* ═══════════════════════════════════════════════════════════════════════════
   TRUESOFT UNIFIED DESIGN SYSTEM - ANIMATION & MOTION
   Micro-interactions, Transitions, and Smooth Motions
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('../tokens/design-tokens.css');

/* ─────────────────────────────────────────────────────────────────────────
   BLOB & MORPH ANIMATIONS (Hero Background)
   ───────────────────────────────────────────────────────────────────────── */

@keyframes blob-morph {
  0% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    transform: translate(0px, 0px) scale(1);
  }
  34% {
    border-radius: 70% 30% 66% 33% / 33% 66% 33% 67%;
    transform: translate(30px, -50px) scale(1.1);
  }
  67% {
    border-radius: 100% 60% 66% 33% / 33% 100% 66% 33%;
    transform: translate(-20px, 30px) scale(0.9);
  }
  100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    transform: translate(0px, 0px) scale(1);
  }
}

@keyframes blob-float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes blob-rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.blob-morphing {
  animation: blob-morph 8s infinite cubic-bezier(0.6, 0.2, 0.2, 0.8);
}

.blob-floating {
  animation: blob-float 6s ease-in-out infinite;
}

.blob-rotating {
  animation: blob-rotate 20s linear infinite;
}

/* ─────────────────────────────────────────────────────────────────────────
   GRADIENT ANIMATIONS
   ───────────────────────────────────────────────────────────────────────── */

@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes gradient-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(74, 126, 255, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(74, 126, 255, 0.6);
  }
}

.gradient-animated {
  background-size: 200% 200%;
  animation: gradient-shift 6s ease infinite;
}

.glow-pulse {
  animation: gradient-glow 3s ease-in-out infinite;
}

/* ─────────────────────────────────────────────────────────────────────────
   ENTRANCE ANIMATIONS
   ───────────────────────────────────────────────────────────────────────── */

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in-down {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in-left {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fade-in-right {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slide-up {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slide-down {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Animation Classes */
.animate-fade-in {
  animation: fade-in var(--ts-duration-500) var(--ts-timing-ease-out);
}

.animate-fade-in-up {
  animation: fade-in-up var(--ts-duration-500) var(--ts-timing-ease-out);
}

.animate-fade-in-down {
  animation: fade-in-down var(--ts-duration-500) var(--ts-timing-ease-out);
}

.animate-fade-in-left {
  animation: fade-in-left var(--ts-duration-500) var(--ts-timing-ease-out);
}

.animate-fade-in-right {
  animation: fade-in-right var(--ts-duration-500) var(--ts-timing-ease-out);
}

.animate-scale-in {
  animation: scale-in var(--ts-duration-500) var(--ts-timing-ease-out);
}

.animate-slide-up {
  animation: slide-up var(--ts-duration-500) var(--ts-timing-ease-out);
}

.animate-slide-down {
  animation: slide-down var(--ts-duration-500) var(--ts-timing-ease-out);
}

/* ─────────────────────────────────────────────────────────────────────────
   HOVER & INTERACTIVE ANIMATIONS
   ───────────────────────────────────────────────────────────────────────── */

@keyframes lift-up {
  to {
    transform: translateY(-8px);
  }
}

@keyframes scale-up {
  to {
    transform: scale(1.05);
  }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(74, 126, 255, 0.7);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(74, 126, 255, 0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes rotate-in {
  from {
    opacity: 0;
    transform: rotate(-10deg) scale(0.95);
  }
  to {
    opacity: 1;
    transform: rotate(0) scale(1);
  }
}

.hover-lift:hover {
  animation: lift-up var(--ts-duration-300) var(--ts-timing-ease-out) forwards;
}

.hover-scale:hover {
  animation: scale-up var(--ts-duration-300) var(--ts-timing-ease-out) forwards;
}

.pulse-animation {
  animation: pulse-glow 2s infinite;
}

.bounce-animation {
  animation: bounce var(--ts-duration-1000) ease-in-out infinite;
}

.shimmer-loading {
  background: linear-gradient(90deg, var(--ts-bg-tertiary) 25%, var(--ts-bg-secondary) 50%, var(--ts-bg-tertiary) 75%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* ─────────────────────────────────────────────────────────────────────────
   SCROLL-TRIGGERED ANIMATIONS
   ───────────────────────────────────────────────────────────────────────── */

@keyframes float-up {
  0% {
    opacity: 0;
    transform: translateY(40px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float-left {
  0% {
    opacity: 0;
    transform: translateX(-40px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes float-right {
  0% {
    opacity: 0;
    transform: translateX(40px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.scroll-animate {
  opacity: 0;
  transition: opacity var(--ts-duration-500) var(--ts-timing-ease-out),
              transform var(--ts-duration-500) var(--ts-timing-ease-out);
}

.scroll-animate.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ─────────────────────────────────────────────────────────────────────────
   BUTTON ANIMATIONS
   ───────────────────────────────────────────────────────────────────────── */

@keyframes button-shine {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

.btn-shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: button-shine 0.6s ease-in-out;
}

@keyframes button-pop {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.btn:active {
  animation: button-pop 0.3s var(--ts-timing-ease-out);
}

/* ─────────────────────────────────────────────────────────────────────────
   LOADING ANIMATIONS
   ───────────────────────────────────────────────────────────────────────── */

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

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes dots-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-10px);
  }
}

.spinner {
  animation: spin 1s linear infinite;
}

.pulse-dot {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.loader-dots span {
  animation: dots-bounce 1.4s ease-in-out infinite;
}

.loader-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.loader-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

/* ─────────────────────────────────────────────────────────────────────────
   PARALLAX & DEPTH EFFECTS
   ───────────────────────────────────────────────────────────────────────── */

@keyframes parallax-slow {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(50px);
  }
}

@keyframes parallax-fast {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-50px);
  }
}

.parallax-slow {
  animation: parallax-slow 20s ease-in-out infinite alternate;
}

.parallax-fast {
  animation: parallax-fast 15s ease-in-out infinite alternate;
}

/* ─────────────────────────────────────────────────────────────────────────
   MODAL & OVERLAY ANIMATIONS
   ───────────────────────────────────────────────────────────────────────── */

@keyframes modal-slide-in {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes backdrop-fade-in {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(4px);
  }
}

.modal-animated {
  animation: modal-slide-in var(--ts-duration-300) var(--ts-timing-ease-out);
}

.modal-backdrop {
  animation: backdrop-fade-in var(--ts-duration-300) var(--ts-timing-ease-out);
}

/* ─────────────────────────────────────────────────────────────────────────
   STAGGER ANIMATION (for lists/grids)
   ───────────────────────────────────────────────────────────────────────── */

.stagger-item {
  animation: fade-in-up var(--ts-duration-500) var(--ts-timing-ease-out) both;
}

.stagger-item:nth-child(1) { animation-delay: 0ms; }
.stagger-item:nth-child(2) { animation-delay: 100ms; }
.stagger-item:nth-child(3) { animation-delay: 200ms; }
.stagger-item:nth-child(4) { animation-delay: 300ms; }
.stagger-item:nth-child(5) { animation-delay: 400ms; }
.stagger-item:nth-child(6) { animation-delay: 500ms; }
.stagger-item:nth-child(7) { animation-delay: 600ms; }
.stagger-item:nth-child(8) { animation-delay: 700ms; }

/* ─────────────────────────────────────────────────────────────────────────
   TRANSITION UTILITIES
   ───────────────────────────────────────────────────────────────────────── */

.transition-fast {
  transition: all var(--ts-duration-150) var(--ts-timing-ease-in-out);
}

.transition-normal {
  transition: all var(--ts-duration-300) var(--ts-timing-ease-in-out);
}

.transition-slow {
  transition: all var(--ts-duration-700) var(--ts-timing-ease-in-out);
}

/* ─────────────────────────────────────────────────────────────────────────
   DARK MODE ANIMATIONS
   ───────────────────────────────────────────────────────────────────────── */

@media (prefers-color-scheme: dark) {
  @keyframes glow-dark {
    0%, 100% {
      box-shadow: 0 0 20px rgba(74, 126, 255, 0.5);
    }
    50% {
      box-shadow: 0 0 40px rgba(74, 126, 255, 0.8);
    }
  }

  .dark-glow {
    animation: glow-dark 3s ease-in-out infinite;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   PREFETCH ANIMATIONS (for performance)
   ───────────────────────────────────────────────────────────────────────── */

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