/* ═══════════════════════════════════════
   WORLD EDITOR — Embedded in content area
   Sits below the main topbar inside worldsSection
   ═══════════════════════════════════════ */

/* ── EDITOR WRAPPER — fills worldsSection ── */
.world-editor-overlay {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: #12121a;
  overflow: hidden;
}

/* ── TOOLBAR ── */
.we-toolbar {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 12px;
  background: #1e1e2e;
  border-bottom: 1px solid #2a2a3e;
  flex-shrink: 0;
  gap: 8px;
}

.we-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.we-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.we-toolbar-btn {
  padding: 5px 12px;
  background: #2a2a3e;
  color: #c8c8d8;
  border: 1px solid #3a3a4e;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition:
    background 0.15s,
    color 0.15s;
  white-space: nowrap;
}

.we-toolbar-btn:hover {
  background: #3a3a50;
  color: #fff;
}

.we-toolbar-title {
  font-size: 14px;
  font-weight: 600;
  color: #e0e0f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.we-toolbar-separator {
  width: 1px;
  height: 20px;
  background: #3a3a4e;
  flex-shrink: 0;
}

.we-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.we-type-badge.type-overworld {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.3);
}

.we-type-badge.type-instance {
  background: rgba(155, 89, 182, 0.15);
  color: #bb6bd9;
  border: 1px solid rgba(155, 89, 182, 0.3);
}

.we-grid-info {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: #8888aa;
}

/* ── BODY — 2-column layout ── */
.we-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── LEFT SIDEBAR — Map palette ── */
.we-sidebar {
  width: 240px;
  min-width: 240px;
  background: #181824;
  border-right: 1px solid #2a2a3e;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.we-sidebar-header {
  padding: 12px;
  border-bottom: 1px solid #2a2a3e;
  flex-shrink: 0;
}

.we-sidebar-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #8888aa;
  margin-bottom: 8px;
}

.we-search-input {
  width: 100%;
  padding: 6px 10px;
  background: #1e1e2e;
  border: 1px solid #2a2a3e;
  border-radius: 4px;
  color: #c8c8d8;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.we-search-input::placeholder {
  color: #555570;
}

.we-search-input:focus {
  border-color: #4a4a6e;
}

/* ── MAP LIST ── */
.we-map-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.we-map-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #1e1e2e;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: grab;
  transition: all 0.15s;
  user-select: none;
}

.we-map-item:hover {
  background: #262638;
  border-color: #3a3a4e;
}

.we-map-item.dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.we-map-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.we-map-name {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: #c8c8d8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.we-map-size {
  font-size: 10px;
  color: #6a6a8a;
  background: #2a2a3e;
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
}

.we-map-list-empty {
  padding: 20px 10px;
  text-align: center;
  color: #555570;
  font-size: 12px;
}

/* ── CANVAS CONTAINER ── */
.we-canvas-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #12121a;
}

.we-canvas-wrap canvas {
  display: block;
}

.we-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6a6a8a;
  font-size: 14px;
  z-index: 5;
  background: #12121a;
}

/* ── DROP OVERLAY — invisible layer for drag-and-drop over canvas ── */
.we-drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: transparent;
  cursor: copy;
}
