@tailwind base;
@tailwind components;
@tailwind utilities;

/* Fix xterm cursor not showing */
.xterm .xterm-viewport {
  cursor: text !important;
}

@layer components {
  .chat-markdown {
    @apply text-sm leading-7 text-gray-800;
  }

  .chat-markdown > :first-child {
    @apply mt-0;
  }

  .chat-markdown > :last-child {
    @apply mb-0;
  }

  .chat-markdown p {
    @apply my-2;
  }

  .chat-markdown h1 {
    @apply mb-3 mt-5 text-xl font-semibold leading-8 text-gray-950;
  }

  .chat-markdown h2 {
    @apply mb-2 mt-4 text-lg font-semibold leading-7 text-gray-950;
  }

  .chat-markdown h3 {
    @apply mb-2 mt-3 text-base font-semibold leading-7 text-gray-900;
  }

  .chat-markdown ul {
    @apply my-2 list-disc space-y-1 pl-5;
  }

  .chat-markdown ol {
    @apply my-2 list-decimal space-y-1 pl-5;
  }

  .chat-markdown li > p {
    @apply my-1;
  }

  .chat-markdown blockquote {
    @apply my-3 border-l-4 border-blue-200 bg-blue-50/70 px-3 py-2 text-gray-700;
  }

  .chat-markdown pre {
    @apply my-3 overflow-x-auto rounded-xl bg-gray-950 px-4 py-3 text-xs leading-5 text-gray-100;
  }

  .chat-markdown code {
    @apply rounded bg-gray-100 px-1 py-0.5 font-mono text-[0.92em] text-gray-800;
  }

  .chat-markdown pre code {
    @apply rounded-none bg-transparent p-0 text-gray-100;
  }

  .chat-markdown a {
    @apply font-medium text-blue-600 underline decoration-blue-200 underline-offset-2 hover:text-blue-700;
  }

  .chat-markdown strong {
    @apply font-semibold text-gray-900;
  }

  .chat-markdown table {
    @apply my-3 w-full table-auto rounded-xl border border-gray-200 text-left text-sm;
    border-collapse: separate;
    border-spacing: 0;
  }

  .chat-markdown thead {
    @apply bg-gray-50;
  }

  .chat-markdown th {
    @apply border-b border-gray-200 px-3 py-2 font-semibold text-gray-700;
  }

  .chat-markdown td {
    @apply border-b border-gray-100 px-3 py-2 text-gray-700;
  }
}
