/* Gray-Hub Block Builder — drag-drop card composer styles. */

.blk-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  min-height: 100px;
}
.dark .blk-list {
  background: #0f1115;
  border-color: #262a33;
}

.blk-empty {
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: #94a3b8;
  font-style: italic;
}

.blk-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 120ms, box-shadow 120ms, transform 80ms;
}
.dark .blk-card {
  background: #181b21;
  border-color: #262a33;
}
.blk-card:hover {
  border-color: #6366f1;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.1);
}
.blk-card.blk-dragging { opacity: 0.4; }
.blk-card.blk-drop-above {
  border-top: 2px solid #4f46e5 !important;
}
.blk-card.blk-drop-below {
  border-bottom: 2px solid #4f46e5 !important;
}

.blk-handle {
  cursor: grab;
  color: #94a3b8;
  font-size: 18px;
  user-select: none;
  letter-spacing: -2px;
  font-weight: 700;
  flex-shrink: 0;
}
.blk-handle:active { cursor: grabbing; }

.blk-icon {
  width: 28px; height: 28px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #4f46e5;
  background: #eef2ff;
  border-radius: 6px;
}
.dark .blk-icon { background: rgba(79, 70, 229, 0.2); color: #a5b4fc; }

.blk-meta { flex: 1 1 auto; min-width: 0; }
.blk-type {
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
}
.dark .blk-type { color: #e2e8f0; }
.blk-summary {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blk-edit, .blk-delete {
  width: 26px; height: 26px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  border-radius: 5px;
  color: #94a3b8;
  cursor: pointer;
  transition: background 120ms, color 120ms;
}
.blk-edit:hover { background: #f1f5f9; color: #0f172a; }
.blk-delete:hover { background: #fee2e2; color: #b91c1c; }
.dark .blk-edit:hover { background: #262a33; color: #e2e8f0; }
.dark .blk-delete:hover { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }

.blk-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  background: transparent;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 120ms, background 120ms, color 120ms;
}
.blk-add-btn:hover {
  border-color: #4f46e5;
  background: #eef2ff;
  color: #4f46e5;
}
.dark .blk-add-btn { border-color: #363b45; }
.dark .blk-add-btn:hover {
  background: rgba(79, 70, 229, 0.15);
  color: #a5b4fc;
}

/* Popups (type picker + editor) */
.blk-popup {
  position: absolute;
  z-index: 100;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.15);
  width: 360px;
  max-height: 80vh;
  overflow-y: auto;
}
.dark .blk-popup {
  background: #181b21;
  border-color: #262a33;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

/* Type picker */
.blk-type-picker { padding: 10px; }
.blk-tp-group { margin-bottom: 10px; }
.blk-tp-group-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.blk-tp-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}
.blk-tp-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
  text-align: left;
  transition: background 120ms, border-color 120ms;
}
.dark .blk-tp-opt { color: #cbd5e1; }
.blk-tp-opt:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
}
.dark .blk-tp-opt:hover { background: #262a33; border-color: #363b45; }
.blk-tp-opt-icon {
  width: 24px; height: 24px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #4f46e5;
  background: #eef2ff;
  border-radius: 4px;
}
.dark .blk-tp-opt-icon { background: rgba(79, 70, 229, 0.2); color: #a5b4fc; }

/* Editor */
.blk-editor { padding: 0; }
.blk-editor-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}
.dark .blk-editor-head {
  border-color: #262a33;
  color: #e2e8f0;
}
.blk-editor-icon {
  width: 22px; height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef2ff;
  color: #4f46e5;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}
.dark .blk-editor-icon { background: rgba(79, 70, 229, 0.2); color: #a5b4fc; }
.blk-editor-close {
  margin-left: auto;
  width: 24px; height: 24px;
  background: transparent;
  border: 0;
  color: #94a3b8;
  border-radius: 4px;
  cursor: pointer;
}
.blk-editor-close:hover { background: #f1f5f9; color: #0f172a; }
.dark .blk-editor-close:hover { background: #262a33; color: #e2e8f0; }

.blk-editor-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; }

.blk-field { display: flex; flex-direction: column; gap: 4px; }
.blk-field > label {
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.dark .blk-field > label { color: #94a3b8; }

.blk-input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  background: #ffffff;
  color: #0f172a;
  box-sizing: border-box;
}
.dark .blk-input {
  background: #13151a;
  border-color: #363b45;
  color: #e2e8f0;
}
.blk-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
textarea.blk-input {
  height: auto;
  min-height: 56px;
  padding: 8px 10px;
  resize: vertical;
}

/* i18n field — flag prefix */
.blk-i18n { display: flex; flex-direction: column; gap: 4px; }
.blk-i18n-row { display: flex; align-items: stretch; gap: 6px; }
.blk-i18n-flag {
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  flex-shrink: 0;
}
.dark .blk-i18n-flag { background: #262a33; color: #94a3b8; }

/* Item rows for lists */
.blk-item-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}
.blk-faq-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.blk-item-del {
  width: 24px; height: 24px;
  background: transparent;
  border: 0;
  color: #94a3b8;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}
.blk-item-del:hover { background: #fee2e2; color: #b91c1c; }
.blk-item-mono {
  flex: 1 1 auto;
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 11px;
  color: #475569;
  background: #f1f5f9;
  padding: 4px 8px;
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.blk-empty-mini {
  font-size: 11px;
  color: #94a3b8;
  font-style: italic;
  padding: 4px 0;
}
.blk-add-item-btn {
  font-size: 11px;
  color: #4f46e5;
  background: transparent;
  border: 1px dashed #cbd5e1;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 4px;
}
.blk-add-item-btn:hover {
  background: #eef2ff;
  border-color: #4f46e5;
}
.dark .blk-add-item-btn { border-color: #363b45; }
.flex-1 { flex: 1 1 auto; min-width: 0; }
