@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import "tailwindcss";
@import "tw-animate-css";
@plugin "@tailwindcss/typography";

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

@theme inline {
  --color-background: hsl(var(--background));
  --color-foreground: hsl(var(--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-card-border: hsl(var(--card-border));

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

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

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

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

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

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

  --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));

  --color-sidebar: hsl(var(--sidebar));
  --color-sidebar-foreground: hsl(var(--sidebar-foreground));
  --color-sidebar-border: hsl(var(--sidebar-border));
  --color-sidebar-primary: hsl(var(--sidebar-primary));
  --color-sidebar-primary-foreground: hsl(var(--sidebar-primary-foreground));
  --color-sidebar-primary-border: var(--sidebar-primary-border);
  --color-sidebar-accent: hsl(var(--sidebar-accent));
  --color-sidebar-accent-foreground: hsl(var(--sidebar-accent-foreground));
  --color-sidebar-accent-border: var(--sidebar-accent-border);
  --color-sidebar-ring: hsl(var(--sidebar-ring));

  --font-sans: var(--app-font-sans);
  --font-serif: var(--app-font-serif);
  --font-mono: var(--app-font-mono);

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

/* LIGHT MODE */
:root {
  --button-outline: rgba(0,0,0, .10);
  --badge-outline: rgba(0,0,0, .05);
  --opaque-button-border-intensity: -8;
  --elevate-1: rgba(0,0,0, .03);
  --elevate-2: rgba(0,0,0, .08);

  --background: 220 20% 97%;
  --foreground: 222 47% 11%;
  --border: 220 13% 88%;
  --input: 220 13% 85%;
  --ring: 224 76% 48%;

  --card: 0 0% 100%;
  --card-foreground: 222 47% 11%;
  --card-border: 220 13% 90%;

  --popover: 0 0% 100%;
  --popover-foreground: 222 47% 11%;
  --popover-border: 220 13% 88%;

  --primary: 224 76% 48%;
  --primary-foreground: 0 0% 100%;

  --secondary: 220 14% 93%;
  --secondary-foreground: 222 47% 20%;

  --muted: 220 14% 95%;
  --muted-foreground: 220 9% 46%;

  --accent: 224 100% 95%;
  --accent-foreground: 224 76% 35%;

  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 100%;

  --chart-1: 224 76% 48%;
  --chart-2: 160 60% 45%;
  --chart-3: 43 96% 56%;
  --chart-4: 340 75% 55%;
  --chart-5: 270 67% 58%;

  --sidebar: 222 47% 11%;
  --sidebar-foreground: 210 40% 90%;
  --sidebar-border: 222 30% 18%;
  --sidebar-primary: 224 76% 60%;
  --sidebar-primary-foreground: 0 0% 100%;
  --sidebar-accent: 222 30% 18%;
  --sidebar-accent-foreground: 210 40% 96%;
  --sidebar-ring: 224 76% 60%;

  --app-font-sans: 'Inter', sans-serif;
  --app-font-serif: Georgia, serif;
  --app-font-mono: Menlo, monospace;
  --radius: .5rem;

  --shadow-2xs: 0px 1px 2px 0px rgba(0,0,0,0.04);
  --shadow-xs: 0px 1px 3px 0px rgba(0,0,0,0.06);
  --shadow-sm: 0px 1px 3px 0px rgba(0,0,0,0.08), 0px 1px 2px -1px rgba(0,0,0,0.04);
  --shadow: 0px 2px 6px 0px rgba(0,0,0,0.08), 0px 1px 2px -1px rgba(0,0,0,0.04);
  --shadow-md: 0px 4px 12px 0px rgba(0,0,0,0.10), 0px 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0px 8px 24px 0px rgba(0,0,0,0.12), 0px 4px 6px -1px rgba(0,0,0,0.05);
  --shadow-xl: 0px 16px 40px 0px rgba(0,0,0,0.14), 0px 8px 10px -1px rgba(0,0,0,0.06);
  --shadow-2xl: 0px 24px 64px 0px rgba(0,0,0,0.16);
  --tracking-normal: 0em;
  --spacing: 0.25rem;

  --sidebar-primary-border: hsl(var(--sidebar-primary));
  --sidebar-primary-border: hsl(from hsl(var(--sidebar-primary)) h s calc(l + var(--opaque-button-border-intensity)) / alpha);
  --sidebar-accent-border: hsl(var(--sidebar-accent));
  --sidebar-accent-border: hsl(from hsl(var(--sidebar-accent)) h s calc(l + var(--opaque-button-border-intensity)) / alpha);
  --primary-border: hsl(var(--primary));
  --primary-border: hsl(from hsl(var(--primary)) h s calc(l + var(--opaque-button-border-intensity)) / alpha);
  --secondary-border: hsl(var(--secondary));
  --secondary-border: hsl(from hsl(var(--secondary)) h s calc(l + var(--opaque-button-border-intensity)) / alpha);
  --muted-border: hsl(var(--muted));
  --muted-border: hsl(from hsl(var(--muted)) h s calc(l + var(--opaque-button-border-intensity)) / alpha);
  --accent-border: hsl(var(--accent));
  --accent-border: hsl(from hsl(var(--accent)) h s calc(l + var(--opaque-button-border-intensity)) / alpha);
  --destructive-border: hsl(var(--destructive));
  --destructive-border: hsl(from hsl(var(--destructive)) h s calc(l + var(--opaque-button-border-intensity)) / alpha);
}

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

@layer utilities {
  input[type="search"]::-webkit-search-cancel-button { @apply hidden; }
  [contenteditable][data-placeholder]:empty::before {
    content: attr(data-placeholder);
    color: hsl(var(--muted-foreground));
    pointer-events: none;
  }
  .no-default-hover-elevate {}
  .no-default-active-elevate {}
  .toggle-elevate::before, .toggle-elevate-2::before {
    content: ""; pointer-events: none; position: absolute; inset: 0px; border-radius: inherit; z-index: -1;
  }
  .toggle-elevate.toggle-elevated::before { background-color: var(--elevate-2); }
  .border.toggle-elevate::before { inset: -1px; }
  .hover-elevate:not(.no-default-hover-elevate),
  .active-elevate:not(.no-default-active-elevate) { position: relative; z-index: 0; }
  .hover-elevate:not(.no-default-hover-elevate)::after,
  .active-elevate:not(.no-default-active-elevate)::after {
    content: ""; pointer-events: none; position: absolute; inset: 0px; border-radius: inherit; z-index: 999;
  }
  .hover-elevate:hover:not(.no-default-hover-elevate)::after { background-color: var(--elevate-1); }
  .active-elevate:active:not(.no-default-active-elevate)::after { background-color: var(--elevate-2); }
  .border.hover-elevate:not(.no-default-hover-elevate)::after,
  .border.active-elevate:not(.no-default-active-elevate)::after { inset: -1px; }

  /* Custom scrollbar */
  ::-webkit-scrollbar { width: 6px; height: 6px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: hsl(var(--border)); border-radius: 3px; }
  ::-webkit-scrollbar-thumb:hover { background: hsl(var(--muted-foreground)); }
}
