@import "tailwindcss";
@import "tw-animate-css";

@source "../node_modules/streamdown/dist/index.js";

@custom-variant dark (&:is(.dark *));

:root {
  --radius: 0.5rem;
  --ds-gray-500: oklch(0.836 0 0);
  /* Monochrome light theme */
  --background: oklch(1.0 0 0);
  --foreground: oklch(0.1 0 0);
  --card: oklch(0.98 0 0);
  --card-foreground: oklch(0.1 0 0);
  --popover: oklch(0.98 0 0);
  --popover-foreground: oklch(0.1 0 0);
  --primary: oklch(0.1 0 0);
  --primary-foreground: oklch(1.0 0 0);
  --secondary: oklch(0.92 0 0);
  --secondary-foreground: oklch(0.1 0 0);
  --muted: oklch(0.92 0 0);
  --muted-foreground: oklch(0.45 0 0);
  --accent: oklch(0.92 0 0);
  --accent-foreground: oklch(0.1 0 0);
  --destructive: oklch(0.55 0.2 25);
  --destructive-foreground: oklch(1.0 0 0);
  --border: oklch(0.85 0 0);
  --input: oklch(0.85 0 0);
  --ring: oklch(0.6 0 0);
  --chat-bg: oklch(0.95 0 0);
}

.dark {
  --ds-gray-500: oklch(0.39 0 0);
  /* Monochrome dark theme */
  --background: oklch(0.0 0 0);
  --foreground: oklch(0.98 0 0);
  --card: oklch(0.08 0 0);
  --card-foreground: oklch(0.98 0 0);
  --popover: oklch(0.08 0 0);
  --popover-foreground: oklch(0.98 0 0);
  --primary: oklch(0.98 0 0);
  --primary-foreground: oklch(0.0 0 0);
  --secondary: oklch(0.15 0 0);
  --secondary-foreground: oklch(0.98 0 0);
  --muted: oklch(0.15 0 0);
  --muted-foreground: oklch(0.6 0 0);
  --accent: oklch(0.15 0 0);
  --accent-foreground: oklch(0.98 0 0);
  --destructive: oklch(0.65 0.2 25);
  --destructive-foreground: oklch(0.98 0 0);
  --border: oklch(0.25 0 0);
  --input: oklch(0.25 0 0);
  --ring: oklch(0.4 0 0);
  --chat-bg: oklch(0.25 0 0);
}

@theme inline {
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --radius-2xl: calc(var(--radius) + 8px);
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);
}

@layer base {
  * {
    @apply border-border;
  }
  
  body {
    @apply bg-background text-foreground antialiased;
    font-family: var(--font-geist-sans), system-ui, sans-serif;
  }

  ::selection {
    @apply bg-foreground text-background;
  }

  code {
    font-family: var(--font-geist-mono), ui-monospace, monospace;
    @apply bg-secondary px-1.5 py-0.5 rounded text-sm;
  }

  pre {
    font-family: var(--font-geist-mono), ui-monospace, monospace;
    @apply overflow-x-auto text-sm leading-relaxed;
  }

  pre code {
    @apply bg-transparent p-0;
  }

  /* Hide page scrollbar */
  html {
    scrollbar-width: none;
  }

  html::-webkit-scrollbar {
    display: none;
  }

}

button {
  cursor: pointer;
}

/* Tool call shimmer animation */
@keyframes tool-shimmer {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 0.5; }
}

.animate-tool-shimmer {
  animation: tool-shimmer 1.5s ease-in-out infinite;
}

/* Fix list rendering in chat content */
.docs-chat-content ul,
.docs-chat-content ol {
  list-style-position: outside;
  padding-left: 1.25em;
}

.docs-chat-content li > p {
  display: inline;
  margin: 0;
}

.docs-chat-content li {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

/* MDX table styles — applies to both GFM pipe tables and raw HTML tables */
.mdx-table th,
.mdx-table td,
article table th,
article table td {
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  text-align: left;
}

.mdx-table th,
article table th {
  font-weight: 600;
  background-color: var(--muted);
}

.mdx-table td,
article table td {
  color: var(--muted-foreground);
}

article table {
  width: 100%;
  font-size: 0.875rem;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

/* Shiki dual theme support */
.shiki,
.shiki span {
  color: var(--shiki-light) !important;
  background-color: var(--shiki-light-bg) !important;
}

.dark .shiki,
.dark .shiki span {
  color: var(--shiki-dark) !important;
  background-color: var(--shiki-dark-bg) !important;
}

