/* SaltedAI Website - Advanced Animations & Interactions */

/* ===== KEYFRAME ANIMATIONS ===== */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes slideInFromLeft {
  0% { transform: translateX(-100%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes slideInFromRight {
  0% { transform: translateX(100%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes slideInFromBottom {
  0% { transform: translateY(50px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

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

@keyframes rotateIn {
  0% { transform: rotate(-180deg) scale(0.5); opacity: 0; }
  100% { transform: rotate(0deg) scale(1); opacity: 1; }
}

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

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

@keyframes editorGlow {
  0% {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  }
  100% {
    box-shadow: 0 20px 60px rgba(56, 240, 196, 0.15),
                0 0 40px rgba(34, 145, 209, 0.1);
  }
}

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

@keyframes blink {
  0%, 50% { border-color: transparent; }
  51%, 100% { border-color: var(--primary-blue); }
}

/* ===== HERO ANIMATIONS ===== */
.hero-title {
  animation: slideInFromLeft 1s ease-out 0.2s both;
}

.hero-subtitle {
  animation: slideInFromLeft 1s ease-out 0.4s both;
}

.hero-cta {
  animation: slideInFromLeft 1s ease-out 0.6s both;
}

.hero-visual {
  animation: slideInFromRight 1s ease-out 0.3s both;
}

.code-editor-container {
  animation: fadeInScale 1.2s ease-out 0.8s both;
}

.editor-content {
  animation: fadeIn 1s ease-out 1.5s both;
}

.typing-animation {
  animation: slideInFromLeft 0.8s ease-out 2s both;
}

/* ===== FLOATING ELEMENTS ===== */
.floating {
  animation: float 3s ease-in-out infinite;
}

.floating-delayed {
  animation: float 3s ease-in-out infinite 1.5s;
}

/* ===== SCROLL ANIMATIONS ===== */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

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

.scroll-animate-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.8s ease-out;
}

.scroll-animate-left.animate {
  opacity: 1;
  transform: translateX(0);
}

.scroll-animate-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.8s ease-out;
}

.scroll-animate-right.animate {
  opacity: 1;
  transform: translateX(0);
}

.scroll-animate-scale {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.8s ease-out;
}

.scroll-animate-scale.animate {
  opacity: 1;
  transform: scale(1);
}

/* ===== BUTTON ANIMATIONS ===== */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-shimmer {
  background: linear-gradient(90deg, var(--primary-blue), var(--primary-teal), var(--primary-blue));
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
}

/* ===== CARD ANIMATIONS ===== */
.card-hover-lift {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover-lift:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

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

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

/* ===== ICON ANIMATIONS ===== */
.icon-spin {
  animation: spin 2s linear infinite;
}

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

.icon-bounce {
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% { transform: translate3d(0,0,0); }
  40%, 43% { transform: translate3d(0,-30px,0); }
  70% { transform: translate3d(0,-15px,0); }
  90% { transform: translate3d(0,-4px,0); }
}

/* ===== TEXT ANIMATIONS ===== */
.typewriter {
  overflow: hidden;
  border-right: 2px solid var(--primary-blue);
  white-space: nowrap;
  animation: typewriter 3s steps(40, end), blink 0.75s step-end infinite;
}

.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s ease-in-out infinite;
}

/* ===== LOADING ANIMATIONS ===== */
.loading-dots {
  display: inline-block;
}

.loading-dots::after {
  content: '';
  animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

/* ===== PROGRESS ANIMATIONS ===== */
.progress-bar {
  position: relative;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width 1s ease-out;
}

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

/* ===== STAGGER ANIMATIONS ===== */
.stagger-item {
  opacity: 0;
  transform: translateY(20px);
  animation: slideInFromBottom 0.6s ease-out forwards;
}

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

/* ===== HOVER EFFECTS ===== */
.hover-glow {
  transition: all 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(56, 240, 196, 0.3);
}

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

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

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

.hover-rotate:hover {
  transform: rotate(5deg);
}

/* ===== PARTICLE EFFECTS ===== */
.particles {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--primary-teal);
  border-radius: 50%;
  opacity: 0.7;
  animation: float 6s ease-in-out infinite;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { left: 20%; animation-delay: 1s; }
.particle:nth-child(3) { left: 30%; animation-delay: 2s; }
.particle:nth-child(4) { left: 40%; animation-delay: 3s; }
.particle:nth-child(5) { left: 50%; animation-delay: 4s; }

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

@media (max-width: 768px) {
  .hero-title,
  .hero-subtitle,
  .hero-cta,
  .hero-visual {
    animation: fadeInScale 0.8s ease-out both;
  }
  
  .stagger-item {
    animation-delay: 0.1s !important;
  }
}
