/* Animations CSS for Quantus website */

/* Particle animation */
.particles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

.particle {
  position: absolute;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  pointer-events: none;
  animation: float-particle 15s infinite linear;
}

@keyframes float-particle {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-100vh) translateX(100px);
    opacity: 0;
  }
}

/* Floating animation for cards */
.float-animation {
  animation: float 6s ease-in-out infinite;
}

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

/* Pulse animation */
.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(123, 104, 238, 0.7);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(123, 104, 238, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(123, 104, 238, 0);
  }
}

/* Fade in animation */
.fade-in {
  animation: fadeIn 1s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Slide in animations */
.slide-in-left {
  animation: slideInLeft 1s ease-in-out;
}

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

.slide-in-up {
  animation: slideInUp 1s ease-in-out;
}

.slide-in-down {
  animation: slideInDown 1s ease-in-out;
}

@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 slideInUp {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

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

/* Animate on scroll */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* Typing animation */
.typing {
  overflow: hidden;
  border-right: 0.15em solid var(--accent-color);
  white-space: nowrap;
  margin: 0 auto;
  letter-spacing: 0.15em;
  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(--accent-color) }
}

/* Glow animation */
.glow {
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px var(--primary-color), 0 0 20px var(--primary-color);
  }
  to {
    text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px var(--accent-color), 0 0 40px var(--accent-color);
  }
}

/* Scroll to top button animation */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
  z-index: 999;
}

.scroll-top:hover {
  background-color: var(--accent-color);
}

.scroll-top.show {
  opacity: 1;
  transform: translateY(0);
}

/* Shake animation */
.shake {
  animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% {
    transform: translate3d(-1px, 0, 0);
  }
  
  20%, 80% {
    transform: translate3d(2px, 0, 0);
  }

  30%, 50%, 70% {
    transform: translate3d(-4px, 0, 0);
  }

  40%, 60% {
    transform: translate3d(4px, 0, 0);
  }
}

/* Bounce animation */
.bounce {
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}

/* Rotate animation */
.rotate {
  animation: rotate 10s linear infinite;
}

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

/* Professional Text Animations */
.typewriter {
  overflow: hidden;
  border-right: 3px solid var(--accent-color);
  white-space: nowrap;
  margin: 0 auto;
  letter-spacing: 0.1em;
  animation: typewriter 4s steps(40, end), blink 0.75s step-end infinite;
}

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

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

.gradient-text {
  background: linear-gradient(45deg, var(--primary-color), var(--accent-color), var(--secondary-color));
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease-in-out infinite;
}

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

.text-reveal {
  position: relative;
  overflow: hidden;
}

.text-reveal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary-color);
  animation: textReveal 2s ease-in-out forwards;
  z-index: 1;
}

@keyframes textReveal {
  0% { transform: translateX(0); }
  50% { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

.morphing-text {
  animation: morphText 4s ease-in-out infinite;
  transform-origin: center;
}

@keyframes morphText {
  0%, 100% { transform: scale(1) rotateX(0deg); }
  25% { transform: scale(1.05) rotateX(5deg); }
  50% { transform: scale(1.1) rotateX(0deg); }
  75% { transform: scale(1.05) rotateX(-5deg); }
}

.professional-glow {
  animation: professionalGlow 3s ease-in-out infinite;
}

@keyframes professionalGlow {
  0%, 100% {
    text-shadow: 0 0 5px rgba(67, 56, 202, 0.3),
                 0 0 10px rgba(67, 56, 202, 0.2),
                 0 0 15px rgba(67, 56, 202, 0.1);
  }
  50% {
    text-shadow: 0 0 10px rgba(67, 56, 202, 0.5),
                 0 0 20px rgba(67, 56, 202, 0.3),
                 0 0 30px rgba(67, 56, 202, 0.2);
  }
}

.slide-up-fade {
  animation: slideUpFade 1.5s ease-out forwards;
  opacity: 0;
  transform: translateY(30px);
}

@keyframes slideUpFade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.letter-spacing-animation {
  animation: letterSpacing 2s ease-in-out infinite;
}

@keyframes letterSpacing {
  0%, 100% { letter-spacing: 0.1em; }
  50% { letter-spacing: 0.3em; }
}