:root {
  /* Base Variables (Default Dark) */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;

  /* Dark Theme (Default) */
  --foreground: #cccccc;
  --background: #1e1e1e;
  --border-color: #333333;
  --hover-background: #2a2d2e;
  --selection-background: #094771;
  --selection-foreground: #ffffff;
  --focus-outline: #007fd4;
  --description-foreground: #888888;
  --code-background: #1e1e1e;
  --edge-color: #ffffff;
  --node-label-color: #ffffff;
  --edge-highlight-color: #ffffff;

  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
}

/* Light Theme Variables */
body.light {
  --foreground: #111111;
  --background: #ffffff;
  --border-color: #e0e0e0;
  --hover-background: #f0f0f0;
  --selection-background: #007fd4;
  --selection-foreground: #ffffff;
  --focus-outline: #007fd4;
  --description-foreground: #666666;
  --code-background: #f5f5f5;
  --edge-color: #000000;
  --node-label-color: #222222;
  --edge-highlight-color: #000000;
}

/* Ensure body uses valid variables */
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  color: var(--foreground);
  background-color: var(--background);
  height: 100vh;
  overflow: hidden;
  box-sizing: border-box;
  transition: background-color 0.3s, color 0.3s;
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

button {
  background: none;
  border: 1px solid transparent;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
}

button:focus {
  outline: 1px solid var(--focus-outline);
  outline-offset: 1px;
}