/* ============================================================
   FrameLab AI — Editor workspace layout
   ============================================================ */

.editor-shell{
  display:grid;
  grid-template-columns:280px 1fr 300px;
  height:100vh;
  padding-top:64px;
  gap:0;
}
.editor-topbar{
  position:fixed; top:0; left:0; right:0; height:64px; z-index:200;
  display:flex; align-items:center; justify-content:space-between;
  padding:0 20px; background:var(--bg-elevated); border-bottom:1px solid var(--border);
}
.editor-topbar .left, .editor-topbar .right{display:flex; align-items:center; gap:10px;}
.editor-topbar .center{
  display:flex; align-items:center; gap:6px; font-size:13px; color:var(--text-2);
}

.panel{
  background:var(--bg-elevated); border-right:1px solid var(--border);
  overflow-y:auto; padding:20px 16px;
}
.panel.right{border-right:none; border-left:1px solid var(--border);}

.panel-tabs{display:flex; gap:4px; background:var(--surface); border-radius:12px; padding:4px; margin-bottom:18px;}
.panel-tab{
  flex:1; text-align:center; padding:9px 6px; border-radius:9px; border:none; background:transparent;
  color:var(--text-2); font-size:12.5px; font-weight:600; transition:all .25s;
}
.panel-tab.active{background:var(--aurora); color:#fff; box-shadow:0 4px 14px rgba(155,92,255,.3);}

.frame-grid{display:grid; grid-template-columns:1fr 1fr; gap:10px;}
.frame-thumb{
  border-radius:14px; border:2px solid transparent; background:var(--surface);
  aspect-ratio:4/5; overflow:hidden; position:relative; transition:border-color .25s, transform .25s;
}
.frame-thumb:hover{transform:translateY(-3px);}
.frame-thumb.active{border-color:var(--aurora-2);}
.frame-thumb img,.frame-thumb .swatch{width:100%; height:100%; object-fit:cover;}
.frame-thumb .label{
  position:absolute; bottom:0; left:0; right:0; padding:6px 8px;
  font-size:10.5px; font-weight:600; color:#fff;
  background:linear-gradient(to top, rgba(0,0,0,.75), transparent);
}

.editor-stage{
  background:
    radial-gradient(circle at 30% 20%, rgba(107,92,255,.10), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(255,92,138,.08), transparent 45%),
    var(--bg);
  display:flex; align-items:center; justify-content:center; position:relative; overflow:auto;
}
.stage-canvas-wrap{
  box-shadow:var(--shadow-lift); border-radius:6px; overflow:hidden; background:#fff;
}

.field-group{margin-bottom:18px;}
.field-label{font-size:12px; font-weight:600; color:var(--text-2); margin-bottom:8px; display:flex; justify-content:space-between;}
.slider{width:100%; accent-color:var(--aurora-2);}
.select, .input{
  width:100%; padding:10px 12px; border-radius:10px; border:1px solid var(--border);
  background:var(--surface); color:var(--text-1); font-size:13.5px; font-family:inherit;
}

.swatch-row{display:flex; gap:8px; flex-wrap:wrap;}
.swatch{width:28px; height:28px; border-radius:50%; border:2px solid var(--glass-border); cursor:pointer;}
.swatch.active{outline:2px solid var(--aurora-2); outline-offset:2px;}

.tool-row{display:flex; gap:8px; flex-wrap:wrap;}
.tool-btn{
  display:flex; flex-direction:column; align-items:center; gap:6px; padding:12px 10px;
  border-radius:12px; background:var(--surface); border:1px solid var(--border);
  color:var(--text-2); font-size:11px; font-weight:600; flex:1; min-width:64px; transition:.2s;
}
.tool-btn:hover{background:var(--surface-2); color:var(--text-1);}
.tool-btn.active{background:var(--aurora-soft); color:var(--text-1); border-color:rgba(155,92,255,.4);}

.layer-row{
  display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:10px;
  background:var(--surface); margin-bottom:6px; border:1px solid transparent; font-size:12.5px;
}
.layer-row.selected{border-color:var(--aurora-2); background:var(--aurora-soft);}
.layer-row .name{flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.layer-row button{background:transparent; border:none; color:var(--text-3); padding:2px;}
.layer-row button:hover{color:var(--text-1);}

.export-grid{display:grid; grid-template-columns:1fr 1fr; gap:8px;}
.export-opt{
  padding:10px; border-radius:12px; background:var(--surface); border:1px solid var(--border);
  font-size:12px; font-weight:600; text-align:center; color:var(--text-2); transition:.2s;
}
.export-opt.active{background:var(--aurora); color:#fff; border-color:transparent;}

.upload-drop{
  border:2px dashed var(--glass-border); border-radius:18px; padding:28px 16px; text-align:center;
  color:var(--text-2); font-size:13px; cursor:pointer; transition:.25s;
}
.upload-drop:hover, .upload-drop.drag{border-color:var(--aurora-2); background:var(--aurora-soft);}
.upload-drop input{display:none;}

.thumb-strip{display:flex; gap:8px; overflow-x:auto; padding:4px 2px;}
.thumb-strip img{width:52px; height:52px; object-fit:cover; border-radius:10px; border:2px solid transparent; cursor:pointer;}
.thumb-strip img.active{border-color:var(--aurora-2);}

.loading-overlay{
  position:fixed; inset:0; background:rgba(8,8,13,.7); backdrop-filter:blur(6px);
  display:flex; align-items:center; justify-content:center; z-index:500; flex-direction:column; gap:14px;
}
.spinner{
  width:44px; height:44px; border-radius:50%; border:3px solid rgba(255,255,255,.15);
  border-top-color:#fff; animation:spin .8s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg);}}

.toast{
  position:fixed; bottom:24px; left:50%; transform:translateX(-50%);
  background:var(--surface); border:1px solid var(--glass-border); padding:12px 20px; border-radius:14px;
  font-size:13.5px; box-shadow:var(--shadow-lift); z-index:600; display:flex; align-items:center; gap:8px;
  opacity:0; transition:opacity .3s, transform .3s; pointer-events:none;
}
.toast.show{opacity:1; transform:translateX(-50%) translateY(-6px);}

@media (max-width:1000px){
  .editor-shell{grid-template-columns:1fr; grid-template-rows:auto 1fr auto;}
  .panel{border:none; border-bottom:1px solid var(--border); max-height:220px;}
  .panel.right{border-bottom:none; border-top:1px solid var(--border);}
}
