/* ============================================
   NeuroTask — Animations & Keyframes
   ============================================ */

/* --- Keyframe Animations --- */

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

@keyframes btnPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(108, 92, 231, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(108, 92, 231, 0); }
}

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

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

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

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

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

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

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

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

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

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

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

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

@keyframes blink {
  0%, 100% { border-right-color: var(--accent-purple-light); }
  50% { border-right-color: transparent; }
}

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Stagger delay support */
.reveal[data-delay="100"] { transition-delay: 0.1s; }
.reveal[data-delay="200"] { transition-delay: 0.2s; }
.reveal[data-delay="300"] { transition-delay: 0.3s; }
.reveal[data-delay="400"] { transition-delay: 0.4s; }
.reveal[data-delay="500"] { transition-delay: 0.5s; }
.reveal[data-delay="600"] { transition-delay: 0.6s; }

/* --- Page Load Animation --- */
body {
  animation: fadeIn 0.5s ease;
}

.hero-content {
  animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-badge {
  animation: slideDown 0.6s ease 0.1s both;
}

.hero-cta-group {
  animation: fadeInUp 0.8s ease 0.5s both;
}

.hero-stats {
  animation: fadeInUp 0.8s ease 0.7s both;
}

.floating-card {
  animation: float 6s ease-in-out infinite, fadeIn 1s ease 0.8s both;
}

.card-1 { animation-delay: 0.8s, 0.8s; }
.card-2 { animation-delay: -2s, 1s; }
.card-3 { animation-delay: -4s, 1.2s; }

/* --- Interactive Micro-animations --- */

/* Button click ripple effect */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s;
}

.btn:active::after {
  opacity: 1;
}

/* Card hover glow */
.feature-card,
.insight-card,
.dash-card {
  transition: all var(--transition-base);
}

/* Input focus animation */
.input-group input {
  transition: all var(--transition-base);
}

.input-group input:focus {
  transform: translateY(-1px);
}

/* --- Loading Skeleton --- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-card-hover) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* --- Gradient text animation --- */
.gradient-text-animated {
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-blue), var(--accent-mint), var(--accent-purple));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease infinite;
}

/* --- Nav link hover underline --- */
.nav-link::after {
  transition: width 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

/* --- Smooth number counter --- */
.stat-number {
  transition: color var(--transition-base);
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }

  html {
    scroll-behavior: auto;
  }
}
