/* MedFlow Editor - Main Styles */
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background:#f5f5f5; overflow:hidden; height:100vh; width:100vw; }
#app { display:flex; flex-direction:column; height:100vh; width:100vw; }

/* Menu Bar */
#menu-bar { display:flex; align-items:center; justify-content:space-between; background:#1a1a2e; color:#fff; padding:4px 12px; height:40px; flex-shrink:0; user-select:none; }
.menu-group { display:flex; gap:2px; }
.menu-item { position:relative; padding:6px 12px; cursor:pointer; border-radius:4px; font-size:13px; }
.menu-item:hover { background:rgba(255,255,255,0.1); }
.menu-item:hover .dropdown { display:flex; }
.dropdown { display:none; position:absolute; top:100%; left:0; min-width:200px; background:#fff; border-radius:6px; box-shadow:0 8px 24px rgba(0,0,0,0.2); flex-direction:column; padding:6px; z-index:1000; color:#333; }
.dropdown-item { padding:8px 12px; border-radius:4px; font-size:13px; cursor:pointer; display:flex; align-items:center; gap:6px; white-space:nowrap; }
.dropdown-item:hover { background:#f0f0f5; }
.dropdown-item input[type="checkbox"] { margin-right:4px; cursor:pointer; }
.separator { height:1px; background:#e0e0e0; margin:4px 0; }
.menu-title { font-weight:700; font-size:14px; letter-spacing:0.5px; }
.menu-right { display:flex; align-items:center; gap:8px; }
.zoom-display { display:flex; align-items:center; gap:4px; background:rgba(255,255,255,0.1); border-radius:4px; padding:2px 6px; }
.zoom-display button { background:none; border:none; color:#fff; cursor:pointer; font-size:14px; padding:0 4px; }
.zoom-display span { font-size:12px; min-width:40px; text-align:center; }

/* Main Area */
#main-area { display:flex; flex:1; overflow:hidden; }

/* Left Toolbar */
#left-toolbar { width:56px; background:#16213e; display:flex; flex-direction:column; align-items:center; padding:4px 0; gap:2px; flex-shrink:0; overflow-y:auto; }
.tool-section { display:flex; flex-direction:column; gap:2px; width:100%; padding:0 4px; margin-bottom:6px; border-bottom:1px solid rgba(255,255,255,0.05); padding-bottom:6px; }
.tool-section:last-child { border-bottom:none; }
.tool-title { font-size:9px; color:rgba(255,255,255,0.5); text-align:center; margin-bottom:4px; text-transform:uppercase; letter-spacing:0.5px; }
.tool-btn { width:44px; height:44px; border:none; background:transparent; color:rgba(255,255,255,0.7); border-radius:6px; cursor:pointer; display:flex; align-items:center; justify-content:center; padding:6px; transition:all 0.15s; }
.tool-btn svg { width:20px; height:20px; fill:currentColor; pointer-events:none; }
.tool-btn:hover { background:rgba(255,255,255,0.1); color:#fff; }
.tool-btn.active { background:#0f3460; color:#e94560; }

/* Work Area */
#work-area { flex:1; background:#e8e8e8; position:relative; overflow:auto; display:flex; align-items:center; justify-content:center; }
#canvas-wrapper { position:relative; box-shadow:0 4px 20px rgba(0,0,0,0.15); background:#fff; }
#editor-svg { display:block; }

/* Right Panel */
#right-panel { width:260px; background:#fff; border-left:1px solid #e0e0e0; display:flex; flex-direction:column; flex-shrink:0; }
.panel-tabs { display:flex; background:#f5f5f5; border-bottom:1px solid #e0e0e0; }
.panel-tab { flex:1; padding:10px 0; text-align:center; font-size:12px; cursor:pointer; color:#666; border-bottom:2px solid transparent; transition:all 0.15s; }
.panel-tab:hover { background:#eee; }
.panel-tab.active { color:#0f3460; border-bottom-color:#e94560; background:#fff; font-weight:600; }
.panel-content { flex:1; overflow-y:auto; padding:10px; }
.panel-content.hidden { display:none; }
.prop-group { margin-bottom:16px; padding-bottom:12px; border-bottom:1px solid #f0f0f0; }
.prop-header { font-size:11px; text-transform:uppercase; letter-spacing:0.5px; color:#888; margin-bottom:8px; font-weight:600; }
.prop-row { display:flex; align-items:center; gap:6px; margin-bottom:6px; }
.prop-row label { width:60px; font-size:12px; color:#555; flex-shrink:0; }
.prop-row input[type="number"], .prop-row input[type="text"], .prop-row select { flex:1; padding:4px 8px; border:1px solid #ddd; border-radius:4px; font-size:12px; outline:none; }
.prop-row input[type="number"]:focus, .prop-row input[type="text"]:focus, .prop-row select:focus { border-color:#0f3460; }
.prop-row input[type="color"] { width:32px; height:24px; border:none; padding:0; cursor:pointer; }
.prop-row input[type="range"] { flex:1; }
.prop-row span { font-size:11px; color:#888; min-width:28px; }

/* Layers */
#layer-list { list-style:none; }
#layer-list li { padding:8px 10px; border-radius:4px; font-size:12px; cursor:pointer; display:flex; align-items:center; gap:6px; }
#layer-list li:hover { background:#f5f5f5; }
#layer-list li.active { background:#e8f0fe; color:#0f3460; font-weight:600; }
.layer-actions { display:flex; gap:6px; margin-bottom:10px; }
.layer-actions button { flex:1; padding:6px; border:1px solid #ddd; background:#fff; border-radius:4px; font-size:12px; cursor:pointer; }
.layer-actions button:hover { background:#f5f5f5; }

/* Templates */
.template-list { display:flex; flex-direction:column; gap:6px; }
.template-item { border:1px solid #e0e0e0; border-radius:8px; padding:12px; cursor:pointer; transition:all 0.15s; text-align:center; }
.template-item:hover { border-color:#0f3460; background:#f8f9ff; }
.template-preview { font-size:12px; font-weight:600; color:#444; }

/* Status Bar */
#status-bar { height:28px; background:#f5f5f5; border-top:1px solid #e0e0e0; display:flex; align-items:center; padding:0 12px; gap:16px; font-size:11px; color:#666; flex-shrink:0; user-select:none; }

/* Selection on SVG */
.editor-selected { outline:none; }
.select-box { fill:none; stroke:#e94560; stroke-width:1; stroke-dasharray:4,2; }
.select-handle { fill:#fff; stroke:#e94560; stroke-width:1; cursor:grab; }
.select-handle:hover { stroke-width:2; }
.select-rotate { fill:#e94560; cursor:grab; }

/* Cursors */
.cursor-crosshair { cursor:crosshair; }
.cursor-move { cursor:move; }

/* Responsive */
@media (max-width:900px) { #right-panel { display:none; } }
@media (max-width:600px) { #left-toolbar { width:44px; } .tool-btn { width:36px; height:36px; padding:4px; } .tool-btn svg { width:16px; height:16px; } }
