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

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

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6366f1;
  animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

/* Markdown content */
.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
  font-weight: 600;
  margin: 1em 0 0.5em;
}

.markdown-content h1 { font-size: 1.25rem; }
.markdown-content h2 { font-size: 1.125rem; }
.markdown-content h3 { font-size: 1rem; }

.markdown-content p {
  margin: 0.5em 0;
  line-height: 1.6;
}

.markdown-content ul,
.markdown-content ol {
  margin: 0.5em 0;
  padding-left: 1.5em;
}

.markdown-content ul { list-style: disc; }
.markdown-content ol { list-style: decimal; }

.markdown-content li {
  margin: 0.25em 0;
}

.markdown-content code {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.875em;
}

.markdown-content pre {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1em;
  margin: 0.75em 0;
  overflow-x: auto;
}

.markdown-content pre code {
  background: none;
  padding: 0;
}

.markdown-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.75em 0;
}

.markdown-content th,
.markdown-content td {
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5em 0.75em;
  text-align: left;
}

.markdown-content th {
  background: rgba(255, 255, 255, 0.05);
  font-weight: 600;
}

.markdown-content blockquote {
  border-left: 3px solid #6366f1;
  padding-left: 1em;
  margin: 0.75em 0;
  color: #9ca3af;
}

.markdown-content a {
  color: #818cf8;
  text-decoration: underline;
}

.markdown-content strong {
  font-weight: 600;
  color: #e5e7eb;
}

/* Quick action hover */
.quick-action:hover {
  transform: translateY(-1px);
}

/* Fade in animation */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tool call badge */
.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 9999px;
  font-size: 0.75rem;
  color: #a5b4fc;
}

/* Responsive sidebar */
@media (max-width: 1023px) {
  #sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  #sidebar.open {
    transform: translateX(0);
  }
}

/* Welcome Wizard */
.wizard-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.wizard-overlay.hidden {
  display: none;
}

.wizard-overlay.visible {
  opacity: 1;
}

.wizard-modal {
  position: relative;
  background: #1f2937;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 2rem;
  max-width: 520px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.wizard-overlay.visible .wizard-modal {
  transform: scale(1);
}

.wizard-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transition: all 0.2s ease;
}

.wizard-dot.active {
  background: #6366f1;
  width: 20px;
  border-radius: 4px;
}

.wizard-dot.completed {
  background: #6366f1;
}

.wizard-step {
  display: none;
  animation: wizardFadeIn 0.3s ease;
}

.wizard-step.active {
  display: block;
}

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

.wizard-cap-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  padding: 0.875rem;
  transition: border-color 0.2s ease;
}

.wizard-cap-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
}
