/* Digital Twin Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: #0a0a0f; color: #e0e0e0; overflow: hidden; }
#container { width: 100vw; height: 100vh; position: relative; }
#canvas-container { width: 100%; height: 100%; }

#header { position: absolute; top: 0; left: 0; right: 0; padding: 15px 20px; background: linear-gradient(180deg, rgba(10,10,15,0.95) 0%, rgba(10,10,15,0) 100%); z-index: 100; display: flex; justify-content: space-between; align-items: center; }
#header h1 { font-size: 1.4em; font-weight: 600; color: #4fc3f7; }
#header .subtitle { font-size: 0.85em; color: #888; margin-top: 2px; }

#controls { display: flex; gap: 10px; }
.btn { padding: 8px 16px; border: 1px solid #4fc3f7; background: rgba(79, 195, 247, 0.1); color: #4fc3f7; border-radius: 4px; cursor: pointer; font-size: 0.85em; transition: all 0.2s; }
.btn:hover { background: rgba(79, 195, 247, 0.2); }
.btn.active { background: #4fc3f7; color: #0a0a0f; }

#side-panel { position: absolute; top: 80px; right: 20px; width: 320px; max-height: calc(100vh - 100px); background: rgba(20, 20, 30, 0.95); border: 1px solid #333; border-radius: 8px; overflow: hidden; z-index: 100; }
.panel-header { padding: 12px 15px; background: rgba(79, 195, 247, 0.1); border-bottom: 1px solid #333; font-weight: 600; color: #4fc3f7; }
.panel-content { padding: 15px; max-height: 400px; overflow-y: auto; }

.metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 15px; }
.metric-card { background: rgba(255,255,255,0.05); padding: 12px; border-radius: 6px; text-align: center; }
.metric-value { font-size: 1.8em; font-weight: 700; color: #4fc3f7; }
.metric-label { font-size: 0.75em; color: #888; margin-top: 4px; }

.unit-list { list-style: none; }
.unit-item { padding: 10px 12px; margin-bottom: 8px; background: rgba(255,255,255,0.03); border-radius: 6px; border-left: 3px solid #4fc3f7; cursor: pointer; transition: all 0.2s; }
.unit-item:hover { background: rgba(255,255,255,0.08); }
.unit-item.selected { background: rgba(79, 195, 247, 0.15); border-left-color: #81d4fa; }
.unit-name { font-weight: 600; margin-bottom: 4px; }
.unit-stats { display: flex; gap: 15px; font-size: 0.8em; color: #888; }
.unit-stats span { display: flex; align-items: center; gap: 4px; }

.state-idle { color: #17a2b8; }
.state-execute { color: #28a745; }
.state-stopped { color: #6c757d; }
.state-held { color: #e83e8c; }

#info-bar { position: absolute; bottom: 0; left: 0; right: 0; padding: 10px 20px; background: linear-gradient(0deg, rgba(10,10,15,0.95) 0%, rgba(10,10,15,0) 100%); display: flex; justify-content: space-between; align-items: center; z-index: 100; }
#simulation-time { font-family: monospace; font-size: 0.9em; color: #4fc3f7; }
#help-text { font-size: 0.8em; color: #666; }

#detail-panel { position: absolute; top: 80px; left: 20px; width: 350px; background: rgba(20, 20, 30, 0.95); border: 1px solid #333; border-radius: 8px; z-index: 100; display: none; }
#detail-panel.visible { display: block; }
.close-btn { position: absolute; top: 10px; right: 10px; background: none; border: none; color: #888; cursor: pointer; font-size: 1.2em; }
.close-btn:hover { color: #fff; }

.line-item { padding: 10px; margin-bottom: 8px; background: rgba(255,255,255,0.03); border-radius: 4px; }
.line-name { font-weight: 600; font-size: 0.9em; margin-bottom: 8px; color: #81d4fa; }
.stations-row { display: flex; gap: 4px; flex-wrap: wrap; }
.station-box { width: 40px; height: 40px; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 0.7em; font-weight: 600; color: #fff; cursor: pointer; transition: transform 0.2s; }
.station-box:hover { transform: scale(1.1); }
.station-idle { background: #17a2b8; }
.station-execute { background: #28a745; }
.station-stopped { background: #6c757d; }

#legend { position: absolute; bottom: 60px; left: 20px; background: rgba(20, 20, 30, 0.9); padding: 10px 15px; border-radius: 6px; border: 1px solid #333; z-index: 100; }
.legend-title { font-size: 0.75em; color: #888; margin-bottom: 8px; }
.legend-items { display: flex; gap: 15px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.8em; }
.legend-color { width: 12px; height: 12px; border-radius: 2px; }
