/**
 * Level Editor Styles
 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #2c2c2c;
  color: #e0e0e0;
  overflow: hidden;
}

.editor-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

header {
  background: #1e1e1e;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #3c3c3c;
}

h1 {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.header-actions button {
  padding: 6px 12px;
  font-size: 13px;
  background: #3c3c3c;
  color: #e0e0e0;
  border: 1px solid #555;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.header-actions button:hover {
  background: #4c4c4c;
  border-color: #666;
}

.editor-main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Toolbar */
.toolbar {
  width: 250px;
  background: #252525;
  border-right: 2px solid #3c3c3c;
  overflow-y: auto;
  padding: 16px;
}

.toolbar h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: #888;
  margin: 16px 0 8px 0;
  letter-spacing: 0.5px;
}

.toolbar h3:first-child {
  margin-top: 0;
}

.tool-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}

.tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 6px;
  background: #2c2c2c;
  border: 2px solid #3c3c3c;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.tool-btn:hover {
  background: #353535;
  border-color: #555;
}

.tool-btn.active {
  background: #1E88E5;
  border-color: #1976D2;
  color: #fff;
}

.tool-btn .icon {
  font-size: 20px;
  margin-bottom: 4px;
}

.tool-btn .label {
  font-size: 11px;
  font-weight: 500;
}

.tool-btn .hotkey {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 9px;
  color: #888;
  font-weight: 600;
}

.tool-btn.active .hotkey {
  color: rgba(255, 255, 255, 0.7);
}

.component-palette {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.component-btn {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  background: #2c2c2c;
  border: 2px solid #3c3c3c;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.component-btn:hover {
  background: #353535;
  border-color: #555;
}

.component-btn.active {
  background: #1E88E5;
  border-color: #1976D2;
}

.component-btn .icon {
  font-size: 18px;
  margin-right: 8px;
  width: 24px;
  text-align: center;
}

.component-btn .name {
  font-size: 12px;
  font-weight: 500;
}

.component-btn .hotkey {
  margin-left: auto;
  font-size: 10px;
  color: #888;
  font-weight: 600;
}

.properties-panel {
  background: #2c2c2c;
  border: 1px solid #3c3c3c;
  border-radius: 4px;
  padding: 12px;
  min-height: 100px;
}

.help-text {
  font-size: 12px;
  color: #888;
  font-style: italic;
}

.property-item {
  margin-bottom: 12px;
}

.property-item label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #aaa;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.property-item input,
.property-item select {
  width: 100%;
  padding: 6px 8px;
  background: #1e1e1e;
  border: 1px solid #3c3c3c;
  border-radius: 3px;
  color: #e0e0e0;
  font-size: 12px;
}

.property-item input[type="checkbox"] {
  width: auto;
  margin-right: 6px;
}

.shortcuts {
  font-size: 11px;
  line-height: 1.6;
}

.shortcuts div {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid #3c3c3c;
}

.shortcuts div:last-child {
  border-bottom: none;
}

kbd {
  background: #1e1e1e;
  border: 1px solid #3c3c3c;
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 10px;
  font-family: monospace;
  color: #aaa;
}

/* Canvas Area */
.canvas-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #2c2c2c;
  padding: 16px;
  overflow: auto;
}

.canvas-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: #252525;
  border: 1px solid #3c3c3c;
  border-radius: 4px;
}

.level-info {
  display: flex;
  gap: 12px;
  align-items: center;
}

.level-info label {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.level-info input {
  width: 50px;
  padding: 4px 6px;
  background: #1e1e1e;
  border: 1px solid #3c3c3c;
  border-radius: 3px;
  color: #e0e0e0;
  font-size: 12px;
}

.level-info button {
  padding: 4px 10px;
  font-size: 12px;
  background: #3c3c3c;
  color: #e0e0e0;
  border: 1px solid #555;
  border-radius: 3px;
  cursor: pointer;
}

.level-info button:hover {
  background: #4c4c4c;
}

.status {
  font-size: 12px;
  color: #888;
}

canvas {
  display: block;
  background: #1a1a1a;
  border: 2px solid #3c3c3c;
  border-radius: 4px;
  cursor: crosshair;
}

canvas.selecting {
  cursor: default;
}

canvas.moving {
  cursor: move;
}

canvas.connecting {
  cursor: alias;
}

canvas.deleting {
  cursor: not-allowed;
}

/* Hypothesis Panel */
.hypothesis-panel {
  width: 450px;
  background: #252525;
  border-left: 2px solid #3c3c3c;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.hypothesis-panel h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: #888;
  margin: 16px 0 8px 0;
  letter-spacing: 0.5px;
}

.hypothesis-panel h3:first-child {
  margin-top: 0;
}

.script-editor {
  flex: 1;
  min-height: 200px;
  margin-bottom: 12px;
}

.script-editor textarea {
  width: 100%;
  height: 100%;
  min-height: 200px;
  padding: 12px;
  background: #1e1e1e;
  border: 1px solid #3c3c3c;
  border-radius: 4px;
  color: #e0e0e0;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.5;
  resize: vertical;
}

.script-editor textarea::placeholder {
  color: #666;
}

.execute-btn {
  width: 100%;
  padding: 8px;
  background: #1E88E5;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 16px;
}

.execute-btn:hover {
  background: #1976D2;
}

.execute-btn:active {
  transform: translateY(1px);
}

.template-palette {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.template-item {
  padding: 12px;
  background: #2c2c2c;
  border: 2px solid #3c3c3c;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.template-item:hover {
  background: #353535;
  border-color: #1E88E5;
}

.template-item.active {
  background: #353535;
  border-color: #1E88E5;
}

.template-name {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
}

.template-distribution {
  font-size: 11px;
  color: #aaa;
  font-family: 'Courier New', monospace;
}
