/* =============================================================
   ANIMATIONS.CSS — Zxingtech Website Animation Library
   ============================================================= */

/* ==================== KEYFRAMES ==================== */

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

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

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

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

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

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

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

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 16px rgba(200,155,60,0.3); }
  50%       { box-shadow: 0 0 40px rgba(200,155,60,0.65), 0 0 80px rgba(200,155,60,0.2); }
}

@keyframes glowPulseCyan {
  0%, 100% { box-shadow: 0 0 16px rgba(11,196,227,0.3); }
  50%       { box-shadow: 0 0 40px rgba(11,196,227,0.6), 0 0 80px rgba(11,196,227,0.15); }
}

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

@keyframes floatReverse {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50%       { transform: translateY(10px) rotate(3deg); }
}

@keyframes borderGlow {
  0%, 100% { border-color: rgba(200,155,60,0.2); }
  50%       { border-color: rgba(200,155,60,0.7); }
}

@keyframes scrollPulse {
  0%   { transform: scaleY(0); transform-origin: top; opacity: 1; }
  50%  { transform: scaleY(1); transform-origin: top; opacity: 1; }
  100% { transform: scaleY(1); transform-origin: bottom; opacity: 0; }
}

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

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

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

@keyframes drawLine {
  from { stroke-dashoffset: 1000; }
  to   { stroke-dashoffset: 0; }
}

@keyframes shimmerSweep {
  from { left: -100%; }
  to   { left: 200%; }
}

@keyframes particleFloat {
  0%   { transform: translateY(0) translateX(0) scale(1); opacity: 0.8; }
  25%  { transform: translateY(-20px) translateX(10px) scale(1.1); opacity: 1; }
  50%  { transform: translateY(-10px) translateX(-10px) scale(0.9); opacity: 0.7; }
  75%  { transform: translateY(-30px) translateX(5px) scale(1.05); opacity: 0.9; }
  100% { transform: translateY(0) translateX(0) scale(1); opacity: 0.8; }
}

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

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

@keyframes countNumber {
  from { content: '0'; }
  to   { content: attr(data-target); }
}

@keyframes progressBar {
  from { width: 0; }
  to   { width: var(--progress); }
}

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

@keyframes ripple {
  0%   { transform: scale(0); opacity: 1; }
  100% { transform: scale(4); opacity: 0; }
}

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

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

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

@keyframes slideInFromRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ==================== UTILITY ANIMATION CLASSES ==================== */
.anim-fade-in        { animation: fadeIn 0.6s ease forwards; }
.anim-fade-in-up     { animation: fadeInUp 0.7s ease forwards; }
.anim-fade-in-down   { animation: fadeInDown 0.7s ease forwards; }
.anim-fade-in-left   { animation: fadeInLeft 0.7s ease forwards; }
.anim-fade-in-right  { animation: fadeInRight 0.7s ease forwards; }
.anim-scale-in       { animation: scaleIn 0.6s cubic-bezier(.34,1.56,.64,1) forwards; }
.anim-float          { animation: float 4s ease-in-out infinite; }
.anim-float-slow     { animation: float 6s ease-in-out infinite; }
.anim-float-reverse  { animation: floatReverse 5s ease-in-out infinite; }
.anim-glow-pulse     { animation: glowPulse 2.5s ease-in-out infinite; }
.anim-glow-pulse-cyan{ animation: glowPulseCyan 2.5s ease-in-out infinite; }
.anim-border-glow    { animation: borderGlow 3s ease-in-out infinite; }

/* Delay helpers */
.anim-delay-100 { animation-delay: 0.1s; }
.anim-delay-200 { animation-delay: 0.2s; }
.anim-delay-300 { animation-delay: 0.3s; }
.anim-delay-400 { animation-delay: 0.4s; }
.anim-delay-500 { animation-delay: 0.5s; }
.anim-delay-600 { animation-delay: 0.6s; }
.anim-delay-700 { animation-delay: 0.7s; }
.anim-delay-800 { animation-delay: 0.8s; }
.anim-delay-1000{ animation-delay: 1.0s; }
.anim-delay-1200{ animation-delay: 1.2s; }

/* ==================== HOVER EFFECTS ==================== */

/* Shimmer sweep on hover */
.hover-shimmer {
  position: relative;
  overflow: hidden;
}
.hover-shimmer::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 60px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  left: -100%;
  transition: none;
}
.hover-shimmer:hover::after {
  animation: shimmerSweep 0.6s ease forwards;
}

/* Scale on hover */
.hover-scale { transition: transform 0.3s cubic-bezier(.4,0,.2,1); }
.hover-scale:hover { transform: scale(1.04); }

/* Lift on hover */
.hover-lift { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

/* Glow on hover */
.hover-glow { transition: box-shadow 0.3s ease; }
.hover-glow:hover { box-shadow: 0 0 30px rgba(200,155,60,0.4); }

/* ==================== LOADING / SKELETON ==================== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, rgba(200,155,60,0.05) 50%, var(--bg-card) 75%);
  background-size: 400% 100%;
  animation: bgPan 1.8s ease infinite;
  border-radius: 4px;
}

/* ==================== HERO PARTICLE CANVAS GLOW ==================== */
.hero-glow-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(60px);
  opacity: 0;
  animation: fadeIn 1.5s 0.5s forwards;
}
.hero-glow-orb--gold {
  width: 500px;
  height: 400px;
  background: radial-gradient(circle, rgba(200,155,60,0.12), transparent 70%);
}
.hero-glow-orb--cyan {
  width: 400px;
  height: 300px;
  background: radial-gradient(circle, rgba(11,196,227,0.10), transparent 70%);
}

/* ==================== SECTION DIAGONAL DIVIDERS ==================== */
.section-clip-top {
  clip-path: polygon(0 5%, 100% 0, 100% 100%, 0 100%);
  margin-top: -3vw;
  padding-top: calc(3vw + 5rem);
}
.section-clip-bottom {
  clip-path: polygon(0 0, 100% 0, 100% 95%, 0 100%);
  padding-bottom: calc(3vw + 5rem);
  margin-bottom: -3vw;
}
.section-clip-both {
  clip-path: polygon(0 3%, 100% 0, 100% 97%, 0 100%);
  margin: -2vw 0;
  padding: calc(2vw + 6rem) 0;
}

/* ==================== ANIMATED BORDER ==================== */
.border-animated {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}
.border-animated::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: conic-gradient(
    from var(--angle, 0deg),
    transparent 0deg,
    var(--gold) 60deg,
    transparent 120deg
  );
  border-radius: 14px;
  z-index: -1;
  animation: hexSpin 4s linear infinite;
}
.border-animated::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg-card);
  border-radius: 12px;
  z-index: -1;
}

/* ==================== PROGRESS BARS ==================== */
.progress-bar-wrap {
  background: rgba(200,155,60,0.1);
  border-radius: 100px;
  height: 6px;
  overflow: hidden;
  margin-top: 0.5rem;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 100px;
  width: 0;
  transition: width 1.2s cubic-bezier(.25,.46,.45,.94);
}
.progress-bar-fill.animate { width: var(--progress, 70%); }

/* ==================== TYPEWRITER EFFECT ==================== */
.typewriter {
  overflow: hidden;
  border-right: 2px solid var(--gold);
  white-space: nowrap;
  animation: typewriter 2s steps(30,end) forwards, blink 0.8s step-end infinite;
  display: inline-block;
}

/* ==================== RIPPLE EFFECT ==================== */
.ripple-container { position: relative; overflow: hidden; }
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(200,155,60,0.25);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

/* ==================== SCROLL PROGRESS BAR ==================== */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--cyan));
  z-index: 9999;
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(200,155,60,0.6);
}

/* ==================== TOOLTIP ==================== */
[data-tooltip] {
  position: relative;
  cursor: default;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--gold-border);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 100;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ==================== IMAGE ZOOM ==================== */
.img-zoom-wrap { overflow: hidden; border-radius: var(--radius-lg); }
.img-zoom-wrap img {
  transition: transform 0.6s cubic-bezier(.4,0,.2,1);
  display: block;
  width: 100%;
}
.img-zoom-wrap:hover img { transform: scale(1.06); }

/* ==================== STAGGER ANIMATIONS ==================== */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.stagger-children.in-view > *:nth-child(1) { opacity: 1; transform: none; transition-delay: 0.05s; }
.stagger-children.in-view > *:nth-child(2) { opacity: 1; transform: none; transition-delay: 0.15s; }
.stagger-children.in-view > *:nth-child(3) { opacity: 1; transform: none; transition-delay: 0.25s; }
.stagger-children.in-view > *:nth-child(4) { opacity: 1; transform: none; transition-delay: 0.35s; }
.stagger-children.in-view > *:nth-child(5) { opacity: 1; transform: none; transition-delay: 0.45s; }
.stagger-children.in-view > *:nth-child(6) { opacity: 1; transform: none; transition-delay: 0.55s; }
.stagger-children.in-view > *:nth-child(n+7) { opacity: 1; transform: none; transition-delay: 0.65s; }
