/* ============================================
   BRAINBOTINDIA — ANIMATIONS
   Smooth, Modern Animations
   ============================================ */

/* ============================================
   1. FADE ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

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

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

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

/* ============================================
   2. SLIDE ANIMATIONS
   ============================================ */
@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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

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

@keyframes slideInDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ============================================
   3. BOUNCE ANIMATIONS
   ============================================ */
@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes bounceInUp {
  0% {
    opacity: 0;
    transform: translateY(100px) scale(0.8);
  }
  60% {
    opacity: 1;
    transform: translateY(-20px) scale(1.05);
  }
  80% {
    transform: translateY(10px) scale(0.95);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

/* ============================================
   4. ROTATE & 3D ANIMATIONS
   ============================================ */
@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-200deg) scale(0.7);
  }
  to {
    opacity: 1;
    transform: rotate(0) scale(1);
  }
}

@keyframes flipIn {
  from {
    opacity: 0;
    transform: perspective(400px) rotateY(-90deg);
  }
  to {
    opacity: 1;
    transform: perspective(400px) rotateY(0);
  }
}

@keyframes flipInX {
  from {
    opacity: 0;
    transform: perspective(400px) rotateX(-90deg);
  }
  to {
    opacity: 1;
    transform: perspective(400px) rotateX(0);
  }
}

/* ============================================
   5. LOADING & PROGRESS ANIMATIONS
   ============================================ */
@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes pulseGlow {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
  }
  50% {
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.4);
  }
}

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

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

/* ============================================
   6. HOVER ANIMATIONS
   ============================================ */
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes floatSlow {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  50% {
    transform: translateY(-15px) rotate(2deg);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-5px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(5px);
  }
}

@keyframes wobble {
  0%,
  100% {
    transform: translateX(0);
  }
  15% {
    transform: translateX(-25px) rotate(-5deg);
  }
  30% {
    transform: translateX(20px) rotate(3deg);
  }
  45% {
    transform: translateX(-15px) rotate(-3deg);
  }
  60% {
    transform: translateX(10px) rotate(2deg);
  }
  75% {
    transform: translateX(-5px) rotate(-1deg);
  }
}

/* ============================================
   7. TEXT ANIMATIONS
   ============================================ */
@keyframes textGlow {
  0%,
  100% {
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
  }
  50% {
    text-shadow: 0 0 30px rgba(99, 102, 241, 0.6);
  }
}

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

@keyframes blinkCursor {
  0%,
  100% {
    border-color: transparent;
  }
  50% {
    border-color: var(--accent-primary);
  }
}

/* ============================================
   8. SCROLL-BASED ANIMATIONS
   ============================================ */
@keyframes scrollReveal {
  0% {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes scrollRevealLeft {
  0% {
    opacity: 0;
    transform: translateX(-50px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scrollRevealRight {
  0% {
    opacity: 0;
    transform: translateX(50px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============================================
   9. COUNTER ANIMATION
   ============================================ */
@keyframes countUp {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ============================================
   10. UTILITY ANIMATION CLASSES
   ============================================ */
.animate-fade-in {
  animation: fadeIn 0.6s ease forwards;
}

.animate-fade-in-up {
  animation: fadeInUp 0.8s ease forwards;
}

.animate-fade-in-down {
  animation: fadeInDown 0.8s ease forwards;
}

.animate-fade-in-left {
  animation: fadeInLeft 0.8s ease forwards;
}

.animate-fade-in-right {
  animation: fadeInRight 0.8s ease forwards;
}

.animate-fade-in-scale {
  animation: fadeInScale 0.8s ease forwards;
}

.animate-bounce-in {
  animation: bounceIn 0.8s ease forwards;
}

.animate-bounce-in-up {
  animation: bounceInUp 0.9s ease forwards;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-float-slow {
  animation: floatSlow 6s ease-in-out infinite;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.animate-pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.animate-shake {
  animation: shake 0.8s ease;
}

.animate-wobble {
  animation: wobble 1s ease;
}

.animate-text-glow {
  animation: textGlow 2s ease-in-out infinite;
}

/* Animation Delays */
.delay-1 {
  animation-delay: 0.1s;
}
.delay-2 {
  animation-delay: 0.2s;
}
.delay-3 {
  animation-delay: 0.3s;
}
.delay-4 {
  animation-delay: 0.4s;
}
.delay-5 {
  animation-delay: 0.5s;
}
.delay-6 {
  animation-delay: 0.6s;
}
.delay-7 {
  animation-delay: 0.7s;
}
.delay-8 {
  animation-delay: 0.8s;
}

/* Animation Durations */
.duration-fast {
  animation-duration: 0.3s !important;
}
.duration-normal {
  animation-duration: 0.6s !important;
}
.duration-slow {
  animation-duration: 1s !important;
}
.duration-slower {
  animation-duration: 1.5s !important;
}

/* ============================================
   11. STAGGER ANIMATIONS (For Grid Items)
   ============================================ */
.stagger-children > * {
  opacity: 0;
}

.stagger-children > *:nth-child(1) {
  animation: fadeInUp 0.6s ease 0.1s forwards;
}
.stagger-children > *:nth-child(2) {
  animation: fadeInUp 0.6s ease 0.2s forwards;
}
.stagger-children > *:nth-child(3) {
  animation: fadeInUp 0.6s ease 0.3s forwards;
}
.stagger-children > *:nth-child(4) {
  animation: fadeInUp 0.6s ease 0.4s forwards;
}
.stagger-children > *:nth-child(5) {
  animation: fadeInUp 0.6s ease 0.5s forwards;
}
.stagger-children > *:nth-child(6) {
  animation: fadeInUp 0.6s ease 0.6s forwards;
}
.stagger-children > *:nth-child(7) {
  animation: fadeInUp 0.6s ease 0.7s forwards;
}
.stagger-children > *:nth-child(8) {
  animation: fadeInUp 0.6s ease 0.8s forwards;
}
.stagger-children > *:nth-child(9) {
  animation: fadeInUp 0.6s ease 0.9s forwards;
}
.stagger-children > *:nth-child(10) {
  animation: fadeInUp 0.6s ease 1.0s forwards;
}

/* ============================================
   12. HOVER EFFECTS
   ============================================ */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: var(--card-shadow);
}

.hover-glow {
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.hover-glow:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.1);
}

.hover-scale {
  transition: transform 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-rotate {
  transition: transform 0.3s ease;
}

.hover-rotate:hover {
  transform: rotate(5deg);
}

/* ============================================
   13. PAGE TRANSITIONS
   ============================================ */
.page-transition {
  animation: fadeIn 0.4s ease;
}

/* ============================================
   14. SMOOTH SCROLL INDICATOR
   ============================================ */
.scroll-indicator {
  animation: bounceInUp 1.5s ease infinite;
}

/* ============================================
   15. TYPING EFFECT
   ============================================ */
.typing-effect {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: 3px solid var(--accent-primary);
  animation: typing 3s steps(30) 1s forwards, blinkCursor 0.8s step-end infinite;
  max-width: 0;
}

/* ============================================
   16. LOADING SPINNER
   ============================================ */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-subtle);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ============================================
   17. SKELETON LOADING
   ============================================ */
.skeleton {
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  animation: shimmer 2s linear infinite;
  background: linear-gradient(
    90deg,
    var(--bg-elevated) 25%,
    var(--bg-card) 50%,
    var(--bg-elevated) 75%
  );
  background-size: 200% 100%;
}

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

  .hero-bg-glow,
  .hero-bg-glow-2 {
    animation: none !important;
  }

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