/* ═══════════════════════════════════════════════════════════════
   TOMCO TECHNOLOGIES - ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

/* ───────────────────────────────────────────────────────────────
   KEYFRAMES
   ─────────────────────────────────────────────────────────────── */

@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 scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

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

@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(58, 78, 225, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(207, 28, 213, 0.6);
  }
}

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

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

@keyframes slideUpBounce {
  0% {
    opacity: 0;
    transform: translateY(50px);
  }
  60% {
    opacity: 1;
    transform: translateY(-8px);
  }
  80% {
    transform: translateY(4px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes scaleInBounce {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes borderGlow {
  0%, 100% {
    border-color: rgba(58, 78, 225, 0.3);
    box-shadow: 0 0 20px rgba(58, 78, 225, 0.2);
  }
  50% {
    border-color: rgba(207, 28, 213, 0.5);
    box-shadow: 0 0 40px rgba(207, 28, 213, 0.4);
  }
}

@keyframes floatSlow {
  0%, 100% {
    transform: translateY(0) translateX(0);
  }
  25% {
    transform: translateY(-10px) translateX(5px);
  }
  50% {
    transform: translateY(-20px) translateX(-5px);
  }
  75% {
    transform: translateY(-10px) translateX(5px);
  }
}

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

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

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

@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;
  }
}

/* ───────────────────────────────────────────────────────────────
   ANIMATION CLASSES
   ─────────────────────────────────────────────────────────────── */

.animate-fade-in {
  animation: fadeIn 0.6s ease-out;
}

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

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

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

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

.animate-scale-in {
  animation: scaleIn 0.5s ease-out;
}

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

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

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

.animate-rotate {
  animation: rotate 20s linear infinite;
}

.animate-slide-up-bounce {
  animation: slideUpBounce 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-scale-in-bounce {
  animation: scaleInBounce 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* Stagger delays for list items */
.animate-stagger > * {
  animation: fadeInUp 0.6s ease-out;
}

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

/* ───────────────────────────────────────────────────────────────
   TYPING EFFECT
   ─────────────────────────────────────────────────────────────── */

.typing-cursor::after {
  content: '|';
  color: var(--magenta-tech);
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}

/* ───────────────────────────────────────────────────────────────
   HOVER EFFECTS
   ─────────────────────────────────────────────────────────────── */

.hover-lift {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
  transform: translateY(-8px);
  filter: brightness(1.1);
}

.hover-scale {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-scale:hover {
  transform: scale(1.08);
  filter: brightness(1.1);
}

.hover-glow {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-glow:hover {
  box-shadow:
    0 0 40px rgba(58, 78, 225, 0.6),
    0 0 80px rgba(58, 78, 225, 0.3);
  filter: brightness(1.15);
}

.hover-tilt {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.hover-tilt:hover {
  transform: perspective(1000px) rotateX(5deg) rotateY(-5deg) translateY(-5px);
}

.hover-shine {
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}

.hover-shine::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  bottom: -50%;
  left: -50%;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotateZ(60deg) translateX(-100%);
  transition: transform 0.6s ease;
}

.hover-shine:hover::after {
  transform: rotateZ(60deg) translateX(100%);
}

/* ───────────────────────────────────────────────────────────────
   GRADIENT ANIMATION
   ─────────────────────────────────────────────────────────────── */

.gradient-animated {
  background: linear-gradient(
    270deg,
    var(--blue-electric),
    var(--violet-mid),
    var(--magenta-tech),
    var(--violet-mid),
    var(--blue-electric)
  );
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
}

/* ───────────────────────────────────────────────────────────────
   CIRCUIT LINES ANIMATION
   ─────────────────────────────────────────────────────────────── */

.circuit-line {
  position: relative;
  overflow: hidden;
}

.circuit-line::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--blue-electric),
    var(--magenta-tech),
    transparent
  );
  animation: shimmer 3s ease-in-out infinite;
}

/* ───────────────────────────────────────────────────────────────
   LOADING SPINNER
   ─────────────────────────────────────────────────────────────── */

.spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--blue-electric);
  border-radius: 50%;
  animation: rotate 0.8s linear infinite;
}

.spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.spinner-lg {
  width: 60px;
  height: 60px;
  border-width: 4px;
}

/* ───────────────────────────────────────────────────────────────
   SCROLL REVEAL (used with AOS or custom JS)
   ─────────────────────────────────────────────────────────────── */

[data-aos] {
  opacity: 0;
  transition-property: opacity, transform;
}

[data-aos].aos-animate {
  opacity: 1;
}

/* ───────────────────────────────────────────────────────────────
   PARALLAX
   ─────────────────────────────────────────────────────────────── */

.parallax {
  transform: translateZ(0);
  will-change: transform;
}

/* ───────────────────────────────────────────────────────────────
   PERFORMANCE OPTIMIZATION
   ─────────────────────────────────────────────────────────────── */

.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

.gpu-accelerated {
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  perspective: 1000px;
  -webkit-perspective: 1000px;
}

/* ───────────────────────────────────────────────────────────────
   REDUCE MOTION (Accessibility)
   ─────────────────────────────────────────────────────────────── */

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