/* =========================================
   ANIMATIONS STYLESHEET
   Supplementary animations & keyframes
   ========================================= */

/* ---- Typewriter Effect ---- */
.typewriter {
  overflow: hidden;
  white-space: nowrap;
  border-right: 3px solid var(--accent-cyan);
  animation: typing 3.5s steps(40) 1s forwards, blink-caret 0.75s step-end infinite;
  width: 0;
}

@keyframes typing {
  from { width: 0; }
  to   { width: 100%; }
}

@keyframes blink-caret {
  0%, 100% { border-color: var(--accent-cyan); }
  50%       { border-color: transparent; }
}

/* ---- Floating Animation ---- */
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%       { transform: translateY(-15px) rotate(1deg); }
  66%       { transform: translateY(-8px) rotate(-1deg); }
}

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

.floating-delay-1 { animation-delay: -2s; }
.floating-delay-2 { animation-delay: -4s; }

/* ---- Pulse Animation ---- */
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.05); opacity: 0.8; }
}

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

/* ---- Spin Animation ---- */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.spin-slow { animation: spin-slow 20s linear infinite; }
.spin-reverse { animation: spin-slow 15s linear infinite reverse; }

/* ---- Gradient Text Shift ---- */
@keyframes gradient-text-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animated-gradient-text {
  background: linear-gradient(270deg, #00E5FF, #38BDF8, #7C3AED, #00E5FF);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-text-shift 6s ease infinite;
}

/* ---- Glitch Effect ---- */
@keyframes glitch-1 {
  0%, 100% { clip-path: inset(0 0 90% 0); transform: translate(-4px); }
  20%       { clip-path: inset(10% 0 80% 0); transform: translate(4px); }
  40%       { clip-path: inset(30% 0 60% 0); transform: translate(-4px); }
  60%       { clip-path: inset(50% 0 40% 0); transform: translate(4px); }
  80%       { clip-path: inset(70% 0 20% 0); transform: translate(-4px); }
}

/* ---- Neon Glow Pulse ---- */
@keyframes neon-pulse {
  0%, 100% {
    text-shadow: 0 0 5px var(--accent-cyan), 0 0 10px var(--accent-cyan);
  }
  50% {
    text-shadow:
      0 0 10px var(--accent-cyan),
      0 0 30px var(--accent-cyan),
      0 0 60px var(--accent-cyan);
  }
}

.neon-text { animation: neon-pulse 3s ease-in-out infinite; }

/* ---- Card hover shine effect ---- */
.shine {
  position: relative;
  overflow: hidden;
}

.shine::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -75%;
  width: 50%;
  height: 200%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,0.05),
    transparent
  );
  transform: skewX(-25deg);
  transition: left 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.shine:hover::after { left: 125%; }

/* ---- Scale in animation ---- */
@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.scale-in { animation: scale-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; }

/* ---- Slide in from bottom ---- */
@keyframes slide-up {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.slide-up { animation: slide-up 0.7s cubic-bezier(0.4, 0, 0.2, 1) both; }

/* ---- Fade in ---- */
@keyframes fade-in-anim {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.fade-in-anim { animation: fade-in-anim 0.8s ease both; }

/* ---- Progress bar animation ---- */
@keyframes progress-load {
  from { width: 0%; }
}

/* ---- Counter number roll ---- */
@keyframes count-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

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

.morphing-blob {
  animation: morph 8s ease-in-out infinite;
}

/* ---- Loading shimmer ---- */
@keyframes skeleton-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.5s ease infinite;
  border-radius: var(--radius-md);
}

/* ---- Rotating gradient border ---- */
@keyframes rotate-gradient {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.rotating-border {
  position: relative;
}

.rotating-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: conic-gradient(
    from 0deg,
    var(--accent-cyan),
    var(--accent-violet),
    var(--accent-blue),
    var(--accent-cyan)
  );
  z-index: -1;
  animation: rotate-gradient 4s linear infinite;
}

.rotating-border::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: var(--bg-primary);
  z-index: -1;
}

/* ---- Letter by letter animation ---- */
.letter-animate span {
  display: inline-block;
  animation: letter-drop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes letter-drop {
  from {
    opacity: 0;
    transform: translateY(-20px) rotateX(90deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0);
  }
}

/* ---- Page transition ---- */
.page-transition {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
  z-index: 99999;
  transform: translateX(100%);
  transition: transform 0.6s cubic-bezier(0.76, 0, 0.24, 1);
  pointer-events: none;
}

.page-transition.entering { transform: translateX(0); }
.page-transition.leaving  { transform: translateX(-100%); }

/* ---- Stats animated number ---- */
.stat-number {
  display: inline-block;
  clip-path: inset(0);
}

/* ---- Marquee slow ---- */
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.marquee-track {
  animation: marquee 40s linear infinite;
}

.marquee-track:hover {
  animation-play-state: paused;
}

/* ---- Icon spin on hover ---- */
.icon-hover-spin {
  display: inline-block;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.icon-hover-spin:hover {
  transform: rotate(20deg) scale(1.2);
}

/* ---- Success checkmark draw ---- */
@keyframes draw-check {
  from {
    stroke-dashoffset: 100;
    opacity: 0;
  }
  to {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

.checkmark-path {
  stroke-dasharray: 100;
  animation: draw-check 0.6s ease forwards;
}

/* ---- Notification badge pulse ---- */
@keyframes badge-pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.2); }
}

.badge-pulse { animation: badge-pulse 2s ease infinite; }

/* ---- Viewport height fix for mobile ---- */
.vh-fix { min-height: calc(var(--vh, 1vh) * 100); }
