/* app/assets/stylesheets/icecat_categories.css */

/* ---------- Scrollable container ---------- */
.tree-scroll {
  max-height: 70vh;
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 8px;
  background: #fff;
}

/* ---------- Tree + Nodes ---------- */
.category-tree { list-style: none; padding-left: 0; margin: 0; }
.category-tree > .cat-node { margin: 6px 0; }

.node-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto; /* twisty | name/meta | spacer | actions */
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fafafa;
}
.node-row:hover { background: #f5f5f5; }

.children { margin-left: 24px; padding-left: 12px; border-left: 2px dashed #e5e7eb; }
.children .category-tree { margin-top: 6px; }
.children.collapsed { display: none; }

/* ---------- Twisty / Expand-Collapse ---------- */
.twisty {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #e5e7eb; border-radius: 6px; background: #fff;
  cursor: pointer;
}
.twisty-empty { opacity: 0.5; cursor: default; }
.twisty .twisty-icon { font-size: 12px; line-height: 1; }

/* ---------- Text + Actions ---------- */
.node-name { font-weight: 600; }
.node-meta { font-size: 12px; color: #6b7280; }
.spacer { width: 12px; }

.node-actions a { font-size: 12px; margin-left: 10px; text-decoration: underline; }
.node-actions .make-draggable {
  margin-left: 10px; background: transparent; border: 0;
  cursor: grab; user-select: none; -webkit-user-select: none;
}

/* ---------- Drag feedback ---------- */
.dragging { opacity: 0.6; }
.drag-over { outline: 2px dashed #6366f1; outline-offset: 2px; background: #eef2ff; }

/* ---------- Root drop target ---------- */
.drop-target-root {
  border: 2px dashed #d1d5db; border-radius: 10px;
  padding: 10px 12px; text-align: center; color: #6b7280;
}
.drop-target-root.drag-over { border-color: #6366f1; background: #eef2ff; color: #374151; }
