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

@layer base {
  :root {
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;

    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;

    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;

    --primary: 221.2 83.2% 53.3%;
    --primary-foreground: 210 40% 98%;

    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222.2 47.4% 11.2%;

    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;

    --accent: 221.2 83.2% 53.3%;
    --accent-foreground: 222.2 47.4% 11.2%;

    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 40% 98%;

    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 221.2 83.2% 53.3%;

    --radius: 0.5rem;
  }

  .dark {
    --background: 222.2 84% 4.9%;
    --foreground: 210 40% 98%;

    --card: 222.2 84% 4.9%;
    --card-foreground: 210 40% 98%;

    --popover: 222.2 84% 4.9%;
    --popover-foreground: 210 40% 98%;

    --primary: 217.2 91.2% 59.8%;
    --primary-foreground: 222.2 47.4% 11.2%;

    --secondary: 217.2 32.6% 17.5%;
    --secondary-foreground: 210 40% 98%;

    --muted: 217.2 32.6% 17.5%;
    --muted-foreground: 215 20.2% 65.1%;

    --accent: 217.2 91.2% 59.8%;
    --accent-foreground: 210 40% 98%;

    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 210 40% 98%;

    --border: 217.2 32.6% 17.5%;
    --input: 217.2 32.6% 17.5%;
    --ring: 224.3 76.3% 48%;
  }
}

@layer base {
  * {
    @apply border-border;
  }
  body {
    @apply bg-background text-foreground;
  }
}

/* Markdown content styling */
.markdown-content {
  @apply text-foreground;
}

.markdown-content h1 {
  @apply text-2xl font-bold mt-6 mb-4;
}

.markdown-content h2 {
  @apply text-xl font-bold mt-5 mb-3;
}

.markdown-content h3 {
  @apply text-lg font-bold mt-4 mb-2;
}

.markdown-content p {
  @apply mb-4;
}

.markdown-content ul {
  @apply list-disc pl-5 mb-4;
}

.markdown-content ol {
  @apply list-decimal pl-5 mb-4;
}

.markdown-content li {
  @apply mb-1;
}

.markdown-content blockquote {
  @apply border-l-4 border-muted pl-4 italic my-4;
}

/* Table styling */
.markdown-content table {
  @apply w-full border-collapse mb-4 whitespace-normal;
}

.markdown-content thead {
  @apply bg-muted whitespace-normal;
}

.markdown-content tbody {
  @apply bg-transparent whitespace-normal;
}

.markdown-content tr {
  @apply border-b border-border whitespace-normal;
}

.markdown-content th {
  @apply border border-border p-2 text-left font-semibold whitespace-normal;
}

.markdown-content td {
  @apply border border-border p-2 align-top whitespace-normal;
}

.markdown-content hr {
  @apply my-4 border-t border-border;
}

.markdown-content img {
  @apply max-w-full h-auto rounded-md my-4;
}

.markdown-content a {
  @apply text-primary hover:underline;
}

/* Code block styling improvements */
.markdown-content pre {
  @apply bg-slate-800 dark:bg-slate-900 p-3 rounded-md overflow-x-auto my-4;
}

.markdown-content code {
  @apply font-mono text-sm;
}

/* Inline code styling */
.markdown-content :not(pre) > code {
  @apply bg-slate-200 dark:bg-slate-800 px-1 py-0.5 rounded text-sm text-slate-900 dark:text-slate-200;
}

/* Python code block specific styling */
.markdown-content code.language-python {
  @apply text-slate-100 dark:text-slate-100;
}

/* General code block styling with better contrast */
.markdown-content pre code {
  @apply text-slate-100 dark:text-slate-100 block p-2;
}

/* Add some basic syntax highlighting without highlight.js */
.markdown-content .keyword,
.markdown-content .function,
.markdown-content .class {
  @apply text-blue-400 dark:text-blue-300;
}

.markdown-content .string {
  @apply text-green-400 dark:text-green-300;
}

.markdown-content .number {
  @apply text-amber-400 dark:text-amber-300;
}

.markdown-content .comment {
  @apply text-slate-400 dark:text-slate-500 italic;
}
