/* ChatPreview specific styles */

/* Smooth animations for the query panel overlay */
@keyframes slide-in-right {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.animate-slide-in-right {
  animation: slide-in-right 0.3s ease-out;
}

/* Improved scrollbar for chat */
.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background-color: #404040;
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background-color: #555555;
}

/* Dashboard card enhancements */
.dashboard-card-shadow {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* Better focus states */
.focus-ring:focus {
  outline: 2px solid #4a9eff;
  outline-offset: 2px;
}

/* Version dropdown improvements */
.version-dropdown {
  backdrop-filter: blur(8px);
  background: rgba(26, 26, 26, 0.95);
}

/* Loading states */
.loading-overlay {
  backdrop-filter: blur(2px);
  background: rgba(0, 0, 0, 0.4);
}

/* Error indicator pulse */
@keyframes error-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.error-indicator {
  animation: error-pulse 2s infinite;
}

/* Improved button hover states */
.dashboard-button {
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Chat input enhancements */
.chat-input-focus:focus-within {
  box-shadow: 0 0 0 1px #404040, 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Message fade-in animation */
@keyframes message-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-fade-in {
  animation: message-fade-in 0.3s ease-out;
}

.resizable-split-panel {
  --split-panel-duration: 380ms;
  --split-panel-easing: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Chat area layout transitions */
.chat-area {
  transition: width 300ms cubic-bezier(0.4, 0, 0.2, 1),
              flex 300ms cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
}

.chat-area-centered {
  flex: 1 1 100%;
  width: 100%;
}

.chat-area-with-preview {
  width: 100%;
  height: 100%;
}

/* Slide-in preview panel */
.preview-panel {
  position: relative;
  overflow: hidden;
  transition: flex 300ms cubic-bezier(0.4, 0, 0.2, 1),
              width 300ms cubic-bezier(0.4, 0, 0.2, 1),
              opacity 200ms ease;
}

.preview-panel-open {
  width: 100%;
  height: 100%;
  opacity: 1;
}

.preview-panel-closed {
  flex: 0 0 0%;
  width: 0%;
  opacity: 0;
  pointer-events: none;
}

/* Reduced motion: skip animations */
@media (prefers-reduced-motion: reduce) {
  .resizable-split-panel {
    --split-panel-duration: 1ms;
  }

  .chat-area,
  .preview-panel {
    transition: none;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .max-w-\[50\.4rem\] {
    max-width: 90vw;
  }

  .dashboard-card-mobile {
    margin: 0 1rem;
  }

  .chat-area-with-preview {
    flex: 0 0 0%;
    width: 0%;
    overflow: hidden;
  }

  .preview-panel-open {
    flex: 0 0 100%;
    width: 100%;
  }
}
