/* ===== 3D Editor Full-Screen Mode ===== */
#editor-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: #1a1a2e;
    display: flex;
    flex-direction: column;
}

/* Editor Toolbar */
.editor-toolbar {
    height: 48px;
    background: #16213e;
    border-bottom: 1px solid #0f3460;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 8px;
    z-index: 10;
    flex-shrink: 0;
}

.editor-toolbar .editor-title {
    font-size: 14px;
    font-weight: 600;
    color: #e2e8f0;
    margin-right: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.editor-toolbar .divider {
    width: 1px;
    height: 28px;
    background: #0f3460;
    margin: 0 4px;
}

.editor-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.12s;
    white-space: nowrap;
}

.editor-btn:hover { background: #1e3a5f; color: #e2e8f0; }
.editor-btn.active { background: #1e40af; color: #fff; border-color: #3b82f6; }
.editor-btn.primary { background: #2563eb; color: #fff; }
.editor-btn.primary:hover { background: #1d4ed8; }
.editor-btn.danger { color: #f87171; }
.editor-btn.danger:hover { background: #7f1d1d; color: #fca5a5; }
.editor-btn[disabled] { opacity: 0.3; cursor: not-allowed; }

.editor-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.editor-toolbar-group {
    display: flex;
    align-items: center;
    gap: 2px;
    background: #0f172a;
    border-radius: 6px;
    padding: 2px;
}

.editor-toolbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Editor Body */
.editor-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* 3D Viewport */
#editor-viewport {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#editor-viewport canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Editor Info Overlay */
.editor-info {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 10px 14px;
    color: #e2e8f0;
    font-size: 12px;
    line-height: 1.6;
    pointer-events: none;
    max-width: 280px;
}

.editor-info .info-label {
    color: #64748b;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.editor-info .info-value {
    color: #e2e8f0;
    font-weight: 500;
}

/* Editor Side Panel */
.editor-panel {
    width: 280px;
    background: #16213e;
    border-left: 1px solid #0f3460;
    overflow-y: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.editor-panel-section {
    padding: 12px;
    border-bottom: 1px solid #0f3460;
}

.editor-panel-section h4 {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

/* Panel Form Elements */
.editor-panel .field-row {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    gap: 8px;
}

.editor-panel .field-label {
    font-size: 11px;
    color: #94a3b8;
    min-width: 70px;
}

.editor-panel input[type="number"],
.editor-panel input[type="text"] {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid #334155;
    border-radius: 4px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 12px;
    outline: none;
    min-width: 0;
}

.editor-panel input:focus {
    border-color: #3b82f6;
}

.editor-panel input[type="color"] {
    width: 32px;
    height: 24px;
    padding: 1px;
    border: 1px solid #334155;
    border-radius: 3px;
    background: #0f172a;
    cursor: pointer;
}

.editor-panel input[type="range"] {
    flex: 1;
    accent-color: #3b82f6;
}

.editor-panel .range-value {
    font-size: 11px;
    color: #94a3b8;
    min-width: 30px;
    text-align: right;
}

/* Material Presets */
.material-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.material-preset {
    padding: 6px 4px;
    border: 1px solid #334155;
    border-radius: 4px;
    background: #0f172a;
    color: #94a3b8;
    font-size: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.1s;
}

.material-preset:hover { border-color: #3b82f6; color: #e2e8f0; }
.material-preset.active { border-color: #3b82f6; background: #1e3a5f; color: #e2e8f0; }

/* Object List */
.object-list {
    list-style: none;
    padding: 0;
}

.object-list li {
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.1s;
}

.object-list li:hover { background: #1e3a5f; color: #e2e8f0; }
.object-list li.selected { background: #1e40af; color: #fff; }

.object-list li .obj-icon {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Viewport overlays */
.viewport-mode-indicator {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 64, 175, 0.9);
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    pointer-events: none;
    transition: opacity 0.2s;
}

/* Measurement lines */
.measurement-line {
    position: absolute;
    pointer-events: none;
    z-index: 5;
}

/* Grid helper */
.editor-grid-info {
    position: absolute;
    bottom: 12px;
    right: 12px;
    color: #475569;
    font-size: 11px;
}

/* Responsive */
@media (max-width: 768px) {
    .editor-panel { width: 220px; }
    .editor-toolbar { gap: 4px; padding: 0 8px; }
    .editor-btn span { display: none; }
}

@media (max-width: 480px) {
    .editor-panel { display: none; }
}
