:root {
  /* Default (Light) Theme Variables */
  --bg-primary: #ffffff;
  --bg-secondary: #f3f4f6;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --accent-color: #2563eb;
  --border-color: #e5e7eb;
  --sidebar-width: 300px;
  --header-height: 60px;
  --font-mono: "Hack", "Fira Code", "Courier New", monospace;
  
  /* Graph colors - Light Mode */
  --node-fill: #3b82f6;
  --node-stroke: #ffffff;
  --link-stroke: #9ca3af;
  --graph-text: #1f2937;
}

[data-theme="dark"] {
  /* Dark (Terminal) Theme Variables - Matching b08x aesthetics */
  --bg-primary: #1a1a1a;
  --bg-secondary: #161b22;
  --text-primary: #c9d1d9;
  --text-secondary: #8b949e;
  --accent-color: #58a6ff;
  --border-color: #30363d;
  
  /* Graph colors - Dark Mode */
  --node-fill: #f1c40f;
  --node-stroke: #000;
  --link-stroke: #30363d;
  --graph-text: #f1c40f;
}

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

body {
  font-family: var(--font-mono);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
  line-height: 1.6;
  overflow: hidden; /* Prevent body scroll if graph takes full screen */
}

/* --- Header --- */
header {
  height: var(--header-height);
  background-color: transparent;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
}

.logo {
  font-weight: bold;
  font-size: 1.2rem;
  color: var(--accent-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Theme Toggle Button */
.theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background-color: var(--bg-primary);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* --- Layout --- */
.main-container {
  display: flex;
  height: 100vh;
  padding-top: var(--header-height);
}

aside {
  width: var(--sidebar-width);
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  color: var(--text-secondary);
  overflow-y: auto;
}

#graph-container {
  flex: 1;
  position: relative;
  background-color: var(--bg-primary);
  overflow: hidden;
}

/* --- Universal Graph Styling --- 
   Targets standard SVG elements directly so your graph logic doesn't need changes */

#graph-container svg {
  width: 100%;
  height: 100%;
  display: block;
}

#graph-container line, 
#graph-container path.link {
  stroke: var(--link-stroke);
  stroke-width: 1.5px;
  transition: stroke 0.3s ease;
}

#graph-container circle, 
#graph-container rect.node {
  fill: var(--node-fill);
  stroke: var(--node-stroke);
  stroke-width: 1.5px;
  transition: fill 0.3s ease, stroke 0.3s ease;
}

#graph-container text {
  fill: var(--graph-text);
  font-family: var(--font-mono);
  font-size: 1.25rem;
  pointer-events: none;
}
