@import "tailwindcss";
@import "tw-animate-css";
@import "shadcn/tailwind.css";

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

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --font-sans: var(--font-sans);
  --font-mono: var(--font-mono);
  --color-sidebar-ring: var(--sidebar-ring);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar: var(--sidebar);
  --color-chart-5: var(--chart-5);
  --color-chart-4: var(--chart-4);
  --color-chart-3: var(--chart-3);
  --color-chart-2: var(--chart-2);
  --color-chart-1: var(--chart-1);
  --color-ring: var(--ring);
  --color-input: var(--input);
  --color-border: var(--border);
  --color-destructive: var(--destructive);
  --color-accent-foreground: var(--accent-foreground);
  --color-accent: var(--accent);
  --color-muted-foreground: var(--muted-foreground);
  --color-muted: var(--muted);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-secondary: var(--secondary);
  --color-primary-foreground: var(--primary-foreground);
  --color-primary: var(--primary);
  --color-popover-foreground: var(--popover-foreground);
  --color-popover: var(--popover);
  --color-card-foreground: var(--card-foreground);
  --color-card: var(--card);
  --radius-sm: calc(var(--radius) * 0.6);
  --radius-md: calc(var(--radius) * 0.8);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) * 1.4);
  --radius-2xl: calc(var(--radius) * 1.8);
  --radius-3xl: calc(var(--radius) * 2.2);
  --radius-4xl: calc(var(--radius) * 2.6);
}

:root {
  --background: oklch(0.97 0.003 90);
  --foreground: oklch(0.18 0.005 90);
  --card: oklch(1 0 0 / 65%);
  --card-foreground: oklch(0.18 0.005 90);
  --popover: oklch(0.99 0.002 90 / 92%);
  --popover-foreground: oklch(0.18 0.005 90);
  --primary: oklch(0.20 0.005 90);
  --primary-foreground: oklch(0.99 0 0);
  --secondary: oklch(0.94 0.005 90 / 60%);
  --secondary-foreground: oklch(0.25 0.005 90);
  --muted: oklch(0.94 0.003 90 / 50%);
  --muted-foreground: oklch(0.50 0.008 90);
  --accent: oklch(0.92 0.01 80 / 40%);
  --accent-foreground: oklch(0.25 0.01 90);
  --destructive: oklch(0.58 0.22 27);
  --border: oklch(0.82 0.005 90 / 30%);
  --input: oklch(0.93 0.003 90 / 50%);
  --ring: oklch(0.35 0.005 90);
  --chart-1: oklch(0.55 0.12 160);
  --chart-2: oklch(0.60 0.10 80);
  --chart-3: oklch(0.50 0.08 45);
  --chart-4: oklch(0.65 0.06 200);
  --chart-5: oklch(0.45 0.10 140);
  --radius: 0.75rem;
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 64px;
  --sidebar: oklch(1 0 0 / 50%);
  --sidebar-foreground: oklch(0.20 0.005 90);
  --sidebar-primary: oklch(0.20 0.005 90);
  --sidebar-primary-foreground: oklch(0.99 0 0);
  --sidebar-accent: oklch(0.92 0.005 90 / 40%);
  --sidebar-accent-foreground: oklch(0.25 0.005 90);
  --sidebar-border: oklch(0.82 0.005 90 / 25%);
  --sidebar-ring: oklch(0.35 0.005 90);
}

.dark {
  --background: oklch(0.14 0.005 90);
  --foreground: oklch(0.93 0.005 90);
  --card: oklch(1 0 0 / 6%);
  --card-foreground: oklch(0.93 0.005 90);
  --popover: oklch(0.20 0.005 90 / 85%);
  --popover-foreground: oklch(0.93 0.005 90);
  --primary: oklch(0.88 0.005 90);
  --primary-foreground: oklch(0.14 0.005 90);
  --secondary: oklch(1 0 0 / 8%);
  --secondary-foreground: oklch(0.90 0.005 90);
  --muted: oklch(1 0 0 / 6%);
  --muted-foreground: oklch(0.65 0.005 90);
  --accent: oklch(0.50 0.01 80 / 20%);
  --accent-foreground: oklch(0.90 0.005 90);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 10%);
  --ring: oklch(0.70 0.005 90);
  --chart-1: oklch(0.60 0.10 160);
  --chart-2: oklch(0.65 0.08 80);
  --chart-3: oklch(0.55 0.06 45);
  --chart-4: oklch(0.70 0.05 200);
  --chart-5: oklch(0.50 0.08 140);
  --sidebar: oklch(1 0 0 / 5%);
  --sidebar-foreground: oklch(0.90 0.005 90);
  --sidebar-primary: oklch(0.88 0.005 90);
  --sidebar-primary-foreground: oklch(0.14 0.005 90);
  --sidebar-accent: oklch(1 0 0 / 8%);
  --sidebar-accent-foreground: oklch(0.90 0.005 90);
  --sidebar-border: oklch(1 0 0 / 8%);
  --sidebar-ring: oklch(0.70 0.005 90);
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }
  body {
    @apply bg-background text-foreground;
  }
  html {
    @apply font-sans;
  }
}

@layer utilities {
  .glass {
    backdrop-filter: blur(20px) saturate(1.6);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
  }

  .glass-card {
    backdrop-filter: blur(24px) saturate(1.6);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
    background: oklch(1 0 0 / 55%);
    border: 1px solid oklch(1 0 0 / 30%);
    box-shadow:
      0 1px 2px oklch(0 0 0 / 4%),
      0 4px 16px oklch(0 0 0 / 6%),
      inset 0 1px 0 oklch(1 0 0 / 50%);
  }

  .dark .glass-card {
    background: oklch(1 0 0 / 5%);
    border-color: oklch(1 0 0 / 10%);
    box-shadow:
      0 1px 2px oklch(0 0 0 / 20%),
      0 4px 16px oklch(0 0 0 / 30%),
      inset 0 1px 0 oklch(1 0 0 / 5%);
  }

  .glass-panel {
    backdrop-filter: blur(24px) saturate(1.6);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
    background: oklch(1 0 0 / 60%);
    border-bottom: 1px solid oklch(1 0 0 / 30%);
    box-shadow: 0 1px 8px oklch(0 0 0 / 4%);
  }

  .dark .glass-panel {
    background: oklch(1 0 0 / 4%);
    border-bottom-color: oklch(1 0 0 / 8%);
    box-shadow: 0 1px 8px oklch(0 0 0 / 20%);
  }

  .glass-input {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: oklch(1 0 0 / 50%);
    border: 1px solid oklch(0 0 0 / 8%);
  }

  .dark .glass-input {
    background: oklch(1 0 0 / 6%);
    border-color: oklch(1 0 0 / 10%);
  }

  .gradient-mesh {
    background:
      radial-gradient(ellipse 80% 50% at 15% 15%, oklch(0.85 0.04 80 / 18%) 0%, transparent 60%),
      radial-gradient(ellipse 60% 40% at 85% 75%, oklch(0.80 0.04 140 / 12%) 0%, transparent 50%),
      radial-gradient(ellipse 50% 60% at 50% 50%, oklch(0.90 0.02 60 / 10%) 0%, transparent 60%);
  }

  .dark .gradient-mesh {
    background:
      radial-gradient(ellipse 80% 50% at 15% 15%, oklch(0.30 0.03 80 / 20%) 0%, transparent 60%),
      radial-gradient(ellipse 60% 40% at 85% 75%, oklch(0.25 0.04 140 / 15%) 0%, transparent 50%),
      radial-gradient(ellipse 50% 60% at 50% 50%, oklch(0.22 0.02 60 / 10%) 0%, transparent 60%);
  }

  .gradient-banner {
    background: linear-gradient(135deg, oklch(0.20 0.005 90) 0%, oklch(0.28 0.01 80) 50%, oklch(0.22 0.008 100) 100%);
  }

  .gradient-stat {
    background: linear-gradient(135deg, oklch(1 0 0 / 70%) 0%, oklch(0.97 0.003 90 / 50%) 100%);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border: 1px solid oklch(1 0 0 / 40%);
    box-shadow:
      0 1px 3px oklch(0 0 0 / 5%),
      0 8px 24px oklch(0 0 0 / 6%),
      inset 0 1px 0 oklch(1 0 0 / 60%);
  }

  .dark .gradient-stat {
    background: linear-gradient(135deg, oklch(1 0 0 / 8%) 0%, oklch(1 0 0 / 4%) 100%);
    border-color: oklch(1 0 0 / 10%);
    box-shadow:
      0 1px 3px oklch(0 0 0 / 20%),
      0 8px 24px oklch(0 0 0 / 25%),
      inset 0 1px 0 oklch(1 0 0 / 5%);
  }
}
