@import "tailwindcss";
@import "tw-animate-css";

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

:root {
  --radius: 0.65rem;
  --background: oklch(1 0 0);
  --foreground: oklch(0.141 0.005 285.823);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.141 0.005 285.823);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.141 0.005 285.823);
  --primary: oklch(0.488 0.243 264.376);
  --primary-foreground: oklch(0.97 0.014 254.604);
  --secondary: oklch(0.967 0.001 286.375);
  --secondary-foreground: oklch(0.21 0.006 285.885);
  --muted: oklch(0.967 0.001 286.375);
  --muted-foreground: oklch(0.552 0.016 285.938);
  --accent: oklch(0.967 0.001 286.375);
  --accent-foreground: oklch(0.21 0.006 285.885);
  --destructive: oklch(0.577 0.245 27.325);
  --destructive-foreground: oklch(0.97 0.014 254.604);
  --border: oklch(0.92 0.004 286.32);
  --input: oklch(0.92 0.004 286.32);
  --ring: oklch(0.708 0 0);
  --chart-1: oklch(0.809 0.105 251.813);
  --chart-2: oklch(0.623 0.214 259.815);
  --chart-3: oklch(0.546 0.245 262.881);
  --chart-4: oklch(0.488 0.243 264.376);
  --chart-5: oklch(0.424 0.199 265.638);
  --sidebar: oklch(0.967 0.001 286.375);
  --sidebar-foreground: oklch(0.141 0.005 285.823);
  --sidebar-primary: oklch(0.488 0.243 264.376);
  --sidebar-primary-foreground: oklch(0.97 0.014 254.604);
  --sidebar-accent: oklch(0.967 0.001 286.375);
  --sidebar-accent-foreground: oklch(0.21 0.006 285.885);
  --sidebar-border: oklch(0.92 0.004 286.32);
  --sidebar-ring: oklch(0.708 0 0);
}

.dark {
  --background: oklch(0.141 0.005 285.823);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.21 0.006 285.885);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.21 0.006 285.885);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.488 0.243 264.376);
  --primary-foreground: oklch(0.97 0.014 254.604);
  --secondary: oklch(0.274 0.006 286.033);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.274 0.006 286.033);
  --muted-foreground: oklch(0.705 0.015 286.067);
  --accent: oklch(0.274 0.006 286.033);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --destructive-foreground: oklch(0.985 0 0);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.556 0 0);
  --chart-1: oklch(0.809 0.105 251.813);
  --chart-2: oklch(0.623 0.214 259.815);
  --chart-3: oklch(0.546 0.245 262.881);
  --chart-4: oklch(0.488 0.243 264.376);
  --chart-5: oklch(0.424 0.199 265.638);
  --sidebar: oklch(0.21 0.006 285.885);
  --sidebar-foreground: oklch(0.985 0 0);
  --sidebar-primary: oklch(0.488 0.243 264.376);
  --sidebar-primary-foreground: oklch(0.97 0.014 254.604);
  --sidebar-accent: oklch(0.274 0.006 286.033);
  --sidebar-accent-foreground: oklch(0.985 0 0);
  --sidebar-border: oklch(1 0 0 / 10%);
  --sidebar-ring: oklch(0.556 0 0);
}

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);
  --color-chart-1: var(--chart-1);
  --color-chart-2: var(--chart-2);
  --color-chart-3: var(--chart-3);
  --color-chart-4: var(--chart-4);
  --color-chart-5: var(--chart-5);
  --color-sidebar: var(--sidebar);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-ring: var(--sidebar-ring);
  --sidebar-width: 220px;
  --sidebar-width-mobile: 280px;
  --sidebar-width-icon: 64px;
}

@layer base {
  * {
    border-color: var(--border);
  }
  body {
    @apply bg-background text-foreground;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* ScrollArea: disable table layout on content wrapper to prevent
   intrinsic-width sizing that breaks constrained panels */
.scroll-area-block-content > [data-radix-scroll-area-viewport] > div {
  display: block !important;
  min-width: 0 !important;
}

/* Indeterminate progress bar animation */
@keyframes progress-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Breadcrumb ribbon — arrow-shaped segments with chevron separators.
   All dimensions derived from --bc-height so triangles stay centered. */
.breadcrumb-ribbon {
  --bc-height: 2.5rem;
  --bc-arrow: calc(var(--bc-height) / 2);
  display: flex;
  align-items: center;
}

.breadcrumb-ribbon > * {
  margin-right: 0.25rem;
}

.breadcrumb-ribbon > *:last-child {
  margin-right: 0;
}

.breadcrumb-segment {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  height: var(--bc-height);
  padding: 0 0.625rem 0 calc(var(--bc-arrow) + 0.5rem);
  position: relative;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 0.875rem;
  cursor: pointer;
  border: none;
  border-radius: 0;
  user-select: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

/* Right-pointing arrow */
.breadcrumb-segment::after {
  content: "";
  position: absolute;
  right: calc(-1 * var(--bc-arrow));
  top: 0;
  z-index: 5;
  border-top: var(--bc-arrow) solid transparent;
  border-bottom: var(--bc-arrow) solid transparent;
  border-left: var(--bc-arrow) solid var(--muted);
  transition: border-left-color 0.15s ease;
}

/* Left V-notch in card background color */
.breadcrumb-segment::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  border-top: var(--bc-arrow) solid transparent;
  border-bottom: var(--bc-arrow) solid transparent;
  border-left: var(--bc-arrow) solid var(--card);
  transition: border-left-color 0.15s ease;
}

/* First segment: pill-shaped left edge, no notch */
.breadcrumb-segment:first-child {
  border-top-left-radius: var(--bc-arrow);
  border-bottom-left-radius: var(--bc-arrow);
  padding-left: 0.75rem;
}

.breadcrumb-segment:first-child::before {
  display: none;
}

/* Last segment: pill-shaped right edge, no arrow, current location styling */
.breadcrumb-segment:last-child {
  border-top-right-radius: var(--bc-arrow);
  border-bottom-right-radius: var(--bc-arrow);
  padding-right: 0.75rem;
  color: var(--foreground);
  font-weight: 500;
}

.breadcrumb-segment:last-child::after {
  display: none;
}

/* Hover on non-current (navigable) segments */
.breadcrumb-segment:not(:last-child):hover {
  background: var(--primary);
  color: var(--primary-foreground);
}

.breadcrumb-segment:not(:last-child):hover::after {
  border-left-color: var(--primary);
}
