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

@layer base {
  :root {
    --background: 0 0% 100%;
    --foreground: 0 0% 14.5%;
    --card: 0 0% 100%;
    --card-foreground: 0 0% 14.5%;
    --popover: 0 0% 100%;
    --popover-foreground: 0 0% 14.5%;
    --primary: 0 0% 20.5%;
    --primary-foreground: 0 0% 98.5%;
    --secondary: 0 0% 97%;
    --secondary-foreground: 0 0% 20.5%;
    --muted: 0 0% 97%;
    --muted-foreground: 0 0% 55.6%;
    --accent: 0 0% 97%;
    --accent-foreground: 0 0% 20.5%;
    --destructive: 0 80% 57.7%;
    --destructive-foreground: 0 0% 100%;
    --border: 0 0% 92.2%;
    --input: 0 0% 92.2%;
    --ring: 0 0% 70.8%;
    --chart-1: 41 78% 64.6%;
    --chart-2: 185 68% 60%;
    --chart-3: 227 65% 39.8%;
    --chart-4: 84 63% 82.8%;
    --chart-5: 70 68% 76.9%;
    --sidebar: 0 0% 98.5%;
    --sidebar-background: var(--background);
    --sidebar-foreground: 0 0% 14.5%;
    --sidebar-primary: 0 0% 20.5%;
    --sidebar-primary-foreground: 0 0% 98.5%;
    --sidebar-accent: 0 0% 97%;
    --sidebar-accent-foreground: 0 0% 20.5%;
    --sidebar-border: 0 0% 92.2%;
    --sidebar-ring: 0 0% 70.8%;
    --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
      "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
      "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
      "Noto Color Emoji";
    --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
      "Liberation Mono", "Courier New", monospace;
    --radius: 0.625rem;
    --shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
    --shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
    --shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / 0.1),
      0 1px 2px -1px hsl(0 0% 0% / 0.1);
    --shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.1),
      0 1px 2px -1px hsl(0 0% 0% / 0.1);
    --shadow-md: 0 1px 3px 0px hsl(0 0% 0% / 0.1),
      0 2px 4px -1px hsl(0 0% 0% / 0.1);
    --shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.1),
      0 4px 6px -1px hsl(0 0% 0% / 0.1);
    --shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.1),
      0 8px 10px -1px hsl(0 0% 0% / 0.1);
    --shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25);

    .tl-theme__light, .tl-theme__dark {
      --color-low: hsl(var(--accent)) !important;
      --color-background: hsl(var(--border)) !important;
      --color-text-1: hsl(var(--accent-foreground)) !important;
      --color-text-3: hsl(var(--accent-foreground) / 0.3) !important;
    }
  }

  .dark {
    --background: 240 10% 3.9%;
    --foreground: 0 0% 98%;
    --card: 240 10% 3.9%;
    --card-foreground: 0 0% 98%;
    --popover: 240 10% 3.9%;
    --popover-foreground: 0 0% 98%;
    --primary: 0 0% 98%;
    --primary-foreground: 240 5.9% 10%;
    --secondary: 240 3.7% 15.9%;
    --secondary-foreground: 0 0% 98%;
    --muted: 240 3.7% 15.9%;
    --muted-foreground: 240 5% 64.9%;
    --accent: 240 3.7% 15.9%;
    --accent-foreground: 0 0% 98%;
    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 0 85.7% 97.3%;
    --border: 240 3.7% 15.9%;
    --input: 240 3.7% 15.9%;
    --ring: 240 4.9% 83.9%;
    --chart-1: 220 70% 50%;
    --chart-2: 160 60% 45%;
    --chart-3: 30 80% 55%;
    --chart-4: 280 65% 60%;
    --chart-5: 340 75% 55%;
    --sidebar: 240 5.9% 10%;
    --sidebar-background: var(--background);
    --sidebar-foreground: 240 4.8% 95.9%;
    --sidebar-primary: 224.3 76.3% 48%;
    --sidebar-primary-foreground: 0 0% 100%;
    --sidebar-accent: 240 3.7% 15.9%;
    --sidebar-accent-foreground: 240 4.8% 95.9%;
    --sidebar-border: 240 3.7% 15.9%;
    --sidebar-ring: 240 4.9% 83.9%;
    --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
      "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
      "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
      "Noto Color Emoji";
    --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
      "Liberation Mono", "Courier New", monospace;
    --radius: 0.625rem;
    --shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
    --shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
    --shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / 0.1),
      0 1px 2px -1px hsl(0 0% 0% / 0.1);
    --shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.1),
      0 1px 2px -1px hsl(0 0% 0% / 0.1);
    --shadow-md: 0 1px 3px 0px hsl(0 0% 0% / 0.1),
      0 2px 4px -1px hsl(0 0% 0% / 0.1);
    --shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.1),
      0 4px 6px -1px hsl(0 0% 0% / 0.1);
    --shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.1),
      0 8px 10px -1px hsl(0 0% 0% / 0.1);
    --shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25);
  }

  * {
    @apply border-border;
  }

  body {
    @apply bg-background text-foreground;
  }

  .tldraw__editor {    
    .tl-background {
      background-color: var(--background);
    }

    .tl-foreground {
      color: var(--foreground);
    }
  }
}

@layer components {
  /* Typography classes */
  .heading-1 {
    @apply scroll-m-20 text-2xl font-medium tracking-tight;
  }

  .heading-2 {
    @apply mt-10 scroll-m-20 border-b pb-2 text-2xl font-medium tracking-tight transition-colors first:mt-0;
  }

  .heading-3 {
    @apply mt-8 scroll-m-20 text-2xl font-medium tracking-tight;
  }

  .paragraph {
    @apply leading-7 [&:not(:first-child)]:mt-6;
  }

  .link {
    @apply font-medium text-primary underline underline-offset-4;
  }

  .blockquote {
    @apply mt-6 border-l-2 pl-6 italic;
  }

  .list {
    @apply my-6 ml-6 list-disc [&>li]:mt-2;
  }

  /* Table styles */
  .table-container {
    @apply my-6 w-full overflow-y-auto;
  }

  .table {
    @apply w-full;
  }

  .table-head-row {
    @apply m-0 border-t p-0 even:bg-muted;
  }

  .table-head-cell {
    @apply border px-4 py-2 text-left font-bold [&[align=center]]:text-center [&[align=right]]:text-right;
  }

  .table-row {
    @apply m-0 border-t p-0 even:bg-muted;
  }

  .table-cell {
    @apply border px-4 py-2 text-left [&[align=center]]:text-center [&[align=right]]:text-right;
  }
}

/* BlockNote editor styles */
.block-note-editor-container {
  border: 1px solid var(--input-border);
  border-radius: 0.375rem;
  min-height: 150px;
  overflow: hidden;
}

.block-note-editor-container .bn-container {
  width: 100%;
  height: 100%;
  min-height: 150px;
  border: none;
  box-shadow: none;
}

.block-note-editor-container .bn-container .bn-editor {
  padding: 0;
  background-color: transparent;
}
