/* ============================================
   NEURALVID — Animations & Motion
   ============================================ */

/* ===== PAGE LOAD REVEALS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(0,245,255,0.2); }
  50%       { box-shadow: 0 0 40px rgba(0,245,255,0.5), 0 0 80px rgba(0,245,255,0.2); }
}
@keyframes borderGlow {
  0%, 100% { border-color: rgba(0,245,255,0.12); }
  50%       { border-color: rgba(0,245,255,0.4); }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
@keyframes typewriter {
  from { width: 0; }
  to   { width: 100%; }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ===== STAGGERED HERO ENTRANCE ===== */
.hero-tag    { animation: fadeInDown 0.6s ease 0.1s both; }
.hero-title  { animation: fadeInUp  0.7s ease 0.2s both; }
.hero-sub    { animation: fadeInUp  0.7s ease 0.35s both; }
.hero-stats  { animation: fadeInUp  0.7s ease 0.5s both; }
.hero-visual { animation: scaleIn   0.8s ease 0.3s both; }

/* ===== STAGGERED PANEL ENTRANCE ===== */
.gen-controls { animation: slideInLeft  0.7s ease 0.2s both; }
.gen-preview  { animation: slideInRight 0.7s ease 0.3s both; }

/* ===== FEATURE CARDS SCROLL REVEAL ===== */
.feature-card {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.feature-card.visible {
  opacity: 1;
  transform: translateY(0);
}
.feature-card:nth-child(1) { transition-delay: 0.05s; }
.feature-card:nth-child(2) { transition-delay: 0.12s; }
.feature-card:nth-child(3) { transition-delay: 0.19s; }
.feature-card:nth-child(4) { transition-delay: 0.26s; }
.feature-card:nth-child(5) { transition-delay: 0.33s; }
.feature-card:nth-child(6) { transition-delay: 0.40s; }

/* ===== EXAMPLE CARDS SCROLL REVEAL ===== */
.example-card {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease, transform 0.45s ease, border-color 0.25s ease;
}
.example-card.visible {
  opacity: 1;
  transform: translateY(0);
}
.example-card:nth-child(1) { transition-delay: 0.04s; }
.example-card:nth-child(2) { transition-delay: 0.10s; }
.example-card:nth-child(3) { transition-delay: 0.16s; }
.example-card:nth-child(4) { transition-delay: 0.22s; }
.example-card:nth-child(5) { transition-delay: 0.28s; }
.example-card:nth-child(6) { transition-delay: 0.34s; }

/* ===== GENERATE BUTTON LOADING STATE ===== */
.btn-generate.loading .btn-generate-inner::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(5,5,16,0.4);
  border-top-color: var(--bg-base);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: 8px;
}
.btn-generate.loading svg { display: none; }

/* ===== PREVIEW VIEWPORT GLOW ON ACTIVE ===== */
.preview-viewport.generating {
  animation: borderGlow 2s ease-in-out infinite;
  box-shadow: 0 0 40px rgba(0,245,255,0.15);
}

/* ===== RESULT BADGE ENTRANCE ===== */
.result-badge { animation: fadeInDown 0.5s ease 0.3s both; }

/* ===== STYLE BUTTON ACTIVE PULSE ===== */
.style-btn.active { animation: glowPulse 3s ease-in-out infinite; }

/* ===== FLOATING CARDS ===== */
.fc-1 { animation: cardFloat 4.0s ease-in-out infinite; }
.fc-2 { animation: cardFloat 5.0s ease-in-out 1.5s infinite; }
.fc-3 { animation: cardFloat 4.5s ease-in-out 0.8s infinite; }
@keyframes cardFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%       { transform: translateY(-12px) rotate(1deg); }
  66%       { transform: translateY(-6px) rotate(-0.5deg); }
}

/* ===== HISTORY ITEM ENTRANCE ===== */
.history-item {
  animation: fadeInUp 0.3s ease both;
}

/* ===== SECTION TITLES ===== */
.section-title {
  animation: none; /* triggered by scroll observer */
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.section-title.visible {
  opacity: 1;
  transform: translateY(0);
}
.section-tag {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease 0.1s, transform 0.5s ease 0.1s;
}
.section-tag.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== LOGO HOVER ===== */
.logo:hover .logo-icon svg {
  filter: drop-shadow(0 0 8px rgba(0,245,255,0.8));
  transition: filter 0.3s ease;
}

/* ===== CUSTOM CURSOR GLOW ===== */
.btn-generate,
.style-btn,
.example-card,
.nav-cta {
  cursor: pointer;
}

/* ===== PROGRESS BAR SHIMMER ===== */
.loading-bar::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.loading-bar { position: relative; overflow: hidden; }