:root {
  /* Colors - Zinc Scale */
  --color-zinc-50: #fafafa;
  --color-zinc-100: #f4f4f5;
  --color-zinc-200: #e4e4e7;
  --color-zinc-300: #d4d4d8;
  --color-zinc-400: #a1a1aa;
  --color-zinc-500: #71717a;
  --color-zinc-600: #52525b;
  --color-zinc-700: #3f3f46;
  --color-zinc-800: #27272a;
  --color-zinc-900: #18181b;
  --color-zinc-950: #09090b;

  /* Palette - Vibrant Pastel */
  --color-red: #ef4444; --color-red-bg: #fef2f2;
  --color-orange: #f97316; --color-orange-bg: #fff7ed;
  --color-amber: #f59e0b; --color-amber-bg: #fffbeb;
  --color-green: #10b981; --color-green-bg: #ecfdf5;
  --color-teal: #14b8a6; --color-teal-bg: #f0fdfa;
  --color-cyan: #06b6d4; --color-cyan-bg: #ecfeff;
  --color-blue: #3b82f6; --color-blue-bg: #eff6ff;
  --color-indigo: #6366f1; --color-indigo-bg: #eef2ff;
  --color-violet: #8b5cf6; --color-violet-bg: #f5f3ff;
  --color-purple: #a855f7; --color-purple-bg: #faf5ff;
  --color-pink: #ec4899; --color-pink-bg: #fdf2f8;
  --color-rose: #f43f5e; --color-rose-bg: #fff1f2;

  /* Semantic Colors */
  --color-bg: #f9fafb; /* Slightly warmer than pure zinc-50 */
  --color-surface: #ffffff;
  --color-surface-hover: var(--color-zinc-50);
  --color-border: var(--color-zinc-300); /* Darker border for better contrast */
  
  --color-text: var(--color-zinc-950); /* Darker main text */
  --color-text-secondary: var(--color-zinc-700); /* Darker secondary text */
  --color-text-muted: var(--color-zinc-500); /* Darker muted text */

  /* Primary - Indigo/Slate blend for professional look */
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-bg: #eff6ff;
  --color-primary-text: #1e40af;

  /* Relation colors - refined */
  --color-implies: var(--color-green);
  --color-contradicts: var(--color-red);
  --color-specializes: var(--color-blue);
  --color-generalizes: var(--color-violet);
  --color-causes: var(--color-orange);
  --color-correlates: var(--color-zinc-600); /* Darker gray for better visibility */
  --color-part-of: var(--color-amber);
  --color-context-of: var(--color-cyan);

  /* Status/Confidence colors */
  --color-success: var(--color-green);
  --color-success-bg: var(--color-green-bg);
  --color-warning: var(--color-amber);
  --color-warning-bg: var(--color-amber-bg);
  --color-error: var(--color-red);
  --color-error-bg: var(--color-red-bg);
  --color-info: var(--color-blue);
  --color-info-bg: var(--color-blue-bg);

  --color-confidence-high: var(--color-success);
  --color-confidence-medium: var(--color-warning);
  --color-confidence-low: var(--color-error);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  
  --font-size-xs: 0.75rem;     /* 12px */
  --font-size-sm: 0.875rem;    /* 14px */
  --font-size-base: 1rem;      /* 16px */
  --font-size-lg: 1.125rem;    /* 18px */
  --font-size-xl: 1.25rem;     /* 20px */
  --font-size-2xl: 1.5rem;     /* 24px */
  --font-size-3xl: 1.875rem;   /* 30px */

  /* Shadows - soft & diffused */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);

  /* Border radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Sidebar */
  --sidebar-width: 240px;
  --sidebar-width-collapsed: 64px;
}

[data-theme="dark"] {
  /* Semantic Colors - Dark Mode */
  --color-bg: var(--color-zinc-950);
  --color-surface: var(--color-zinc-900);
  --color-surface-hover: var(--color-zinc-800);
  --color-border: var(--color-zinc-800);
  
  --color-text: var(--color-zinc-50);
  --color-text-secondary: var(--color-zinc-400);
  --color-text-muted: var(--color-zinc-500);

  /* Primary */
  --color-primary: #3b82f6;
  --color-primary-hover: #60a5fa;
  --color-primary-bg: rgba(59, 130, 246, 0.1);
  --color-primary-text: #60a5fa;

  /* Shadows - simpler in dark mode */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
  --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.2);

  /* Palette Adjustments for Dark Mode */
  --color-red-bg: rgba(239, 68, 68, 0.1);
  --color-orange-bg: rgba(249, 115, 22, 0.1);
  --color-amber-bg: rgba(245, 158, 11, 0.1);
  --color-green-bg: rgba(16, 185, 129, 0.1);
  --color-teal-bg: rgba(20, 184, 166, 0.1);
  --color-cyan-bg: rgba(6, 182, 212, 0.1);
  --color-blue-bg: rgba(59, 130, 246, 0.1);
  --color-indigo-bg: rgba(99, 102, 241, 0.1);
  --color-violet-bg: rgba(139, 92, 246, 0.1);
  --color-purple-bg: rgba(168, 85, 247, 0.1);
  --color-pink-bg: rgba(236, 72, 153, 0.1);
  --color-rose-bg: rgba(244, 63, 94, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  height: 100%;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: var(--color-text);
  background: var(--color-surface); /* Added for dark mode inputs */
  border: 1px solid var(--color-border); /* Added for visibility */
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: -1px;
  border-color: var(--color-primary);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-zinc-300);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-zinc-400);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: var(--color-zinc-700);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: var(--color-zinc-600);
}

/* Utility classes */
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.font-mono { font-family: var(--font-mono); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }

.bg-surface { background: var(--color-surface); }
.border { border: 1px solid var(--color-border); }
.rounded { border-radius: var(--radius-md); }

/* Glassmorphism utility */
.glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

[data-theme="dark"] .glass {
  background: rgba(24, 24, 27, 0.8);
}

/* Search icon - shared across components */
.search-icon {
  position: absolute;
  left: var(--space-sm);
  margin-right: var(--space-xs);
  top: 55%;
  transform: translateY(-55%);
  color: var(--color-text-muted);
  pointer-events: none;
}
