/* =============================================
   ALIDEVCAMP — ANIMATIONS.CSS
   Scroll animations, keyframes, micro-interactions
============================================= */

/* ---- KEYFRAMES ---- */

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

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

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

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

@keyframes float1 {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50%       { transform: translateY(-8px) rotate(0.5deg); }
}

@keyframes float2 {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50%       { transform: translateY(-12px) rotate(-0.5deg); }
}

@keyframes float3 {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50%       { transform: translateY(-6px) rotate(0.3deg); }
}

@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%            { transform: translateY(-4px); opacity: 1; }
}

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

@keyframes pulseBig {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 200, 255, 0.4); }
  70%       { box-shadow: 0 0 0 8px rgba(0, 200, 255, 0); }
}

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

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

@keyframes dashFlow {
  to { stroke-dashoffset: -20; }
}

@keyframes barGrow {
  from { height: 0; }
  to   { height: var(--h, 50%); }
}

@keyframes wfPulse {
  0%, 100% { border-color: rgba(0, 200, 255, 0.4); box-shadow: none; }
  50%       { border-color: rgba(0, 200, 255, 0.9); box-shadow: 0 0 8px rgba(0, 200, 255, 0.4); }
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 0.8; }
  50%       { transform: translateY(8px); opacity: 0.3; }
}

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

@keyframes nodeGlow {
  0%, 100% { box-shadow: 0 0 6px rgba(0, 200, 255, 0.3); }
  50%       { box-shadow: 0 0 18px rgba(0, 200, 255, 0.7); }
}

@keyframes arrowFlow {
  0%   { opacity: 0.3; transform: scaleX(0.8); }
  50%  { opacity: 1;   transform: scaleX(1); }
  100% { opacity: 0.3; transform: scaleX(0.8); }
}

@keyframes connDash {
  from { stroke-dashoffset: 24; }
  to   { stroke-dashoffset: 0; }
}

@keyframes footerGlow {
  0%, 100% { box-shadow: 0 18px 55px rgba(0, 0, 0, 0.2), 0 0 0 rgba(0, 200, 255, 0); }
  50%       { box-shadow: 0 18px 55px rgba(0, 0, 0, 0.2), 0 0 28px rgba(0, 200, 255, 0.08); }
}

/* ---- SCROLL-TRIGGERED BASE STATES ---- */

.animate-fade-in,
.animate-slide-up,
.animate-slide-left,
.animate-slide-right {
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-fade-in      { transform: translateY(0); }
.animate-slide-up     { transform: translateY(28px); }
.animate-slide-left   { transform: translateX(-28px); }
.animate-slide-right  { transform: translateX(28px); }

/* When Intersection Observer adds .in-view */
.animate-fade-in.in-view,
.animate-slide-up.in-view,
.animate-slide-left.in-view,
.animate-slide-right.in-view {
  opacity: 1;
  transform: translate(0, 0);
}

/* Staggered delay for grid children */
.animate-slide-up:nth-child(1) { transition-delay: 0ms; }
.animate-slide-up:nth-child(2) { transition-delay: 80ms; }
.animate-slide-up:nth-child(3) { transition-delay: 160ms; }
.animate-slide-up:nth-child(4) { transition-delay: 240ms; }
.animate-slide-up:nth-child(5) { transition-delay: 320ms; }
.animate-slide-up:nth-child(6) { transition-delay: 400ms; }
.animate-slide-up:nth-child(7) { transition-delay: 480ms; }
.animate-slide-up:nth-child(8) { transition-delay: 560ms; }

/* Hero immediate animation (no observer needed) */
.animate-fade-in {
  animation: fadeIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}
.animate-fade-in-delay {
  animation: fadeIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
  opacity: 0;
}

/* ---- FLOATING CARDS ---- */
.float-1 { animation: float1 5s ease-in-out infinite; }
.float-2 { animation: float2 6s ease-in-out infinite 1s; }
.float-3 { animation: float3 4.5s ease-in-out infinite 0.5s; }

/* ---- TYPING DOTS ---- */
.typing-dots span {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  margin: 0 2px;
  animation: typingDot 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

/* ---- STATUS DOTS ---- */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  margin-left: auto;
}
.status-dot.active {
  animation: pulseBig 1.5s ease-out infinite;
}
.status-dot.pulse {
  animation: pulse 1.5s ease-in-out infinite;
}

/* ---- WORKFLOW NODES ---- */
.wf-node.wf-active {
  animation: wfPulse 2s ease-in-out infinite;
}

/* ---- BAR CHART ANIMATION ---- */
.bar {
  animation: barGrow 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.bar:nth-child(1) { animation-delay: 0.1s; }
.bar:nth-child(2) { animation-delay: 0.2s; }
.bar:nth-child(3) { animation-delay: 0.3s; }
.bar:nth-child(4) { animation-delay: 0.4s; }
.bar:nth-child(5) { animation-delay: 0.5s; }
.bar:nth-child(6) { animation-delay: 0.6s; }

/* ---- SCROLL INDICATOR ---- */
.scroll-dot {
  animation: scrollBounce 2s ease-in-out infinite;
}

/* ---- CONNECTION SVG PATHS ---- */
.conn-path {
  stroke-dasharray: 4 4;
  animation: dashFlow 2s linear infinite;
}

/* ---- GRADIENT TEXT SHIMMER ---- */
.gradient-text {
  background: linear-gradient(135deg, #00C8FF 0%, #0066FF 40%, #8B5CF6 70%, #00C8FF 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite;
}

/* ---- RAG FLOW ARROWS ---- */
.rag-arrow {
  animation: arrowFlow 1.8s ease-in-out infinite;
}
.rag-arrow:nth-child(2) { animation-delay: 0.25s; }
.rag-arrow:nth-child(3) { animation-delay: 0.5s; }
.rag-arrow:nth-child(4) { animation-delay: 0.75s; }
.rag-arrow:nth-child(5) { animation-delay: 1s; }
.rag-arrow:nth-child(6) { animation-delay: 1.25s; }

/* ---- RAG NODES GLOW ---- */
.rag-node {
  animation: nodeGlow 2.5s ease-in-out infinite;
}
.rag-node:nth-child(odd) { animation-delay: 0.5s; }

/* ---- PROCESS STEP CONNECTOR ---- */
.process-step.in-view .step-circle {
  animation: pulseBig 2s ease-out infinite;
}

/* ---- CARD HOVER MICRO-INTERACTION ---- */
.service-card,
.industry-card,
.pricing-card {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s ease;
}
.service-card:hover,
.industry-card:hover {
  transform: translateY(-6px);
}
.pricing-card:hover {
  transform: translateY(-4px);
}

/* ---- BUTTON HOVER ---- */
.btn {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn:active {
  transform: translateY(0);
}

/* ---- NAV LINK UNDERLINE ---- */
.nav-link::after {
  transition: width 0.25s ease;
}

/* ---- HAMBURGER ANIMATION ---- */
.hamburger-line {
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.hamburger.open .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.hamburger.open .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger.open .hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ---- MOBILE DRAWER SLIDE ---- */
.mobile-drawer {
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.3s ease;
}

/* ---- FORM SUCCESS ---- */
.form-success {
  animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ---- INDUSTRY CARD ICON ---- */
.industry-icon {
  transition: transform 0.3s ease;
}
.industry-card:hover .industry-icon {
  transform: scale(1.1) rotate(-3deg);
}

/* ---- PRICING HIGHLIGHT PULSE ---- */
.pricing-card-enterprise {
  animation: nodeGlow 3s ease-in-out infinite;
}

/* ---- HERO BADGE DOT ---- */
.hero-badge-dot {
  animation: pulse 1.8s ease-in-out infinite;
}

.footer-status-dot {
  animation: pulse 2.2s ease-in-out infinite;
}

.footer-cta.in-view {
  animation: footerGlow 5s ease-in-out 0.8s infinite;
}

/* ---- API BADGE ---- */
.api-badge {
  animation: pulse 2.5s ease-in-out infinite;
}

/* ---- TYPING CURSOR ---- */
.typing-cursor {
  display: inline-block;
  color: var(--cyan);
  font-weight: 300;
  margin-left: 2px;
  animation: blinkCursor 0.8s ease-in-out infinite;
  vertical-align: baseline;
}

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

/* ---- REDUCE MOTION SUPPORT ---- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .animate-fade-in,
  .animate-fade-in-delay {
    opacity: 1 !important;
  }
}
