@import "tailwindcss";
@import "tw-animate-css";
@import "shadcn/tailwind.css";
@import "@fontsource-variable/geist";
@import "@fontsource/fraunces/latin-400.css";
@import "@fontsource/fraunces/latin-500.css";
@import "@fontsource/encode-sans-expanded/400.css";
@import "@fontsource/encode-sans-expanded/500.css";
@import "@fontsource/encode-sans-expanded/600.css";
@import "@fontsource/ibm-plex-mono/latin-400.css";
@import "@fontsource/ibm-plex-mono/latin-500.css";

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

@theme {
  --font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --color-success: var(--color-emerald-500);
  --color-warning: var(--color-amber-500);
  --color-error: var(--color-red-500);
}

html,
body,
#root {
  height: 100%;
  min-height: 100%;
}

@theme inline {
  --font-heading: 'Encode Sans Expanded', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-sans: 'Geist Variable', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --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);
  --color-foreground: var(--foreground);
  --color-background: var(--background);
  --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.99 0.005 245);
  --foreground: oklch(0.20 0.02 245);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.20 0.02 245);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.20 0.02 245);
  --primary: #0B4F6C;
  --primary-foreground: oklch(1 0 0);
  --secondary: oklch(0.96 0.01 245);
  --secondary-foreground: oklch(0.20 0.02 245);
  --muted: oklch(0.96 0.01 245);
  --muted-foreground: oklch(0.59 0.02 245);
  --accent: oklch(0.94 0.015 245);
  --accent-foreground: oklch(0.20 0.02 245);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.91 0.01 245);
  --input: oklch(0.91 0.01 245);
  --ring: #0B4F6C;
  --chart-1: oklch(0.87 0 0);
  --chart-2: oklch(0.556 0 0);
  --chart-3: oklch(0.439 0 0);
  --chart-4: oklch(0.371 0 0);
  --chart-5: oklch(0.269 0 0);
  --radius: 1rem;
  --sidebar: oklch(1 0 0);
  --sidebar-foreground: oklch(0.20 0.02 245);
  --sidebar-primary: #0B4F6C;
  --sidebar-primary-foreground: oklch(1 0 0);
  --sidebar-accent: oklch(0.96 0.01 245);
  --sidebar-accent-foreground: oklch(0.20 0.02 245);
  --sidebar-border: oklch(0.91 0.01 245);
  --sidebar-ring: #0B4F6C;
}

.dark {
  --background: oklch(0.15 0.015 245);
  --foreground: oklch(0.95 0 0);
  --card: oklch(0.20 0.015 245);
  --card-foreground: oklch(0.95 0 0);
  --popover: oklch(0.20 0.015 245);
  --popover-foreground: oklch(0.95 0 0);
  --primary: #1b8bbd;
  --primary-foreground: oklch(1 0 0);
  --secondary: oklch(0.22 0.015 245);
  --secondary-foreground: oklch(0.95 0 0);
  --muted: oklch(0.22 0.015 245);
  --muted-foreground: oklch(0.65 0.01 245);
  --accent: oklch(0.25 0.015 245);
  --accent-foreground: oklch(0.95 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(0.28 0.015 245);
  --input: oklch(0.28 0.015 245);
  --ring: #1b8bbd;
  --chart-1: oklch(0.87 0 0);
  --chart-2: oklch(0.556 0 0);
  --chart-3: oklch(0.439 0 0);
  --chart-4: oklch(0.371 0 0);
  --chart-5: oklch(0.269 0 0);
  --sidebar: oklch(0.17 0.015 245);
  --sidebar-foreground: oklch(0.95 0 0);
  --sidebar-primary: #1b8bbd;
  --sidebar-primary-foreground: oklch(1 0 0);
  --sidebar-accent: oklch(0.22 0.015 245);
  --sidebar-accent-foreground: oklch(0.95 0 0);
  --sidebar-border: oklch(0.28 0.015 245);
  --sidebar-ring: #1b8bbd;
}

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

@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scale-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes page-enter {
  from { opacity: 0; transform: translateY(6px); filter: blur(1px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes stepper-shimmer {
  0%   { transform: translateX(-100%); opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateX(100%); opacity: 0; }
}

@keyframes value-flash {
  0%   { background: rgba(var(--primary-rgb, 99, 102, 241), 0); }
  20%  { background: rgba(var(--primary-rgb, 99, 102, 241), 0.18); }
  100% { background: rgba(var(--primary-rgb, 99, 102, 241), 0); }
}

@layer utilities {
  .animate-fade-in {
    animation: fade-in 180ms ease-out both;
  }
  .animate-slide-in-left {
    animation: slide-in-left 180ms ease-out both;
  }
  .animate-scale-in {
    animation: scale-in 150ms ease-out both;
  }
  .animate-page-enter {
    animation: page-enter 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
    will-change: transform, opacity, filter;
  }
  .animate-rise-in {
    animation: rise-in 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
    will-change: transform, opacity;
  }
  .animate-stepper-shimmer {
    animation: stepper-shimmer 2.4s ease-in-out infinite;
    will-change: transform, opacity;
  }
  .animate-value-flash {
    animation: value-flash 800ms ease-out;
  }
  .no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  .no-scrollbar::-webkit-scrollbar {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .animate-fade-in,
  .animate-slide-in-left,
  .animate-scale-in,
  .animate-page-enter,
  .animate-rise-in,
  .animate-stepper-shimmer,
  .animate-value-flash {
    animation: none !important;
  }
}
