/* =========================================
   HELIQ MSP COMPLETE — Animations
   Scroll triggers, particles, effects
   ========================================= */

/* ===== SCROLL REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays for children */
.stagger-children > *:nth-child(1) { transition-delay: 0ms; }
.stagger-children > *:nth-child(2) { transition-delay: 80ms; }
.stagger-children > *:nth-child(3) { transition-delay: 160ms; }
.stagger-children > *:nth-child(4) { transition-delay: 240ms; }
.stagger-children > *:nth-child(5) { transition-delay: 320ms; }
.stagger-children > *:nth-child(6) { transition-delay: 400ms; }
.stagger-children > *:nth-child(7) { transition-delay: 480ms; }
.stagger-children > *:nth-child(8) { transition-delay: 560ms; }

/* ===== FLOATING PARTICLES ===== */
.particles-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--cyan);
  opacity: 0;
  animation: particleFloat linear infinite;
}

@keyframes particleFloat {
  0% {
    opacity: 0;
    transform: translateY(100vh) scale(0);
  }
  10% {
    opacity: 0.6;
    transform: translateY(90vh) scale(1);
  }
  90% {
    opacity: 0.2;
  }
  100% {
    opacity: 0;
    transform: translateY(-10vh) scale(0.5) rotate(360deg);
  }
}

/* Generate particle positions via CSS custom props */
.particle:nth-child(1)  { left: 8%;   width: 3px; height: 3px; animation-duration: 18s; animation-delay: 0s;   background: #00D4FF; }
.particle:nth-child(2)  { left: 16%;  width: 2px; height: 2px; animation-duration: 22s; animation-delay: -3s;  background: #7C3AED; }
.particle:nth-child(3)  { left: 24%;  width: 4px; height: 4px; animation-duration: 15s; animation-delay: -7s;  background: #00D4FF; }
.particle:nth-child(4)  { left: 32%;  width: 2px; height: 2px; animation-duration: 20s; animation-delay: -1s;  background: #7C3AED; }
.particle:nth-child(5)  { left: 40%;  width: 3px; height: 3px; animation-duration: 25s; animation-delay: -5s;  background: #00D4FF; }
.particle:nth-child(6)  { left: 48%;  width: 2px; height: 2px; animation-duration: 17s; animation-delay: -9s;  background: #7C3AED; }
.particle:nth-child(7)  { left: 56%;  width: 4px; height: 4px; animation-duration: 21s; animation-delay: -2s;  background: #00D4FF; }
.particle:nth-child(8)  { left: 64%;  width: 2px; height: 2px; animation-duration: 19s; animation-delay: -6s;  background: #7C3AED; }
.particle:nth-child(9)  { left: 72%;  width: 3px; height: 3px; animation-duration: 23s; animation-delay: -4s;  background: #00D4FF; }
.particle:nth-child(10) { left: 80%;  width: 2px; height: 2px; animation-duration: 16s; animation-delay: -8s;  background: #7C3AED; }
.particle:nth-child(11) { left: 88%;  width: 3px; height: 3px; animation-duration: 24s; animation-delay: -11s; background: #00D4FF; }
.particle:nth-child(12) { left: 96%;  width: 2px; height: 2px; animation-duration: 18s; animation-delay: -13s; background: #7C3AED; }
.particle:nth-child(13) { left: 12%;  width: 3px; height: 3px; animation-duration: 26s; animation-delay: -14s; background: #00D4FF; opacity: 0; }
.particle:nth-child(14) { left: 36%;  width: 2px; height: 2px; animation-duration: 20s; animation-delay: -16s; background: #7C3AED; opacity: 0; }
.particle:nth-child(15) { left: 60%;  width: 4px; height: 4px; animation-duration: 22s; animation-delay: -18s; background: #00D4FF; opacity: 0; }
.particle:nth-child(16) { left: 84%;  width: 2px; height: 2px; animation-duration: 28s; animation-delay: -20s; background: #7C3AED; opacity: 0; }
.particle:nth-child(17) { left: 4%;   width: 3px; height: 3px; animation-duration: 15s; animation-delay: -10s; background: #00D4FF; }
.particle:nth-child(18) { left: 20%;  width: 2px; height: 2px; animation-duration: 19s; animation-delay: -12s; background: #7C3AED; }
.particle:nth-child(19) { left: 44%;  width: 3px; height: 3px; animation-duration: 23s; animation-delay: -15s; background: #00D4FF; }
.particle:nth-child(20) { left: 76%;  width: 2px; height: 2px; animation-duration: 17s; animation-delay: -17s; background: #7C3AED; }

/* ===== GRADIENT MESH BACKGROUND ===== */
.gradient-mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0,212,255,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(124,58,237,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 0%,  rgba(0,212,255,0.06) 0%, transparent 50%);
  animation: meshShift 12s ease-in-out infinite;
}

@keyframes meshShift {
  0%, 100% { opacity: 1; transform: scale(1); }
  33%  { opacity: 0.8; transform: scale(1.02) rotate(0.5deg); }
  66%  { opacity: 1;   transform: scale(0.98) rotate(-0.5deg); }
}

/* ===== GLOWING BORDER ANIMATION ===== */
@keyframes glowBorder {
  0%, 100% { box-shadow: 0 0 20px rgba(0,212,255,0.2); border-color: rgba(0,212,255,0.3); }
  50%       { box-shadow: 0 0 40px rgba(0,212,255,0.4); border-color: rgba(0,212,255,0.6); }
}

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

/* ===== SHIMMER EFFECT ===== */
.shimmer {
  position: relative;
  overflow: hidden;
}

.shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.04) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  animation: shimmerAnim 3s ease-in-out infinite;
}

@keyframes shimmerAnim {
  0%   { transform: translateX(-100%); }
  60%  { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

/* ===== TYPEWRITER CURSOR ===== */
.typewriter {
  border-right: 3px solid var(--cyan);
  animation: blink 0.75s step-end infinite;
  display: inline;
}

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

/* ===== NUMBER COUNTER ===== */
.counter {
  display: inline-block;
}

/* ===== PAGE TRANSITION ===== */
.page-transition {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #00D4FF, #7C3AED);
  z-index: 9999;
  transform-origin: top;
  transform: scaleY(0);
  pointer-events: none;
}

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

/* ===== SCAN LINE EFFECT ===== */
.scan-lines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.03) 2px,
    rgba(0,0,0,0.03) 4px
  );
  pointer-events: none;
  z-index: 10;
  opacity: 0.3;
}

/* ===== HERO GRID GLOW LINES ===== */
.grid-glow-h {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,212,255,0.4), transparent);
  animation: glowLineH 4s ease-in-out infinite;
}

.grid-glow-v {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(124,58,237,0.4), transparent);
  animation: glowLineV 5s ease-in-out infinite;
}

@keyframes glowLineH {
  0%   { top: 0%; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

@keyframes glowLineV {
  0%   { left: 0%; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

/* ===== SPINNING RING ===== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spinRev { to { transform: rotate(-360deg); } }

.spin-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid;
  animation: spin linear infinite;
}

/* ===== FEATURE CARD GLOW PULSE ===== */
.feature-card-glow {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  border-radius: 0 0 0 0;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.feature-card:hover .feature-card-glow { transform: scaleX(1); }

/* ===== MORPHING BLOB ===== */
@keyframes morphBlob {
  0%   { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  33%  { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
  66%  { border-radius: 40% 60% 30% 70% / 60% 40% 70% 30%; }
  100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

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

/* ===== NOTIFICATION BADGE PULSE ===== */
@keyframes notifPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.2); }
}
.notif-pulse { animation: notifPulse 2s ease-in-out infinite; }

/* ===== HERO TEXT GRADIENT ANIMATION ===== */
.gradient-text-animated {
  background: linear-gradient(
    135deg,
    #00D4FF 0%,
    #7C3AED 33%,
    #00D4FF 66%,
    #7C3AED 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: textGradient 4s linear infinite;
}

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

/* ===== ANIMATED UNDERLINE ===== */
.animated-underline {
  position: relative;
  display: inline-block;
}

.animated-underline::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

a:hover .animated-underline::after,
.animated-underline:hover::after {
  transform: scaleX(1);
}

/* ===== CARD 3D TILT (optional, added on hover via JS) ===== */
.tilt {
  transform-style: preserve-3d;
  transition: transform 0.1s ease;
}

.tilt-inner {
  transform: translateZ(20px);
}

/* ===== SUCCESS/ERROR FORM FEEDBACK ===== */
.form-success {
  padding: 16px 20px;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: 10px;
  color: #10b981;
  font-size: 0.9rem;
  display: none;
  align-items: center;
  gap: 10px;
}

.form-success.show { display: flex; }

.form-error {
  font-size: 0.8rem;
  color: #ef4444;
  margin-top: 6px;
  display: none;
}

.form-error.show { display: block; }

/* ===== LOADING SPINNER ===== */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* ===== TOOLTIP ===== */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip-text {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15,22,41,0.95);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.78rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 100;
}

.tooltip:hover .tooltip-text { opacity: 1; }

/* ===== PROGRESS BAR ===== */
.progress-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-fill.animated { transform: scaleX(1); }

/* ===== BLOG POST ===== */
.blog-post-hero {
  background: var(--navy-dark);
  padding: 140px 0 80px;
  position: relative;
  overflow: hidden;
}

.blog-post-content {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.9;
}

.blog-post-content h2 {
  font-size: 1.8rem;
  margin: 48px 0 20px;
  color: var(--white);
}

.blog-post-content h3 {
  font-size: 1.3rem;
  margin: 36px 0 16px;
  color: var(--white);
}

.blog-post-content p { margin-bottom: 20px; color: rgba(255,255,255,0.75); }

.blog-post-content blockquote {
  border-left: 3px solid var(--cyan);
  padding: 20px 28px;
  background: rgba(0,212,255,0.04);
  border-radius: 0 10px 10px 0;
  margin: 32px 0;
  font-style: italic;
  color: rgba(255,255,255,0.85);
}

.blog-post-content code {
  background: rgba(0,212,255,0.08);
  border: 1px solid rgba(0,212,255,0.15);
  border-radius: 4px;
  padding: 2px 8px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.88em;
  color: var(--cyan);
}

.blog-post-content ul, .blog-post-content ol {
  margin: 16px 0 24px 24px;
  color: rgba(255,255,255,0.75);
}

.blog-post-content li { margin-bottom: 8px; }

/* ===== TOC ===== */
.toc {
  background: var(--navy-light);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 24px;
  position: sticky;
  top: 90px;
}

.toc-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-400);
  margin-bottom: 16px;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toc-list a {
  font-size: 0.85rem;
  color: var(--gray-400);
  padding: 4px 0;
  transition: var(--transition);
  display: block;
}
.toc-list a:hover, .toc-list a.active { color: var(--cyan); }

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