/* Gaia Platform Custom Animations */

/* Fade in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide in from right (user messages) */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide in from left (assistant messages) */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide in from bottom (conversation items) */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scale in animation */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Gentle bounce */
@keyframes gentleBounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-5px);
  }
  60% {
    transform: translateY(-2px);
  }
}

/* Pulse animation for loading states */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Shimmer effect for loading */
@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

/* Animation utility classes */
.animate-fadeIn {
  animation: fadeIn 0.4s ease-out forwards;
}

.animate-slideInRight {
  animation: slideInRight 0.3s ease-out forwards;
}

.animate-slideInLeft {
  animation: slideInLeft 0.3s ease-out forwards;
}

.animate-slideInUp {
  animation: slideInUp 0.3s ease-out forwards;
}

.animate-scaleIn {
  animation: scaleIn 0.3s ease-out forwards;
}

.animate-gentleBounce {
  animation: gentleBounce 0.6s ease-in-out;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Enhanced loading spinner */
.animate-spin-smooth {
  animation: spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Shimmer loading effect */
.animate-shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
}

/* Hover effects */
.hover-lift {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Focus states */
.focus-purple {
  transition: all 0.3s ease;
}

.focus-purple:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
  border-color: rgb(168, 85, 247);
}

/* Message typing indicator */
@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-10px);
  }
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgb(148, 163, 184);
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
  animation-delay: 0s;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

/* Smooth scrolling for message container */
.smooth-scroll {
  scroll-behavior: smooth;
}

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(71, 85, 105, 0.1);
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.3);
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 85, 247, 0.5);
}

/* Stagger animation for conversation list */
.stagger-children > * {
  animation-delay: calc(var(--stagger-delay, 0) * 0.1s);
}

/* Button press animation */
.button-press {
  transition: all 0.1s ease;
}

.button-press:active {
  transform: scale(0.95);
}

/* Message bubble entrance */
.message-enter {
  animation: slideInUp 0.3s ease-out forwards;
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(
    90deg,
    rgb(51, 65, 85) 25%,
    rgb(71, 85, 105) 50%,
    rgb(51, 65, 85) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Notification slide in */
@keyframes slideInFromTop {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notification-enter {
  animation: slideInFromTop 0.4s ease-out forwards;
}

/* Hide HTMX default loading indicator */
.htmx-indicator {
  display: none !important;
}

/* Alternative: make it invisible but keep layout */
.htmx-request .htmx-indicator {
  opacity: 0;
  display: none;
}