#left-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  width: 300px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.sidebar-section {
  margin-bottom: 32px;
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.add-page-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition);
}

.add-page-btn:hover {
  background: var(--primary);
  color: white;
  transform: rotate(90deg);
}

.page-search-input, .block-search-input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-hover);
  margin-bottom: 16px;
}

.page-tree-item {
  padding: 10px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
}

.page-tree-item:hover, .page-tree-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

.page-tree-item .page-name {
  flex: 1;
  min-width: 0;
}

.page-tree-item .page-name-edit {
  flex: 1;
  min-width: 0;
  padding: 2px 6px;
  border: 1px solid var(--primary);
  border-radius: 4px;
  background: var(--surface);
}

.page-tree-delete {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}

.page-tree-delete:hover {
  color: #dc3545;
  opacity: 1;
  background: rgba(220, 53, 69, 0.1);
}

.toggle-subpages {
  cursor: pointer;
  transition: var(--transition);
}

.page-tree-item.expanded .toggle-subpages {
  transform: rotate(90deg);
}

.add-subpage {
  color: var(--primary);
  font-style: italic;
  margin-left: 32px;
  font-size: 0.9rem;
}

.blocks-filters {
  margin-bottom: 16px;
}

.block-category {
  margin-bottom: 16px;
}

.category-header {
  padding: 12px;
  background: var(--surface-hover);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  transition: var(--transition);
}

.category-header:hover {
  background: rgba(91,33,182,0.1);
}

.category-content {
  display: none;
  padding-left: 16px;
  margin-top: 8px;
}

.block-category.expanded .category-content {
  display: block;
}

.block-item {
  padding: 12px 16px;
  margin: 6px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: grab;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.block-item:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-sm);
}

.favorite-icon {
  margin-left: auto;
  color: #f59e0b;
  cursor: pointer;
  opacity: 0.5;
  transition: var(--transition);
}

.favorite-icon.favorited {
  opacity: 1;
  color: #fbbf24;
}

.add-section-btn {
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  font-weight: 600;
}

/* Hover preview */
.block-preview-tooltip {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px;
  z-index: 1000;
  pointer-events: none;
}

.block-preview-tooltip img {
  max-width: 200px;
  border-radius: 8px;
}

/* Context menu */
.context-menu {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 180px;
  z-index: 1000;
  display: none;
  padding: 8px 0;
}

.context-menu .menu-item {
  padding: 10px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
}

.context-menu .menu-item:hover {
  background: var(--surface-hover);
}



