/* ========================================
   ZeaCargo — Animations & Transitions
   ======================================== */

/* =====================
   Keyframes
   ===================== */

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

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

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

@keyframes slideInLeft {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}

@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(108, 99, 255, 0.5); }
  70%  { box-shadow: 0 0 0 10px rgba(108, 99, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(108, 99, 255, 0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.05); }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

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

@keyframes bounce {
  0%, 100% { transform: translateY(0); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); }
  50%       { transform: translateY(-10px); animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
}

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

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(108, 99, 255, 0.2); }
  50%       { box-shadow: 0 0 40px rgba(108, 99, 255, 0.5); }
}

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

@keyframes counter-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes dash {
  to { stroke-dashoffset: 0; }
}

@keyframes blob {
  0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  50%       { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
}

/* =====================
   Utility Animation Classes
   ===================== */
.animate-fade-in    { animation: fadeIn 0.4s ease forwards; }
.animate-fade-up    { animation: fadeInUp 0.5s ease forwards; }
.animate-fade-down  { animation: fadeInDown 0.4s ease forwards; }
.animate-fade-left  { animation: fadeInLeft 0.4s ease forwards; }
.animate-fade-right { animation: fadeInRight 0.4s ease forwards; }
.animate-scale-in   { animation: scaleIn 0.35s ease forwards; }
.animate-float      { animation: float 4s ease-in-out infinite; }
.animate-pulse      { animation: pulse 2s ease infinite; }
.animate-spin       { animation: spin 1s linear infinite; }
.animate-bounce     { animation: bounce 1.5s infinite; }
.animate-glow       { animation: glow-pulse 2s ease infinite; }

/* Staggered delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }

/* =====================
   Page Entry Animations
   ===================== */
.page-enter {
  animation: fadeInUp 0.5s ease forwards;
}

.stagger-children > * {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}

.stagger-children > *:nth-child(1)  { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2)  { animation-delay: 0.10s; }
.stagger-children > *:nth-child(3)  { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4)  { animation-delay: 0.20s; }
.stagger-children > *:nth-child(5)  { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6)  { animation-delay: 0.30s; }
.stagger-children > *:nth-child(7)  { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8)  { animation-delay: 0.40s; }

/* =====================
   Hover Effects
   ===================== */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.hover-scale {
  transition: transform var(--transition-fast);
}

.hover-scale:hover {
  transform: scale(1.03);
}

.hover-glow {
  transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
  box-shadow: var(--shadow-glow);
}

/* =====================
   Gradient Text
   ===================== */
.gradient-text {
  background: linear-gradient(135deg, var(--primary-light) 0%, #A78BFA 40%, var(--accent-light) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  animation: gradient-shift 4s ease infinite;
}

.gradient-text-static {
  background: linear-gradient(135deg, var(--primary-light) 0%, #A78BFA 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* =====================
   Background Blobs
   ===================== */
.blob {
  position: absolute;
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  filter: blur(60px);
  animation: blob 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.blob-primary {
  background: rgba(108, 99, 255, 0.15);
  animation-delay: 0s;
}

.blob-accent {
  background: rgba(245, 158, 11, 0.08);
  animation-delay: -3s;
}

.blob-success {
  background: rgba(16, 185, 129, 0.06);
  animation-delay: -5s;
}

/* =====================
   Shimmer / Loading Effect
   ===================== */
.shimmer {
  background: linear-gradient(
    90deg,
    var(--bg-elevated) 0%,
    var(--bg-hover) 50%,
    var(--bg-elevated) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* =====================
   Spinner
   ===================== */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-default);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.spinner-sm {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

.spinner-lg {
  width: 36px;
  height: 36px;
  border-width: 3px;
}

/* =====================
   Gradient Borders
   ===================== */
.gradient-border {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--primary), transparent, var(--accent));
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  pointer-events: none;
}

/* =====================
   Mesh Background
   ===================== */
.mesh-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.mesh-bg::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(108, 99, 255, 0.12) 0%, transparent 70%);
  top: -200px;
  left: -100px;
  animation: float 8s ease-in-out infinite;
}

.mesh-bg::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.06) 0%, transparent 70%);
  bottom: -150px;
  right: -100px;
  animation: float 10s ease-in-out infinite reverse;
}

/* =====================
   Number Counter
   ===================== */
.counter {
  display: inline-block;
  animation: counter-up 0.5s ease forwards;
}

/* =====================
   Transition Overrides
   ===================== */
* {
  scroll-behavior: smooth;
}

.transition-none { transition: none !important; }
.transition-fast { transition: all var(--transition-fast) !important; }
.transition-base { transition: all var(--transition-base) !important; }
.transition-slow { transition: all var(--transition-slow) !important; }

/* =====================
   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;
  }
}
