/* Elite Cloud Hosting - 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 slideInLeft {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
  }
  50% {
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.8);
  }
}

@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@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 pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-30px);
  }
  60% {
    transform: translateY(-15px);
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

/* Animation Classes */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.stagger-animation > * {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-animation > *.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Delay Classes */
.delay-100 {
  animation-delay: 100ms;
  transition-delay: 100ms;
}

.delay-200 {
  animation-delay: 200ms;
  transition-delay: 200ms;
}

.delay-300 {
  animation-delay: 300ms;
  transition-delay: 300ms;
}

.delay-400 {
  animation-delay: 400ms;
  transition-delay: 400ms;
}

.delay-500 {
  animation-delay: 500ms;
  transition-delay: 500ms;
}

/* Hover Effects */
.hover-float:hover {
  animation: float 2s ease-in-out infinite;
}

.hover-glow:hover {
  animation: glow 2s ease-in-out infinite;
}

.hover-pulse:hover {
  animation: pulse 1s ease-in-out infinite;
}

.hover-rotate:hover {
  animation: rotate 0.5s ease-in-out;
}

.hover-shake:hover {
  animation: shake 0.5s ease-in-out;
}

/* Text Animations */
.text-shimmer {
  background: linear-gradient(
    90deg,
    var(--text-primary) 0%,
    var(--color-primary) 50%,
    var(--text-primary) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s linear infinite;
}

.text-gradient-animate {
  background: linear-gradient(
    -45deg,
    #ee7752,
    #e73c7e,
    #23a6d5,
    #23d5ab
  );
  background-size: 400% 400%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient 3s ease infinite;
}

/* Loading States */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-secondary) 25%,
    var(--bg-tertiary) 50%,
    var(--bg-secondary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--glass-border);
  border-top: 3px solid var(--color-primary);
  border-radius: 50%;
  animation: rotate 1s linear infinite;
}

/* Parallax */
.parallax {
  transition: none;
  will-change: transform;
}

.parallax-slow {
  --parallax-speed: 0.3;
}

.parallax-medium {
  --parallax-speed: 0.5;
}

.parallax-fast {
  --parallax-speed: 0.8;
}

/* Reveal Effects */
.reveal-text {
  position: relative;
  overflow: hidden;
}

.reveal-text::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  transform: translateX(-100%);
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-text.revealed::after {
  transform: translateX(100%);
}

/* Glitch Effect */
.glitch {
  position: relative;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch::before {
  animation: glitch-1 0.3s infinite;
  color: var(--color-primary);
  z-index: -1;
}

.glitch::after {
  animation: glitch-2 0.3s infinite;
  color: var(--color-accent);
  z-index: -2;
}

@keyframes glitch-1 {
  0%, 100% {
    clip-path: inset(0 0 0 0);
    transform: translate(0);
  }
  20% {
    clip-path: inset(20% 0 30% 0);
    transform: translate(-2px, 2px);
  }
  40% {
    clip-path: inset(50% 0 20% 0);
    transform: translate(2px, -2px);
  }
  60% {
    clip-path: inset(10% 0 60% 0);
    transform: translate(-2px, 1px);
  }
  80% {
    clip-path: inset(70% 0 10% 0);
    transform: translate(1px, -1px);
  }
}

@keyframes glitch-2 {
  0%, 100% {
    clip-path: inset(0 0 0 0);
    transform: translate(0);
  }
  20% {
    clip-path: inset(60% 0 10% 0);
    transform: translate(2px, -1px);
  }
  40% {
    clip-path: inset(10% 0 70% 0);
    transform: translate(-2px, 2px);
  }
  60% {
    clip-path: inset(30% 0 40% 0);
    transform: translate(1px, -2px);
  }
  80% {
    clip-path: inset(80% 0 5% 0);
    transform: translate(-1px, 1px);
  }
}

/* Morphing Backgrounds */
.morph-bg {
  background: linear-gradient(
    -45deg,
    rgba(0, 212, 255, 0.1),
    rgba(124, 58, 237, 0.1),
    rgba(0, 212, 255, 0.1),
    rgba(124, 58, 237, 0.1)
  );
  background-size: 400% 400%;
  animation: gradient 15s ease infinite;
}

/* Ripple Button Effect */
.ripple-button {
  position: relative;
  overflow: hidden;
}

.ripple-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple-button:active::before {
  width: 300px;
  height: 300px;
}

/* Typewriter Effect */
.typewriter {
  overflow: hidden;
  border-right: 0.15em solid var(--color-primary);
  white-space: nowrap;
  animation: typing 3.5s steps(40, end), blink 0.75s step-end infinite;
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink {
  from, to {
    border-color: transparent;
  }
  50% {
    border-color: var(--color-primary);
  }
}

/* 3D Card Effect */
.card-3d {
  transform-style: preserve-3d;
  transition: transform 0.6s;
}

.card-3d:hover {
  transform: rotateY(10deg) rotateX(-10deg);
}

/* Neon Text */
.neon-text {
  text-shadow: 
    0 0 10px var(--color-primary),
    0 0 20px var(--color-primary),
    0 0 30px var(--color-primary),
    0 0 40px var(--color-primary);
  animation: neon-flicker 2s infinite;
}

@keyframes neon-flicker {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

/* Liquid Button */
.liquid-button {
  position: relative;
  overflow: hidden;
}

.liquid-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, var(--color-primary) 0%, transparent 70%);
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.5s ease;
  border-radius: 50%;
}

.liquid-button:hover::before {
  transform: translate(-50%, -50%) scale(1);
}

/* Magnetic Effect */
.magnetic {
  transition: transform 0.2s ease;
}

/* Breathing Animation */
.breathing {
  animation: breathing 4s ease-in-out infinite;
}

@keyframes breathing {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Elastic Animation */
.elastic {
  animation: elastic 1s ease-in-out;
}

@keyframes elastic {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.25);
  }
  40% {
    transform: scale(0.75);
  }
  60% {
    transform: scale(1.15);
  }
  80% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}
