/* =========================================
   MAPPER CSS — all styles for mapper.html
   ========================================= */

:root {
  --bg: #0a0c14; --panel: #13152a;
  --border: rgba(255,255,255,0.08);
  --cyan: #00e5ff; --cyan-dim: rgba(0,229,255,0.15);
  --magenta: #ff3399; --green: #00e676;
  --yellow: #ffd600; --red: #ff1744;
  --text: #e0e6f0; --muted: #6a7394;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--bg); color: var(--text); font-family: 'Inter', sans-serif; height: 100vh; width: 100vw; overflow: hidden; display: flex; }

/* === CANVAS === */
#canvas-wrap { flex: 1; position: relative; cursor: crosshair; }
canvas { display: block; width: 100%; height: 100%; position: absolute; top: 0; left: 0; }
#fx-canvas { pointer-events: none; z-index: 0; }
#canvas { z-index: 1; background: transparent; }

/* === TOOLBAR === */
#toolbar {
  position: fixed; top: 0; left: 0; right: 300px; height: 48px;
  background: var(--panel); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 16px; gap: 8px; z-index: 100;
}
.tool-btn {
  background: none; border: 1px solid var(--border); color: var(--muted);
  padding: 6px 14px; border-radius: 6px; font-family: inherit;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; gap: 6px;
}
.tool-btn:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.tool-btn.active { background: var(--cyan-dim); border-color: var(--cyan); color: var(--cyan); }
.tool-btn.danger:hover { border-color: var(--red); color: var(--red); }
.tool-sep { width: 1px; height: 28px; background: var(--border); margin: 0 6px; }
.tool-label { font-size: 12px; color: var(--muted); letter-spacing: 0.5px; margin-right: 4px; }

/* === SIDE PANEL === */
#side-panel { width: 300px; background: var(--panel); border-left: 1px solid var(--border); display: flex; flex-direction: column; z-index: 100; }
.panel-header { padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 13px; letter-spacing: 1px; color: var(--cyan); display: flex; justify-content: space-between; align-items: center; }
.panel-header .count { background: var(--cyan-dim); padding: 2px 8px; border-radius: 10px; font-size: 11px; }
#shape-list { flex: 1; overflow-y: auto; padding: 8px; }
.shape-item { padding: 10px 12px; margin-bottom: 4px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; transition: all 0.12s; display: flex; align-items: center; gap: 10px; }
.shape-item:hover { background: rgba(255,255,255,0.03); border-color: var(--border); }
.shape-item.selected { background: var(--cyan-dim); border-color: var(--cyan); }
.shape-icon { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.shape-icon.polygon { background: rgba(0,229,255,0.15); color: var(--cyan); }
.shape-icon.circle  { background: rgba(255,51,153,0.15); color: var(--magenta); }
.shape-info { flex: 1; min-width: 0; }
.shape-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shape-meta { font-size: 11px; color: var(--muted); }
.shape-delete { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 4px; border-radius: 4px; }
.shape-delete:hover { color: var(--red); background: rgba(255,23,68,0.1); }

/* === PROPERTIES === */
#props-panel { border-top: 1px solid var(--border); padding: 12px 16px; }
.prop-row { display: flex; align-items: center; margin-bottom: 8px; gap: 8px; }
.prop-label { font-size: 12px; color: var(--muted); width: 50px; flex-shrink: 0; }
.prop-input { flex:1; background:rgba(0,0,0,0.3); border:1px solid var(--border); border-radius:6px; padding:6px 10px; color:var(--text); font-family:inherit; font-size:13px; outline:none; }
.prop-input:focus { border-color: var(--cyan); }
.prop-select { flex:1; background:rgba(0,0,0,0.3); border:1px solid var(--border); border-radius:6px; padding:6px 10px; color:var(--text); font-family:inherit; font-size:13px; outline:none; }

/* === BOTTOM BAR === */
#bottom-bar { position:fixed; bottom:0; left:0; right:300px; height:32px; background:var(--panel); border-top:1px solid var(--border); display:flex; align-items:center; padding:0 16px; font-size:11px; color:var(--muted); gap:20px; z-index:100; }
.hint { color: var(--cyan); font-weight: 600; }

/* Fullscreen hides panels */
body.fullscreen #side-panel, body.fullscreen #toolbar, body.fullscreen #bottom-bar { display: none; }
body.fullscreen #canvas-wrap { cursor: none; }

/* Scrollbar */
#shape-list::-webkit-scrollbar { width: 4px; }
#shape-list::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 4px; }

/* === WALL BROWSER MODAL === */
#wall-modal { position:fixed; inset:0; background:rgba(0,0,0,0.8); display:none; align-items:center; justify-content:center; z-index:200; }
#wall-modal.open { display:flex; }
.wm-box { background:var(--panel); border:1px solid rgba(0,229,255,0.2); border-radius:14px; padding:24px; width:450px; max-height:80vh; overflow-y:auto; }
.wm-box h3 { color:var(--cyan); margin-bottom:16px; font-size:15px; }
.wm-item { display:flex; align-items:center; padding:10px 12px; border-radius:8px; border:1px solid var(--border); margin-bottom:6px; cursor:pointer; transition:all 0.12s; }
.wm-item:hover { background:rgba(0,229,255,0.06); border-color:var(--cyan); }
.wm-item .wm-name { flex:1; font-weight:600; font-size:13px; }
.wm-item .wm-date { font-size:11px; color:var(--muted); }
.wm-item .wm-del { background:none; border:none; color:var(--muted); cursor:pointer; font-size:14px; padding:4px 8px; border-radius:4px; margin-left:8px; }
.wm-item .wm-del:hover { color:var(--red); background:rgba(255,23,68,0.1); }
.wm-close { background:var(--border); border:none; color:var(--text); padding:8px 20px; border-radius:6px; cursor:pointer; font-size:12px; margin-top:12px; }
.wm-empty { color:var(--muted); font-size:13px; text-align:center; padding:20px; }
.cloud-status { font-size:11px; color:var(--green); margin-left:8px; opacity:0; transition:opacity 0.3s; }
.cloud-status.show { opacity:1; }

/* FX select */
.fx-select { background:rgba(0,0,0,0.4); border:1px solid var(--border); border-radius:6px; color:var(--text); font-family:inherit; font-size:12px; padding:4px 8px; height:30px; cursor:pointer; outline:none; }
.fx-select:focus { border-color: var(--cyan); }
