:root {
  /* GN Theme - Blender Geometry Nodes inspired */
  --bg: #1A1B1E;
  --bg-light: #2B2D31;
  --bg-lighter: #363840;
  --text: #E8EAED;
  --text-muted: rgba(232, 234, 237, 0.65);
  --border: rgba(255, 255, 255, 0.10);
  --accent: #5AAAFF;
  --accent-hover: #7ABBFF;
  --success: #3AAE5B;
  --error: #EF4444;
  --warning: #F59E0B;

  /* Category colors */
  --cat-geometry: #3AAE5B;
  --cat-input: #3D7DFF;
  --cat-attribute: #8B5CF6;
  --cat-math: #F59E0B;
  --cat-utility: #10B981;
  --cat-output: #EF4444;
  --cat-core: #6366F1;
  --cat-flow: #EC4899;

  --sidebar-width: 380px;
  --header-height: 40px;
  --status-height: 24px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 8px 18px rgba(0, 0, 0, 0.35);

  --font-body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Fira Code", "Consolas", monospace;

  --transition: 0.15s ease;
}

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

html,
body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}

#editor-container {
  width: 100%;
  height: 100%;
}

.adf-editor {
  display: flex;
  width: 100%;
  height: 100%;
}

.adf-sidebar {
  width: var(--sidebar-width);
  min-width: 200px;
  max-width: 400px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-light);
  border-right: 1px solid var(--border);
}

.adf-canvas-wrapper {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.adf-canvas-tabs {
  display: flex;
  height: 28px;
  min-height: 28px;
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
  padding: 0 4px;
  gap: 2px;
  align-items: flex-end;
}

.adf-tab {
  padding: 4px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}

.adf-tab:hover {
  color: var(--text);
}

.adf-tab-active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.adf-canvas {
  flex: 1;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.adf-canvas canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Blockly workspace container */
#blockly-workspace {
  width: 100%;
  height: 100%;
}

#canvas-blockly {
  position: relative;
}

.adf-sidebar-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.adf-sidebar-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.adf-search {
  width: calc(100% - 24px);
  margin: 12px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition);
}

.adf-search:focus {
  border-color: var(--accent);
}

.adf-search::placeholder {
  color: var(--text-muted);
}

.adf-node-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 8px;
}

.adf-category {
  margin-bottom: 4px;
}

.adf-category.collapsed .adf-category-items {
  display: none;
}

.adf-category-header {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  user-select: none;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.adf-category-header:hover {
  background: var(--bg-lighter);
}

.adf-category-items {
  padding-left: 8px;
}

.adf-node-item {
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text);
  cursor: grab;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  user-select: none;
}

.adf-node-item:hover {
  background: var(--bg-lighter);
}

.adf-node-item:active {
  cursor: grabbing;
}

.adf-context-menu {
  position: fixed;
  min-width: 180px;
  max-width: 300px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  padding: 4px 0;
}

.adf-context-category {
  padding: 8px 12px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.adf-context-item {
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition);
}

.adf-context-item:hover {
  background: var(--accent);
  color: white;
}

.adf-context-separator {
  height: 1px;
  margin: 4px 0;
  background: var(--border);
}

.lgraphcanvas {
  background: var(--bg) !important;
}

.litecontextmenu {
  background: var(--bg-light) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
}

.litemenu-entry {
  color: var(--text) !important;
}

.litemenu-entry:hover {
  background: var(--accent) !important;
}

.litesearchbox {
  background: var(--bg-light) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
}

.litesearchbox input {
  background: var(--bg) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
}

.lite-search-item {
  color: var(--text) !important;
}

.lite-search-item:hover {
  background: var(--accent) !important;
}

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

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-lighter);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border);
}

/* Status bar */
.adf-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--status-height);
  padding: 0 12px;
  background: var(--bg-light);
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

.adf-status-message {
  flex: 1;
}

.adf-status-info {
  text-align: right;
}

/* Drag preview */
.adf-drag-preview {
  position: fixed;
  padding: 8px 12px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 13px;
  pointer-events: none;
  z-index: 10001;
  box-shadow: var(--shadow-md);
}
