/* Editor panel styles */

.editor-panel {
  flex: 1;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(var(--primary-rgb), 0.1);
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.editor-header h2 {
  margin: 0;
  border: none;
  padding: 0;
  color: var(--text-main);
}

.editor-shell {
  flex: 1;
  min-height: 0;
  background: var(--drag-item-bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.editor-container {
  flex: 1;
  min-height: 0;
  height: 100%;
}

.drag-drop-container {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  color: var(--text-main);
  font-style: normal;
  overflow: hidden;
  background: var(--background);
}

.drag-drop-layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
}

.drag-palette,
.drag-workspace {
  min-height: 0;
  padding: 12px;
}

.drag-palette {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-dim);
  padding: 12px;
}

.drag-palette-header {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.drag-panel-title {
  flex: 1 1 auto;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.drag-block-template,
.drag-toolbar button,
.drag-block-actions button,
.drag-empty-action {
  flex: 0 0 auto;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--textbox-bg);
  color: var(--text-main);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.drag-block-template {
  position: relative;
  width: auto;
  padding: 9px 10px 9px 26px;
  text-align: left;
  box-shadow: inset 3px 0 0 var(--primary);
}

.drag-block-template:hover,
.drag-toolbar button:hover,
.drag-block-actions button:hover,
.drag-empty-action:hover {
  background: var(--surface-hover);
  border-color: rgba(var(--primary-rgb), 0.45);
}

.drag-block-template::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.2);
  transform: translateY(-50%);
}

.drag-workspace {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
}

.drag-toolbar button,
.drag-block-actions button,
.drag-empty-action {
  padding: 7px 10px;
  width: auto;
}

#dragClearBtn {
  flex: 0 0 auto;
  width: auto;
  min-width: 74px;
  min-height: 30px;
  padding: 7px 10px;
  border-radius: 3px;
  background: var(--surface-hover);
  border-color: var(--border);
  color: var(--text-main);
}

.drag-sequence {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: 4px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    var(--surface-dim);
  background-size: 18px 18px;
}

.drag-sequence.drag-over {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.45);
}

.drag-empty {
  margin: auto;
  max-width: 230px;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.45;
  font-size: 12px;
}

.drag-empty-action {
  margin-top: 10px;
  background: var(--textbox-bg);
}

.drag-block {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--drag-item-bg);
  padding: 8px;
  display: grid;
  gap: 7px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.drag-block.dragging {
  opacity: 0.45;
}

.drag-block-header {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 22px;
}

.drag-handle {
  color: var(--primary);
  cursor: grab;
  font-weight: 700;
  line-height: 1;
}

.drag-block-title {
  flex: 1;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 700;
}

.drag-block-actions {
  display: flex;
  gap: 5px;
}

.drag-block-actions button {
  color: var(--text-main);
  background: var(--textbox-bg);
  border-color: var(--border);
  padding: 4px 6px;
  font-size: 11px;
}

.drag-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.drag-field {
  display: grid;
  gap: 3px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
}

.drag-field select,
.drag-field input {
  min-width: 0;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--textbox-bg);
  color: var(--text-main);
  padding: 5px 7px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
}

.drag-field select:focus,
.drag-field input:focus {
  outline: none;
  border-color: var(--primary);
}

.drag-loop-children {
  border-left: 2px solid var(--primary);
  margin-left: 7px;
  padding-left: 9px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 34px;
}

@media (max-width: 780px) {
  .drag-palette {
    align-items: stretch;
  }

  .drag-block-template {
    flex: 1 1 calc(50% - 6px);
  }

  .drag-fields {
    grid-template-columns: 1fr;
  }
}
