/* ==========================================================================
   ZAPPP — Animations & Hero Visual System
   ========================================================================== */

/* ---- generic floating ---- */
@keyframes float-y{
  0%,100%{ transform: translateY(0); }
  50%{ transform: translateY(-14px); }
}
@keyframes float-y-sm{
  0%,100%{ transform: translateY(0); }
  50%{ transform: translateY(-8px); }
}
@keyframes spin-slow{
  from{ transform: rotate(0deg); }
  to{ transform: rotate(360deg); }
}
@keyframes pulse-glow{
  0%,100%{ opacity:.55; transform: scale(1); }
  50%{ opacity:1; transform: scale(1.08); }
}
@keyframes dash-draw{
  to{ stroke-dashoffset: 0; }
}
@keyframes blink{
  0%,60%,100%{ opacity:1; }
  30%{ opacity:.2; }
}
@keyframes shimmer{
  0%{ background-position: -200% 0; }
  100%{ background-position: 200% 0; }
}
@keyframes barGrow{
  from{ transform: scaleY(0); }
  to{ transform: scaleY(1); }
}

/* ---- Hero: floating dashboard composition ---- */
.hero-stage{
  position:relative; width:100%; height:100%;
  perspective: 1400px;
}
.hero-stage__particles{ position:absolute; inset:-10%; z-index:0; pointer-events:none; }
.particle{
  position:absolute; border-radius:50%;
  background: radial-gradient(circle at 30% 30%, var(--green-300), var(--green-500));
  opacity:.55;
  animation: float-y 6s ease-in-out infinite;
  filter: blur(.2px);
}

.orb{
  position:absolute; border-radius:50%;
  background: conic-gradient(from 120deg, var(--green-300), var(--green-500), var(--green-700), var(--green-300));
  filter: blur(2px);
  animation: spin-slow 18s linear infinite;
  opacity:.9;
}
.orb::after{
  content:''; position:absolute; inset:6%; border-radius:50%;
  background: var(--paper);
}

.glow-blob{
  position:absolute; border-radius:50%;
  background: radial-gradient(circle, rgba(62,216,127,.55), transparent 70%);
  animation: pulse-glow 5s ease-in-out infinite;
  pointer-events:none;
  filter: blur(4px);
}

/* floating panel base */
.panel{
  position:absolute;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.72));
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border:1px solid rgba(255,255,255,.7);
  box-shadow: 0 30px 60px -24px rgba(11,20,16,.28), inset 0 1px 0 rgba(255,255,255,.7);
  animation: float-y 7s ease-in-out infinite;
  will-change: transform;
}

/* main chat panel */
.panel--chat{ width: min(340px, 60%); padding: 1.1rem; top:8%; left:0; animation-delay:.2s; }
.chat-header{ display:flex; align-items:center; gap:.6rem; padding-bottom:.8rem; border-bottom:1px solid var(--line); margin-bottom:.8rem; }
.chat-header .dot{ width:8px; height:8px; border-radius:50%; background:var(--green-500); box-shadow:0 0 0 3px rgba(31,170,89,.18); }
.chat-header span{ font-size:.8rem; font-weight:600; }
.chat-header small{ display:block; font-size:.68rem; color:var(--ink-400); font-family:var(--font-mono); }
.bubble{ max-width:80%; padding:.55rem .8rem; border-radius: 14px; font-size:.78rem; margin-bottom:.5rem; line-height:1.4; }
.bubble--in{ background: var(--mist); border:1px solid var(--line); border-bottom-left-radius:4px; }
.bubble--out{ background: linear-gradient(135deg,var(--green-500),var(--green-400)); color:#fff; margin-left:auto; border-bottom-right-radius:4px; }
.typing-dots{ display:inline-flex; gap:3px; align-items:center; }
.typing-dots span{ width:5px; height:5px; border-radius:50%; background:currentColor; animation: blink 1.4s infinite; }
.typing-dots span:nth-child(2){ animation-delay:.2s; }
.typing-dots span:nth-child(3){ animation-delay:.4s; }

/* analytics panel */
.panel--analytics{ width:200px; padding:1rem; bottom:6%; left:6%; animation-delay: 1s; }
.panel--analytics .stat-label{ font-family:var(--font-mono); font-size:.66rem; color:var(--ink-400); text-transform:uppercase; letter-spacing:.05em; }
.panel--analytics .stat-value{ font-family:var(--font-display); font-size:1.6rem; margin:.15rem 0 .6rem; }
.mini-bars{ display:flex; align-items:flex-end; gap:4px; height:38px; }
.mini-bars i{ flex:1; background: linear-gradient(180deg,var(--green-400),var(--green-600)); border-radius:3px 3px 0 0; transform-origin:bottom; animation: barGrow .9s var(--ease-out) both; }

/* broadcast/contacts panel */
.panel--broadcast{ width:190px; padding:1rem; top:2%; right:0; animation-delay:.5s; }
.panel--broadcast .icon-badge{ width:34px; height:34px; border-radius:10px; background: var(--mint-100); color:var(--green-700); display:grid; place-items:center; margin-bottom:.6rem; }
.panel--broadcast .icon-badge svg{ width:18px; height:18px; }
.panel--broadcast .progress{ height:6px; border-radius:99px; background:var(--line); overflow:hidden; margin-top:.6rem; }
.panel--broadcast .progress i{ display:block; height:100%; background: linear-gradient(90deg,var(--green-500),var(--green-400)); border-radius:99px; }

/* AI badge panel */
.panel--ai{ width:150px; padding:.9rem; bottom:16%; right:4%; animation-delay:1.4s; text-align:center; }
.panel--ai .ai-ring{ width:44px; height:44px; margin:0 auto .5rem; border-radius:50%; background: conic-gradient(var(--green-300),var(--green-600),var(--green-300)); display:grid; place-items:center; animation: spin-slow 6s linear infinite; }
.panel--ai .ai-ring::after{ content:'AI'; width:34px; height:34px; border-radius:50%; background:#fff; display:grid; place-items:center; font-family:var(--font-mono); font-size:.65rem; font-weight:600; color:var(--green-700); }
.panel--ai small{ display:block; font-size:.7rem; color:var(--ink-400); margin-top:.3rem; }

/* connecting thread svg */
.hero-thread{ position:absolute; inset:0; z-index:0; }
.hero-thread path{
  fill:none; stroke: url(#threadGrad); stroke-width:1.6; stroke-linecap:round;
  stroke-dasharray: 8 8;
  animation: dash-draw 40s linear infinite, dashMove 3s linear infinite;
}
@keyframes dashMove{ to{ stroke-dashoffset: -160; } }

/* whatsapp floating bubbles background accent */
.floating-icons{ position:absolute; inset:0; z-index:-1; pointer-events:none; }
.floating-icons svg{ position:absolute; opacity:.16; animation: float-y-sm 5s ease-in-out infinite; }

/* section reveal stagger helper (children get delay via inline style set by JS) */
[data-stagger] > *{ opacity:0; transform: translateY(24px); }

/* scroll progress bar */
.scroll-progress{ position:fixed; top:0; left:0; height:3px; background: linear-gradient(90deg,var(--green-500),var(--green-400)); z-index:200; width:0%; }

/* cursor glow (desktop only, added via JS) */
.cursor-glow{
  position:fixed; width:420px; height:420px; border-radius:50%;
  background: radial-gradient(circle, rgba(62,216,127,.10), transparent 70%);
  pointer-events:none; z-index:1; transform: translate(-50%,-50%);
  will-change: transform;
}

/* dashboard section (interactive dashboard demo) */
.dash-demo{
  border-radius: var(--radius-xl);
  background: var(--paper);
  border:1px solid var(--line);
  box-shadow: 0 60px 100px -50px rgba(11,20,16,.3);
  padding: clamp(1.25rem,3vw,2.5rem);
  display:grid; grid-template-columns: 1fr 1.4fr; gap:1.5rem;
  overflow:hidden;
}
.dash-sidebar{ display:flex; flex-direction:column; gap:.4rem; }
.dash-sidebar .item{ display:flex; align-items:center; gap:.7rem; padding:.7rem .9rem; border-radius:12px; font-size:.85rem; color:var(--ink-600); }
.dash-sidebar .item.active{ background:var(--mint-100); color:var(--green-700); font-weight:600; }
.dash-sidebar .item svg{ width:16px; height:16px; }
.dash-main{ display:grid; gap:1rem; grid-template-rows:auto 1fr; }
.dash-cards{ display:grid; grid-template-columns:repeat(3,1fr); gap:.9rem; }
.dash-card{ background:var(--mist); border:1px solid var(--line); border-radius:14px; padding:.9rem; }
.dash-card .stat-label{ font-family:var(--font-mono); font-size:.62rem; color:var(--ink-400); text-transform:uppercase; }
.dash-card .stat-value{ font-family:var(--font-display); font-size:1.35rem; margin-top:.2rem; }
.dash-chart{ background:var(--mist); border:1px solid var(--line); border-radius:14px; padding:1rem; display:flex; align-items:flex-end; gap:6px; min-height:160px; }
.dash-chart i{ flex:1; background: linear-gradient(180deg,var(--green-400),var(--green-600)); border-radius:4px 4px 0 0; transform-origin:bottom; }

@media (max-width: 900px){
  .dash-demo{ grid-template-columns:1fr; }
  .dash-sidebar{ flex-direction:row; overflow-x:auto; }
  .blog-featured{ grid-template-columns:1fr; }
  .blog-featured__thumb{ order:-1; height:200px; }
  .blog-layout{ grid-template-columns:1fr; }
}
