/* ============================================
   VISUOSOFTS — ANIMATIONS & INTERACTIVE EFFECTS
   ============================================ */

/* ===== PARTICLE SYSTEM ===== */
.particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--red);
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat 20s linear infinite;
}

@keyframes particleFloat {
  0% {
    transform: translateY(100vh) translateX(0) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(-100px) translateX(100px) scale(1);
    opacity: 0;
  }
}

/* Stagger particle animations */
.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 18s; }
.particle:nth-child(2) { left: 20%; animation-delay: 2s; animation-duration: 22s; }
.particle:nth-child(3) { left: 30%; animation-delay: 4s; animation-duration: 20s; }
.particle:nth-child(4) { left: 40%; animation-delay: 1s; animation-duration: 19s; }
.particle:nth-child(5) { left: 50%; animation-delay: 3s; animation-duration: 21s; }
.particle:nth-child(6) { left: 60%; animation-delay: 5s; animation-duration: 23s; }
.particle:nth-child(7) { left: 70%; animation-delay: 2s; animation-duration: 18s; }
.particle:nth-child(8) { left: 80%; animation-delay: 4s; animation-duration: 20s; }
.particle:nth-child(9) { left: 90%; animation-delay: 1s; animation-duration: 22s; }
.particle:nth-child(10) { left: 15%; animation-delay: 6s; animation-duration: 19s; }

/* ===== FLOATING SHAPES ===== */
.floating-shape {
  position: absolute;
  opacity: 0.03;
  animation: shapeFloat 30s ease-in-out infinite;
}

.floating-shape.circle {
  width: 200px;
  height: 200px;
  border: 2px solid var(--red);
  border-radius: 50%;
  top: 20%;
  right: 10%;
}

.floating-shape.square {
  width: 150px;
  height: 150px;
  border: 2px solid var(--red);
  transform: rotate(45deg);
  top: 60%;
  left: 5%;
  animation-delay: -10s;
}

@keyframes shapeFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-30px) rotate(5deg);
  }
  50% {
    transform: translateY(0) rotate(0deg);
  }
  75% {
    transform: translateY(30px) rotate(-5deg);
  }
}

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

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
}

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

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

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

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

/* ===== TEXT ANIMATIONS ===== */
.text-gradient {
  background: linear-gradient(135deg, var(--red) 0%, #ff4545 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease infinite;
}

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

.typing-effect {
  overflow: hidden;
  border-right: 3px solid var(--red);
  white-space: nowrap;
  animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

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

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: var(--red); }
}

/* ===== PULSE EFFECTS ===== */
.pulse-dot {
  position: relative;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--red);
  transform: translate(-50%, -50%);
  animation: pulse 2s ease-out infinite;
  opacity: 0.6;
}

@keyframes pulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
  }
  100% {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
  }
}

/* ===== LOADING ANIMATIONS ===== */
.loading-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ===== PARALLAX EFFECTS ===== */
.parallax-layer {
  transition: transform 0.3s ease-out;
}

/* ===== SLIDE IN ANIMATIONS ===== */
.slide-in-left {
  animation: slideInLeft 0.8s ease-out both;
}

.slide-in-right {
  animation: slideInRight 0.8s ease-out both;
}

.slide-in-bottom {
  animation: slideInBottom 0.8s ease-out both;
}

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

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

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

/* ===== BOUNCE EFFECTS ===== */
.bounce-in {
  animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) both;
}

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

/* ===== GLOW EFFECTS ===== */
.glow-on-hover {
  transition: box-shadow 0.3s ease;
}

.glow-on-hover:hover {
  box-shadow: 0 0 30px rgba(250, 14, 15, 0.4);
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--red);
  border-radius: 2px;
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ===== INTERACTIVE CURSOR TRAIL ===== */
.cursor-trail {
  position: fixed;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--red);
  pointer-events: none;
  opacity: 0.6;
  z-index: 9999;
  animation: cursorFade 0.5s ease-out forwards;
}

@keyframes cursorFade {
  to {
    transform: scale(2);
    opacity: 0;
  }
}

/* ===== CARD FLIP EFFECT ===== */
.flip-card {
  perspective: 1000px;
  cursor: pointer;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 8px;
}

.flip-card-back {
  transform: rotateY(180deg);
  background: var(--red);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ===== RIPPLE EFFECT ===== */
.ripple-effect {
  position: relative;
  overflow: hidden;
}

.ripple-effect::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(250, 14, 15, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple-effect:active::after {
  width: 300px;
  height: 300px;
}

/* ===== STAGGER CHILDREN ===== */
.stagger-children > * {
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }

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

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
  .particles-container {
    display: none; /* Disable particles on mobile for performance */
  }
  
  .floating-shape {
    display: none;
  }
}
