/* Global styles for Spring AI Studio */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#root {
  min-height: 100vh;
}

/* Loading animation */
.spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Utility classes */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Enhanced animations for interactive canvas */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Canvas interaction animations */
.animate-fadeIn {
  animation: fadeIn 0.3s ease-in;
}

.animate-slideInLeft {
  animation: slideInLeft 0.4s ease-out;
}

.animate-slideInUp {
  animation: slideInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.animate-scaleIn {
  animation: scaleIn 0.2s ease-out;
}

/* Custom slider styling for Visual JSON Editor */
.slider::-webkit-slider-thumb {
  appearance: none;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8B5CF6, #3B82F6);
  cursor: pointer;
  border: 2px solid #1E293B;
  box-shadow: 0 4px 8px rgba(139, 92, 246, 0.3);
  transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
  box-shadow: 0 6px 12px rgba(139, 92, 246, 0.4);
  transform: scale(1.1);
}

.slider::-moz-range-thumb {
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8B5CF6, #3B82F6);
  cursor: pointer;
  border: 2px solid #1E293B;
  box-shadow: 0 4px 8px rgba(139, 92, 246, 0.3);
  transition: all 0.2s ease;
}

.slider::-moz-range-thumb:hover {
  box-shadow: 0 6px 12px rgba(139, 92, 246, 0.4);
  transform: scale(1.1);
}

/* Enhanced slider styling for psychology-based frontend controls */
.slider-enhanced::-webkit-slider-thumb {
  appearance: none;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  cursor: pointer;
  border: 2px solid #8b5cf6;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.slider-enhanced::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4), 0 4px 8px rgba(0, 0, 0, 0.15);
}

.slider-enhanced::-webkit-slider-thumb:active {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.5);
}

.slider-enhanced::-moz-range-thumb {
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  cursor: pointer;
  border: 2px solid #8b5cf6;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
  transition: all 0.2s ease;
}

.slider-enhanced::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}

/* Line clamp utilities for sidebar tool descriptions */
.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* Enhanced popup animations for psychology-based UI */
@keyframes popupFadeIn {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(8px);
  }
}

@keyframes popupScaleIn {
  from {
    opacity: 0;
    transform: scale(0.85) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes imageSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes floatingParticle {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-10px) rotate(180deg);
    opacity: 1;
  }
}

@keyframes gentleGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.1);
  }
  50% {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
  }
}

.animate-popupFadeIn {
  animation: popupFadeIn 0.3s ease-out;
}

.animate-popupScaleIn {
  animation: popupScaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.animate-imageSlideIn {
  animation: imageSlideIn 0.5s ease-out forwards;
}

.animate-floatingParticle {
  animation: floatingParticle 3s ease-in-out infinite;
}

.animate-gentleGlow {
  animation: gentleGlow 2s ease-in-out infinite;
}

/* Custom scrollbar for image picker */
.scrollbar-thin::-webkit-scrollbar {
  width: 6px;
}

.scrollbar-track-slate-800::-webkit-scrollbar-track {
  background: rgba(30, 41, 59, 0.5);
  border-radius: 10px;
}

.scrollbar-thumb-slate-600::-webkit-scrollbar-thumb {
  background: rgba(71, 85, 105, 0.8);
  border-radius: 10px;
  transition: background 0.3s ease;
}

.scrollbar-thumb-slate-600::-webkit-scrollbar-thumb:hover {
  background: rgba(71, 85, 105, 1);
}