/* ═══════════════════════════════════════
   WORLD EDITOR — Full-page takeover layout
   Matches RegionEditor dark theme
   ═══════════════════════════════════════ */

/* ── FULL-PAGE OVERLAY ── */
.world-editor-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    background: #12121a;
}

/* ── 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;
    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 {
    z-index: 2001;
    background: transparent;
    cursor: copy;
}

/* ── TOOLTIP ── */
.we-tooltip {
    position: fixed;
    z-index: 2010;
    background: #1e1e2e;
    border: 1px solid #3a3a4e;
    border-radius: 8px;
    padding: 12px 14px;
    min-width: 180px;
    max-width: 260px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
}

.we-tooltip-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.we-tooltip-name {
    font-size: 13px;
    font-weight: 600;
    color: #a8d8a8;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.we-tooltip-size {
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    color: #6a6a8a;
    flex-shrink: 0;
}

.we-tooltip-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.we-tc {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.04);
}

.we-tc.npcs { color: #3498db; }
.we-tc.items { color: #f1c40f; }
.we-tc.mounts { color: #9b59b6; }
.we-tc.portals { color: #1abc9c; }
.we-tc.empty { color: #555570; font-style: italic; }

.we-tooltip-actions {
    display: flex;
    gap: 6px;
}

.we-tooltip-btn {
    flex: 1;
    padding: 5px 10px;
    background: #2a2a3e;
    color: #c8c8d8;
    border: 1px solid #3a3a4e;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-family: inherit;
    transition: background 0.15s, color 0.15s;
    text-align: center;
}

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

.we-tooltip-btn.danger {
    color: #e74c3c;
}

.we-tooltip-btn.danger:hover {
    background: rgba(231, 76, 60, 0.15);
    color: #ff6b5b;
}
