/* ==========================================================================
   Syed Mustaq Ahamed - Modern Animations & Scroll Effects (animations.css)
   ========================================================================== */

/* 1. Modern Scroll Progress Indicator (following Modern Web Guidance) */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: scroll())) {
    @keyframes grow-progress {
      from { transform: scaleX(0); }
      to { transform: scaleX(1); }
    }

    #scroll-progress {
      position: fixed;
      left: 0;
      top: 0;
      width: 100%;
      height: 3px;
      background: linear-gradient(90deg, #6366f1, #06b6d4, #10b981);
      transform-origin: 0 50%;
      animation: grow-progress auto linear;
      animation-timeline: scroll();
      z-index: 10000;
    }
  }
}

/* Fallback base for scroll-progress */
#scroll-progress {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #06b6d4, #10b981);
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: 10000;
  transition: transform 0.1s ease-out;
}

/* 2. Aurora Glowing Background Blobs */
.aurora-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}

.aurora-blob {
  position: absolute;
  filter: blur(100px);
  opacity: 0.28;
  border-radius: 50%;
  animation: float-blob 22s infinite alternate ease-in-out;
}

[data-theme="light"] .aurora-blob {
  opacity: 0.18;
}

.blob-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #6366f1 0%, rgba(99, 102, 241, 0) 70%);
  top: -100px;
  left: -100px;
  animation-duration: 20s;
}

.blob-2 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, #06b6d4 0%, rgba(6, 182, 212, 0) 70%);
  bottom: 10%;
  right: -150px;
  animation-duration: 25s;
  animation-delay: -5s;
}

.blob-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #8b5cf6 0%, rgba(139, 92, 246, 0) 70%);
  top: 40%;
  left: 30%;
  animation-duration: 28s;
  animation-delay: -10s;
}

@keyframes float-blob {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(80px, 60px) scale(1.12);
  }
  100% {
    transform: translate(-60px, 100px) scale(0.92);
  }
}

/* 3. Subtle Grid Mesh Background Overlay */
.grid-mesh {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -1;
  pointer-events: none;
}

[data-theme="light"] .grid-mesh {
  background-image: linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
}

/* 4. Pulse & Status Indicators */
.pulse-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 500;
  color: #34d399;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  position: relative;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #10b981;
  animation: pulse-ring 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(2.8);
    opacity: 0;
  }
}

/* 5. Typing Cursor Animation */
.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background-color: var(--accent-secondary);
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 0.9s infinite;
}

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

/* 6. Reveal on Scroll Animation Styles */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* 7. Hover Card Lift & Shimmer */
.card-hover-lift {
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.card-hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -15px rgba(99, 102, 241, 0.25);
  border-color: var(--border-glow);
}

/* 8. Badge Shimmer */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shimmer-text {
  background: linear-gradient(90deg, #f8fafc 0%, #6366f1 50%, #f8fafc 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 4s linear infinite;
}
