@import "./styles/tokens/index.css" layer(base);

@import "tailwindcss";

@import "tw-animate-css";

@import "shadcn/tailwind.css";

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

@theme inline {
  --breakpoint-3xl: 3000px;

  --radius-lg: var(--border-radius-lg);
  --radius-md: var(--border-radius-lg);
  --radius-sm: var(--border-radius-sm);
  --radius-xl: var(--border-radius-xl);

  --color-lunar-purple: #6147d1;
  --color-lunar-purpleNew: #5147e4;
  --lunar-purple-oklch: oklch(0.5125 0.2147 276.189);

  --color-background: var(--background);
  --color-foreground: var(--foreground);

  --color-select-primary: var(--input-primary);
  --color-select-primary-hover: var(--input-primary-hover);

  --color-component-primary: var(--component-colours-color-fg-interactive);
  --color-component-primary-hover: var(
    --component-colours-color-fg-interactive-hover
  );
  --color-component-secondary: var(--component-colours-color-bg-interactive);

  --color-button-primary: var(--button-primary);
  --color-button-hover: var(--button-hover);
  --color-button-secondary: var(--button-secondary);
  --color-button-secondary-hover: var(--button-secondary-hover);
  --color-button-danger: var(--button-danger);
  --color-button-danger-hover: var(--button-danger-hover);

  --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-badge-success-fg: var(--component-colours-color-fg-success);
  --color-badge-success-bg: var(--component-colours-color-bg-success);
  --color-badge-success-border: var(--component-colours-color-border-success);
  --color-badge-danger-fg: var(--component-colours-color-fg-danger);
  --color-badge-danger-bg: var(--component-colours-color-bg-danger);
  --color-badge-danger-border: var(--component-colours-color-border-danger);
  --color-badge-warning-fg: var(--component-colours-color-fg-warning);
  --color-badge-warning-bg: var(--component-colours-color-bg-warning);
  --color-badge-warning-border: var(--component-colours-color-border-warning);
  --color-badge-info-fg: var(--component-colours-color-fg-info);
  --color-badge-info-bg: var(--component-colours-color-bg-info);
  --color-badge-info-border: var(--component-colours-color-border-info);
  --color-badge-purple-fg: var(--component-colours-color-fg-purple);
  --color-badge-purple-bg: var(--component-colours-color-bg-purple);
  --color-badge-purple-border: var(--component-colours-color-border-purple);

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

  --animate-accordion-down: accordion-down 0.2s ease-out;
  --animate-accordion-up: accordion-up 0.2s ease-out;

  --scale-200: 2;

  @keyframes accordion-down {
    from {
      height: 0;
    }
    to {
      height: var(--radix-accordion-content-height);
    }
  }
  @keyframes accordion-up {
    from {
      height: var(--radix-accordion-content-height);
    }
    to {
      height: 0;
    }
  }
  --font-heading: var(--font-sans);
  --font-sans: "Inter Variable", sans-serif;
  --radius-2xl: calc(var(--radius) * 1.8);
  --radius-3xl: calc(var(--radius) * 2.2);
  --radius-4xl: calc(var(--radius) * 2.6);
}

:root {
  color-scheme: light;

  /* main css variables (values replaced with new palette) */
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary: var(--lunar-purple-oklch);
  --text-primary: var(--text-colours-color-text-primary);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --destructive-foreground: var(--text-colours-color-text-primary-inverted);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: var(--lunar-purple-oklch);
  --radius: 0.625rem;

  /* Chart colors (unchanged) */
  --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);

  /* buttons */
  --button-primary: var(--component-colours-color-fg-interactive);
  --button-hover: var(--component-colours-color-fg-interactive-hover);
  --button-border-secondary: red;
  --button-secondary: var(--component-colours-color-bg-interactive);
  --button-secondary-hover: var(--component-colours-color-bg-interactive-hover);
  --button-danger: var(--component-colours-color-fg-danger);
  --button-danger-hover: var(--component-colours-color-fg-danger-hover);

  /* input */
  --input-primary: var(--component-colours-color-bg-interactive);
  --input-primary-hover: var(--component-colours-color-bg-interactive-hover);
  --input-secondary: var(--component-colours-color-bg-neutral);
  --input-secondary-hover: var(--component-colours-color-bg-neutral-hover);
  --input-danger: var(--component-colours-color-bg-danger);
  --input-danger-hover: var(--component-colours-color-bg-danger-hover);

  /* Sidebar (values replaced with new palette) */
  --sidebar-background: var(--structure-color-bg-app);
  --sidebar-foreground: oklch(0.145 0 0);
  --sidebar-primary: oklch(0.205 0 0);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.97 0 0);
  --sidebar-accent-foreground: oklch(0.205 0 0);
  --sidebar-border: oklch(0.922 0 0);
  --sidebar-ring: oklch(0.708 0 0);

  /* App background and containers (values replaced with new palette) */
  --color-bg-app: var(--structure-color-bg-app);
  --color-bg-container: var(--structure-color-bg-container);
  --color-bg-container-overlay: var(--structure-color-bg-container-overlay);
  --color-bg-modal-overlay: var(--structure-color-modal-overlay);
  --color-bg-hover: var(--structure-color-bg-container);
  --color-bg-interactive: var(--component-colours-color-bg-interactive);
  --color-bg-interactive-hover: var(
    --component-colours-color-bg-interactive-hover
  );
  --color-bg-info: var(--text-colours-color-text-secondary);
  --color-bg-info-hover: var(--text-colours-color-text-secondary);
  --color-bg-success: var(--component-colours-color-bg-success);
  --color-bg-success-hover: var(--component-colours-color-bg-success-hover);
  --color-bg-warning: var(--component-colours-color-bg-warning);
  --color-bg-warning-hover: var(--component-colours-color-bg-warning-hover);
  --color-bg-warning-pending: var(--component-colours-color-bg-warning-pending);
  --color-bg-danger: var(--component-colours-color-bg-danger);
  --color-bg-danger-hover: var(--component-colours-color-bg-danger-hover);
  --color-bg-attention: var(--component-colours-color-bg-attention);
  --color-bg-attention-hover: var(--component-colours-color-bg-attention-hover);
  --color-bg-neutral: var(--component-colours-color-bg-neutral);
  --color-bg-secondary-accent: var(
    --component-colours-color-bg-accent-secondary
  );

  --color-fg-interactive: var(--component-colours-color-fg-interactive);
  --color-fg-interactive-hover: var(
    --component-colours-color-fg-interactive-hover
  );
  --color-fg-primary-accent: var(--component-colours-color-fg-accent-primary);
  --color-fg-secondary-accent: var(
    --component-colours-color-fg-accent-secondary
  );
  --color-fg-info: var(--text-colours-color-text-secondary);
  --color-fg-info-hover: var(--text-colours-color-text-secondary);
  --color-fg-success: var(--component-colours-color-fg-success);
  --color-fg-success-hover: var(--component-colours-color-fg-success-hover);
  --color-fg-warning: var(--component-colours-color-fg-warning);
  --color-fg-warning-hover: var(--component-colours-color-fg-warning-hover);
  --color-fg-danger: var(--component-colours-color-fg-danger);
  --color-fg-danger-hover: var(--component-colours-color-fg-danger-hover);
  --color-fg-attention: var(--component-colours-color-fg-attention);
  --color-fg-attention-hover: var(--component-colours-color-fg-attention-hover);

  --color-border-primary: var(--structure-color-border-primary);
  --color-border-interactive: var(--component-colours-color-border-interactive);
  --color-border-interactive-hover: var(
    --component-colours-color-border-interactive-hover
  );
  --color-border-info: var(--text-colours-color-text-secondary);
  --color-border-info-hover: var(--text-colours-color-text-secondary);
  --color-border-success: var(--component-colours-color-border-success);
  --color-border-success-hover: var(
    --component-colours-color-border-success-hover
  );
  --color-border-warning: var(--component-colours-color-border-warning);
  --color-border-warning-hover: var(
    --component-colours-color-border-warning-hover
  );
  --color-border-warning-pending: var(
    --component-colours-color-border-warning-pending
  );
  --color-border-danger: var(--component-colours-color-border-danger);
  --color-border-danger-hover: var(
    --component-colours-color-border-danger-hover
  );
  --color-border-attention: var(--component-colours-color-border-attention);
  --color-border-attention-hover: var(
    --component-colours-color-border-attention-hover
  );

  --color-text-primary: var(--text-colours-color-text-primary);
  --color-text-primary-inverted: var(
    --text-colours-color-text-primary-inverted
  );
  --color-text-secondary: var(--text-colours-color-text-secondary);
  --color-text-disabled: var(--text-colours-color-text-disabled);

  --color-gray-1: #b1b1b7;

  --color-active-agent: var(--component-colours-color-fg-accent-secondary);
  --color-active-server: var(--component-colours-color-fg-accent-primary);
  --color-mcpx-server: var(--component-colours-color-fg-interactive);
  --color-no-agents: var(--text-colours-color-text-disabled);
  --sidebar: oklch(0.985 0 0);
}

@keyframes pulse-line {
  0% {
    stroke-dashoffset: 20;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

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

  [data-radix-popper-content-wrapper] {
    transform-origin: var(--radix-popper-transform-origin);
    will-change: transform, opacity;
  }

  .react-flow__node-selectorNode {
    font-size: 12px;
    background: #eee;
    border: 1px solid #555;
    border-radius: 5px;
    text-align: center;
  }
  .react-flow__handle-flow__handle.react-flow__handle-flow__handle {
    border: none !important;
  }
  .react-flow__handle.connectionindicator {
    border: none !important;
  }
  html {
    @apply font-sans;
  }
}

.pulsing-line {
  stroke-dasharray: 10 10;
  animation: pulse-line 2.5s linear infinite;
}

.monacoHighlightField {
  color: #5147e4 !important;
  background-color: #ebe6fb;
  padding-block: 4px;
  border-radius: 4px;
}

.monaco-bg-light-blue .monaco-editor-background {
  background-color: #f9f8fb !important;
}

.monaco-bg-light-blue .margin {
  background-color: #f9f8fb !important;
}

.monaco-bg-light-blue .margin-view-overlays .line-numbers {
  opacity: 0.2 !important;
}

.monaco-bg-light-blue .view-lines .view-line {
  color: #6b6293 !important;
}

.monaco-bg-light-blue {
  overflow: hidden !important;
  padding: 16px 0 !important;
  border: none !important;
}

.monaco-bg-light-blue .monaco-editor {
  border: none !important;
  outline: none !important;
}

.monaco-bg-light-blue .monaco-editor .overflow-guard {
  border: none !important;
}

.monaco-editor-container {
  background-color: #f9f8fb !important;
  border-radius: 8px !important;
  border: 1px solid #d8dced !important;
  overflow: hidden !important;
}

.monaco-bg-light-blue .decorationsOverviewRuler {
  display: none !important;
}

.react-flow__handle {
  visibility: hidden !important;
}

.react-flow__pane {
  background-color: #fbfbfe !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Crect width='2' height='2' fill='%23ECECF4'/%3E%3C/svg%3E") !important;
  background-size: 12px 12px !important;
  background-repeat: repeat !important;
  margin: 0 !important;
}

/* Dark mode disabled — app is light-mode only.
   Uncomment when dark mode support is added.
.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.205 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary: var(--lunar-purple-oklch);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.556 0 0);
  --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.205 0 0);
  --sidebar-foreground: oklch(0.985 0 0);
  --sidebar-primary: oklch(0.488 0.243 264.376);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.269 0 0);
  --sidebar-accent-foreground: oklch(0.985 0 0);
  --sidebar-border: oklch(1 0 0 / 10%);
  --sidebar-ring: oklch(0.556 0 0);
}
*/
