/* Animations */

/* Fade in from bottom */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Gradient animation */
@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Glow effect */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.1);
  }
  50% {
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.2);
  }
}

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

/* Stagger animation delays */
.fade-in:nth-child(1) {
  animation-delay: 0.1s;
}

.fade-in:nth-child(2) {
  animation-delay: 0.2s;
}

.fade-in:nth-child(3) {
  animation-delay: 0.3s;
}

.fade-in:nth-child(4) {
  animation-delay: 0.4s;
}

/* Hero logo animation */
.hero-logo {
  animation: fadeInUp 1s ease-out;
}

.hero-slogan {
  animation: fadeInUp 1s ease-out 0.2s both;
}

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

/* Hover effects for links */
.nav-menu a,
.contact-link {
  position: relative;
}

.contact-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 0;
  background: linear-gradient(180deg, var(--color-accent-start), var(--color-accent-end));
  transform: translateY(-50%);
  transition: height var(--transition-normal);
}

.contact-link:hover::before {
  height: 60%;
}

/* Case card hover effect */
.case-card {
  transition: all var(--transition-normal);
}

/* Loading animation for content */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* Smooth page transitions */
@keyframes pageIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

main {
  animation: pageIn 0.5s ease-in;
}

/* Text gradient animation */
.animated-gradient {
  background: linear-gradient(
    90deg,
    var(--color-accent-start),
    var(--color-accent-end),
    var(--color-accent-start)
  );
  background-size: 200% auto;
  animation: gradientShift 3s ease infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Subtle background pattern animation */
@keyframes backgroundPattern {
  0%, 100% {
    background-position: 0% 0%;
  }
  50% {
    background-position: 100% 100%;
  }
}

/* Micro-interactions */
button,
.lang-option,
.contact-link {
  transform: translateZ(0);
  backface-visibility: hidden;
}

button:active,
.lang-option:active {
  transform: scale(0.98);
}

/* Focus states for accessibility */
a:focus,
button:focus,
.lang-option:focus {
  outline: 2px solid var(--color-accent-start);
  outline-offset: 4px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
.lang-option:focus:not(:focus-visible) {
  outline: none;
}

/* Scroll animations */
@keyframes scrollIndicator {
  0%, 100% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateY(10px);
    opacity: 0.5;
  }
}

/* Performance optimizations */
.hero,
.case-card,
.contact-link {
  will-change: transform;
}

/* Ensure smooth scrolling on iOS */
@supports (-webkit-overflow-scrolling: touch) {
  body {
    -webkit-overflow-scrolling: touch;
  }
}

/* Visual Examples Animations */
.code-arrow {
  animation: arrowPulse 2s ease-in-out infinite;
}

@keyframes arrowPulse {
  0%, 100% {
    opacity: 0.6;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(3px);
  }
}

.code-json {
  animation: fadeInCode 0.8s ease-out;
}

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

.chat-message {
  animation: messageSlideIn 0.5s ease-out;
}

.chat-message.user {
  animation-delay: 0.2s;
}

.chat-message.ai {
  animation-delay: 0.5s;
}

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

.visual-box:hover {
  border-color: rgba(0, 212, 255, 0.4);
  background: rgba(0, 212, 255, 0.05);
  transition: all var(--transition-normal);
}

.assistant-demo:hover {
  border-color: rgba(0, 255, 136, 0.4);
  background: rgba(0, 255, 136, 0.05);
}
