/* ============================================
   ANIMATIONS — Keyframes, Hover, Parallax
   HCLTech-Inspired Design System
   ============================================ */

/* ---- Core Keyframes ---- */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

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

@keyframes toast-in {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100px); }
}

@keyframes badge-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.4); }
}

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

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(60, 145, 255, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(60, 145, 255, 0); }
}

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

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

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

/* ---- HCLTech Advanced Keyframes ---- */

@keyframes text-reveal {
  0% { opacity: 0; transform: translateY(40px); filter: blur(8px); }
  100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes orb-float-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.1); }
  50% { transform: translate(-20px, -60px) scale(0.95); }
  75% { transform: translate(-40px, -20px) scale(1.05); }
}

@keyframes orb-float-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(-40px, 30px) scale(1.08); }
  50% { transform: translate(30px, 50px) scale(0.92); }
  75% { transform: translate(50px, -10px) scale(1.03); }
}

@keyframes orb-float-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(50px, 30px) scale(1.15); }
  66% { transform: translate(-30px, -40px) scale(0.9); }
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.2); }
}

@keyframes particle-rise {
  0% { opacity: 0; transform: translateY(100px) scale(0); }
  20% { opacity: 1; transform: translateY(60px) scale(1); }
  80% { opacity: 0.8; transform: translateY(-20px) scale(0.8); }
  100% { opacity: 0; transform: translateY(-60px) scale(0); }
}

@keyframes counter-glow {
  0%, 100% { text-shadow: 0 0 0 transparent; }
  50% { text-shadow: 0 0 30px rgba(60, 145, 255, 0.3); }
}

@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-60px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(60px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes border-glow-anim {
  0%, 100% { border-color: rgba(60, 145, 255, 0.2); box-shadow: 0 0 0 0 rgba(60, 145, 255, 0); }
  50% { border-color: rgba(60, 145, 255, 0.5); box-shadow: 0 0 20px rgba(60, 145, 255, 0.1); }
}

@keyframes morph-blob {
  0%, 100% { border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%; }
  25% { border-radius: 55% 45% 35% 65% / 60% 30% 70% 40%; }
  50% { border-radius: 30% 70% 55% 45% / 55% 65% 35% 45%; }
  75% { border-radius: 65% 35% 45% 55% / 35% 55% 45% 65%; }
}

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

@keyframes dash-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes ripple {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(2.4); opacity: 0; }
}

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

/* ---- Animation utilities ---- */
.animate-fade-in {
  animation: fade-in 0.6s ease forwards;
}

.animate-slide-up {
  animation: slide-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-text-reveal {
  animation: text-reveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

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

.animate-gradient {
  background-size: 200% 200%;
  animation: gradient-shift 4s ease infinite;
}

.animate-morph {
  animation: morph-blob 8s ease-in-out infinite;
}

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

.animate-border-glow {
  animation: border-glow-anim 3s ease-in-out infinite;
}

.animate-counter-glow {
  animation: counter-glow 2.5s ease-in-out infinite;
}

/* Staggered children animations */
.stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.stagger-children > *:nth-child(2) { animation-delay: 100ms; }
.stagger-children > *:nth-child(3) { animation-delay: 200ms; }
.stagger-children > *:nth-child(4) { animation-delay: 300ms; }
.stagger-children > *:nth-child(5) { animation-delay: 400ms; }
.stagger-children > *:nth-child(6) { animation-delay: 500ms; }

.cart-badge.animate {
  animation: badge-bounce 0.3s ease;
}

/* ---- Loading spinner ---- */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-gray-200);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ---- Hover effects ---- */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.hover-scale {
  transition: transform var(--transition-base);
}
.hover-scale:hover {
  transform: scale(1.02);
}

.hover-glow {
  transition: box-shadow var(--transition-base);
}
.hover-glow:hover {
  box-shadow: 0 0 25px rgba(60, 145, 255, 0.15), 0 0 50px rgba(95, 30, 190, 0.08);
}

/* ---- Hero — Vibrant Blue-Purple Gradient ---- */
.hero-gradient {
  background: linear-gradient(135deg, #1e40af 0%, #5F1EBE 40%, #7c3aed 70%, #3C91FF 100%);
  position: relative;
  overflow: hidden;
}

.hero-gradient::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -15%;
  width: 800px;
  height: 800px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 60%);
  pointer-events: none;
  animation: orb-float-1 12s ease-in-out infinite;
}

.hero-gradient::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(60, 145, 255, 0.2) 0%, transparent 60%);
  pointer-events: none;
  animation: orb-float-2 15s ease-in-out infinite;
}

/* Floating orbs */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(1px);
}

.hero-orb-1 {
  width: 400px;
  height: 400px;
  top: 10%;
  right: 5%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0%, transparent 70%);
  animation: orb-float-1 10s ease-in-out infinite, morph-blob 12s ease-in-out infinite;
}

.hero-orb-2 {
  width: 300px;
  height: 300px;
  bottom: 15%;
  left: 10%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  animation: orb-float-2 13s ease-in-out infinite, morph-blob 15s ease-in-out infinite;
}

.hero-orb-3 {
  width: 200px;
  height: 200px;
  top: 40%;
  right: 30%;
  background: radial-gradient(circle, rgba(60, 145, 255, 0.1) 0%, transparent 70%);
  animation: orb-float-3 18s ease-in-out infinite;
}

/* Animated particles */
.hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  animation: particle-rise 6s ease-in-out infinite;
}

.hero-particle:nth-child(1) { left: 10%; bottom: 0; animation-delay: 0s; animation-duration: 7s; }
.hero-particle:nth-child(2) { left: 25%; bottom: 0; animation-delay: 1.5s; animation-duration: 8s; width: 3px; height: 3px; background: rgba(255, 255, 255, 0.4); }
.hero-particle:nth-child(3) { left: 45%; bottom: 0; animation-delay: 3s; animation-duration: 6s; }
.hero-particle:nth-child(4) { left: 60%; bottom: 0; animation-delay: 0.8s; animation-duration: 9s; width: 5px; height: 5px; background: rgba(255, 255, 255, 0.35); }
.hero-particle:nth-child(5) { left: 75%; bottom: 0; animation-delay: 2.5s; animation-duration: 7.5s; width: 3px; height: 3px; background: rgba(255, 255, 255, 0.4); }
.hero-particle:nth-child(6) { left: 90%; bottom: 0; animation-delay: 4s; animation-duration: 8.5s; }
.hero-particle:nth-child(7) { left: 35%; bottom: 0; animation-delay: 1s; animation-duration: 6.5s; width: 2px; height: 2px; }
.hero-particle:nth-child(8) { left: 55%; bottom: 0; animation-delay: 3.5s; animation-duration: 7s; background: rgba(255, 255, 255, 0.35); }

/* Decorative grid pattern */
.pattern-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

/* Animated ring decoration */
.hero-ring {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  pointer-events: none;
  animation: rotate-slow 30s linear infinite;
}

.hero-ring-1 {
  width: 500px;
  height: 500px;
  top: -100px;
  right: -100px;
}

.hero-ring-2 {
  width: 350px;
  height: 350px;
  top: -25px;
  right: -25px;
  border-color: rgba(255, 255, 255, 0.08);
  animation-direction: reverse;
  animation-duration: 25s;
}

/* ---- Floating Tech Icons in Hero ---- */
.hero-float-icons {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.hero-float-icon {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  padding: 14px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 0 20px rgba(255, 255, 255, 0.1);
  opacity: 0;
  animation: icon-float-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@keyframes icon-float-in {
  0% {
    opacity: 0;
    transform: translateX(-120px) scale(0.3) rotate(-15deg);
    filter: blur(6px);
  }
  40% {
    opacity: 1;
    transform: translateX(15px) scale(1.3) rotate(5deg);
    filter: blur(0);
  }
  60% {
    transform: translateX(-5px) scale(1.1) rotate(-2deg);
  }
  80% {
    transform: translateX(3px) scale(1.02) rotate(1deg);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1) rotate(0deg);
    filter: blur(0);
  }
}

@keyframes icon-drift-1 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(8px, -12px) rotate(3deg); }
  50% { transform: translate(-4px, -20px) rotate(-2deg); }
  75% { transform: translate(12px, -8px) rotate(4deg); }
}

@keyframes icon-drift-2 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-10px, 8px) rotate(-3deg); }
  50% { transform: translate(6px, 16px) rotate(2deg); }
  75% { transform: translate(-14px, 4px) rotate(-4deg); }
}

@keyframes icon-drift-3 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(14px, -10px) rotate(5deg); }
  66% { transform: translate(-8px, 12px) rotate(-3deg); }
}

/* Cloud — top right area */
.hfi-1 {
  top: 15%;
  right: 8%;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 32px rgba(60, 145, 255, 0.25), 0 0 30px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255,255,255,0.15);
  animation: icon-float-in 0.5s 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, icon-drift-1 12s 0.8s ease-in-out infinite;
  padding: 16px;
}

/* Server — right mid-upper */
.hfi-2 {
  top: 35%;
  right: 4%;
  color: #e0d4ff;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.25), 0 0 30px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255,255,255,0.15);
  animation: icon-float-in 0.5s 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, icon-drift-2 14s 0.95s ease-in-out infinite;
}

/* Database — right mid-lower */
.hfi-3 {
  top: 58%;
  right: 10%;
  color: #a7f3d0;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.25), 0 0 30px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255,255,255,0.15);
  animation: icon-float-in 0.5s 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, icon-drift-3 16s 1.1s ease-in-out infinite;
}

/* Code — right lower */
.hfi-4 {
  top: 78%;
  right: 18%;
  color: #bfdbfe;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 8px 32px rgba(60, 145, 255, 0.2), 0 0 25px rgba(255, 255, 255, 0.08), inset 0 1px 0 rgba(255,255,255,0.15);
  animation: icon-float-in 0.5s 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, icon-drift-1 11s 1.25s ease-in-out infinite;
}

/* Activity/Monitor — far right mid */
.hfi-5 {
  top: 25%;
  right: 22%;
  color: #fde68a;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: 0 8px 32px rgba(245, 158, 11, 0.25), 0 0 30px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255,255,255,0.15);
  animation: icon-float-in 0.5s 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, icon-drift-2 13s 0.9s ease-in-out infinite;
}

/* Shield — top right far */
.hfi-6 {
  top: 50%;
  right: 28%;
  color: #fca5a5;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 8px 32px rgba(239, 68, 68, 0.2), 0 0 25px rgba(255, 255, 255, 0.08), inset 0 1px 0 rgba(255,255,255,0.15);
  animation: icon-float-in 0.5s 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, icon-drift-3 15s 1.15s ease-in-out infinite;
}

/* GitBranch — far right upper */
.hfi-7 {
  top: 12%;
  right: 32%;
  color: #ddd6fe;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.2), 0 0 25px rgba(255, 255, 255, 0.08), inset 0 1px 0 rgba(255,255,255,0.15);
  animation: icon-float-in 0.5s 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, icon-drift-1 17s 1.05s ease-in-out infinite;
}

/* CPU — bottom-right area */
.hfi-8 {
  top: 70%;
  right: 35%;
  color: #bfdbfe;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 8px 32px rgba(60, 145, 255, 0.2), 0 0 25px rgba(255, 255, 255, 0.08), inset 0 1px 0 rgba(255,255,255,0.15);
  animation: icon-float-in 0.5s 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, icon-drift-2 18s 1.3s ease-in-out infinite;
}

/* Connection lines between icons (decorative) */
.hero-float-icons::before {
  content: '';
  position: absolute;
  top: 20%;
  right: 12%;
  width: 200px;
  height: 200px;
  border: 1.5px dashed rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  animation: rotate-slow 40s linear infinite;
}

.hero-float-icons::after {
  content: '';
  position: absolute;
  top: 45%;
  right: 20%;
  width: 150px;
  height: 150px;
  border: 1.5px dashed rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  animation: rotate-slow 35s linear infinite reverse;
}

/* Hide floating icons on small screens — too cramped */
@media (max-width: 1023px) {
  .hero-float-icons {
    display: none;
  }
}

/* ---- Counter animation ---- */
.counter-value {
  font-variant-numeric: tabular-nums;
}

/* ---- Video play button ---- */
.video-placeholder {
  position: relative;
  cursor: pointer;
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--color-gray-900);
}

.video-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.video-placeholder:hover img {
  transform: scale(1.03);
}

.video-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
  transition: all var(--transition-base);
  border: none;
  cursor: pointer;
}

.video-play-btn::after {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 12px 0 12px 22px;
  border-color: transparent transparent transparent var(--color-primary);
  margin-left: 4px;
}

.video-placeholder:hover .video-play-btn {
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 6px 40px rgba(0, 0, 0, 0.3);
}

.video-placeholder iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ---- Skeleton loading ---- */
.skeleton {
  background: linear-gradient(90deg, var(--color-gray-100) 25%, var(--color-gray-200) 50%, var(--color-gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

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

  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
