@import 'tailwindcss';

@plugin 'tailwindcss-animate';

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

@theme {
  --color-background: hsl(var(--background));
  --color-foreground: hsl(var(--foreground));

  --color-primary: hsl(var(--primary));
  --color-primary-foreground: hsl(var(--primary-foreground));

  --color-secondary: hsl(var(--secondary));
  --color-secondary-foreground: hsl(var(--secondary-foreground));

  --color-muted: hsl(var(--muted));
  --color-muted-foreground: hsl(var(--muted-foreground));

  --color-accent: hsl(var(--accent));
  --color-accent-foreground: hsl(var(--accent-foreground));

  --color-destructive: hsl(var(--destructive));
  --color-destructive-foreground: hsl(var(--destructive-foreground));

  --color-border: hsl(var(--border));
  --color-input: hsl(var(--input));
  --color-ring: hsl(var(--ring));

  --color-card: hsl(var(--card));
  --color-card-foreground: hsl(var(--card-foreground));

  --color-popover: hsl(var(--popover));
  --color-popover-foreground: hsl(var(--popover-foreground));

  --color-chart-1: hsl(var(--chart-1));
  --color-chart-2: hsl(var(--chart-2));
  --color-chart-3: hsl(var(--chart-3));
  --color-chart-4: hsl(var(--chart-4));
  --color-chart-5: hsl(var(--chart-5));

  --radius-lg: var(--radius);
  --radius-md: calc(var(--radius) - 2px);
  --radius-sm: calc(var(--radius) - 4px);
}

@theme {
  --color-background: hsl(0 0% 100%);
  --color-foreground: hsl(0 0% 3.9%);
  --color-primary: hsl(0 0% 9%);
  --color-primary-foreground: hsl(0 0% 98%);
  --color-secondary: hsl(0 0% 96.1%);
  --color-secondary-foreground: hsl(0 0% 9%);
  --color-muted: hsl(0 0% 96.1%);
  --color-muted-foreground: hsl(0 0% 45.1%);
  --color-accent: hsl(0 0% 96.1%);
  --color-accent-foreground: hsl(0 0% 9%);
  --color-destructive: hsl(0 84.2% 60.2%);
  --color-destructive-foreground: hsl(0 0% 98%);
  --color-border: hsl(0 0% 89.8%);
  --color-input: hsl(0 0% 89.8%);
  --color-ring: hsl(0 0% 3.9%);
  --color-card: hsl(0 0% 100%);
  --color-card-foreground: hsl(0 0% 3.9%);
  --color-popover: hsl(0 0% 100%);
  --color-popover-foreground: hsl(0 0% 3.9%);
  --color-chart-1: hsl(12 76% 61%);
  --color-chart-2: hsl(173 58% 39%);
  --color-chart-3: hsl(197 37% 24%);
  --color-chart-4: hsl(43 74% 66%);
  --color-chart-5: hsl(27 87% 67%);

  --radius: 0.5rem;
}

/*
  The default border color has changed to `currentcolor` in Tailwind CSS v4,
  so we've added these compatibility styles to make sure everything still
  looks the same as it did with Tailwind CSS v3.

  If we ever want to remove these styles, we need to add an explicit border
  color utility to any element that depends on these defaults.
*/
@layer base {
  *,
  ::after,
  ::before,
  ::backdrop,
  ::file-selector-button {
    border-color: var(--color-gray-200, currentcolor);
  }
}

/* Dark mode colors */
@media (prefers-color-scheme: dark) {
  @theme {
    --color-background: hsl(0 0% 3.9%);
    --color-foreground: hsl(0 0% 98%);
    --color-primary: hsl(0 0% 98%);
    --color-primary-foreground: hsl(0 0% 9%);
    --color-secondary: hsl(0 0% 14.9%);
    --color-secondary-foreground: hsl(0 0% 98%);
    --color-muted: hsl(0 0% 14.9%);
    --color-muted-foreground: hsl(0 0% 63.9%);
    --color-accent: hsl(0 0% 14.9%);
    --color-accent-foreground: hsl(0 0% 98%);
    --color-destructive: hsl(0 85% 50%);
    --color-destructive-foreground: hsl(0 0% 98%);
    --color-border: hsl(0 0% 14.9%);
    --color-input: hsl(0 0% 14.9%);
    --color-ring: hsl(0 0% 83.1%);
    --color-card: hsl(0 0% 3.9%);
    --color-card-foreground: hsl(0 0% 98%);
    --color-popover: hsl(0 0% 3.9%);
    --color-popover-foreground: hsl(0 0% 98%);
    --color-chart-1: hsl(220 70% 50%);
    --color-chart-2: hsl(160 60% 45%);
    --color-chart-3: hsl(30 80% 55%);
    --color-chart-4: hsl(280 65% 60%);
    --color-chart-5: hsl(340 75% 55%);
  }
}

.dark {
  @theme {
    --color-background: hsl(0 0% 3.9%);
    --color-foreground: hsl(0 0% 98%);
    --color-primary: hsl(0 0% 98%);
    --color-primary-foreground: hsl(0 0% 9%);
    --color-secondary: hsl(0 0% 14.9%);
    --color-secondary-foreground: hsl(0 0% 98%);
    --color-muted: hsl(0 0% 14.9%);
    --color-muted-foreground: hsl(0 0% 63.9%);
    --color-accent: hsl(0 0% 14.9%);
    --color-accent-foreground: hsl(0 0% 98%);
    --color-destructive: hsl(0 85% 50%);
    --color-destructive-foreground: hsl(0 0% 98%);
    --color-border: hsl(0 0% 14.9%);
    --color-input: hsl(0 0% 14.9%);
    --color-ring: hsl(0 0% 83.1%);
    --color-card: hsl(0 0% 3.9%);
    --color-card-foreground: hsl(0 0% 98%);
    --color-popover: hsl(0 0% 3.9%);
    --color-popover-foreground: hsl(0 0% 98%);
    --color-chart-1: hsl(220 70% 50%);
    --color-chart-2: hsl(160 60% 45%);
    --color-chart-3: hsl(30 80% 55%);
    --color-chart-4: hsl(280 65% 60%);
    --color-chart-5: hsl(340 75% 55%);
  }
}

/* Base styles */
* {
  border-color: var(--color-border);
}

body {
  background-color: var(--color-background);
  color: var(--color-foreground);
}

/* Custom scrollbar */
.scrollbar-thin::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.scrollbar-thin::-webkit-scrollbar-track {
  background-color: transparent;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
  background-color: --theme(--color-muted-foreground / 20%);
  border-radius: 9999px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
  background-color: --theme(--color-muted-foreground / 30%);
}

/* Code block styles */
.code-block {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.code-block pre {
  padding: --spacing(4);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

/* Preserve whitespace in all code blocks */
pre, code {
  white-space: pre;
  tab-size: 4;
}

pre code {
  white-space: inherit;
}

/* Animations */
@keyframes slide-up {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.animate-slide-up {
  animation: slide-up 0.3s ease-out;
}