/* ── LAYOUT.CSS — Sidebar, file panel, main grid ── */
.main {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

/* ── SIDEBAR ── */
.sidebar {
  width: 48px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  gap: 4px;
  flex-shrink: 0;
}

.sidebar-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  transition: all 0.2s;
  position: relative;
}

.sidebar-icon:hover { color: var(--text-primary); background: var(--bg-hover); }
.sidebar-icon.active { color: var(--accent); background: var(--accent-glow); }

.sidebar-icon.active::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 6px; bottom: 6px;
  width: 2px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 6px var(--accent);
}

.sidebar-spacer { flex: 1; }

/* ── FILE PANEL ── */
.file-panel {
  width: 210px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.2s ease, opacity 0.2s ease;
  overflow: hidden;
}

.file-panel.collapsed {
  width: 0;
  opacity: 0;
  pointer-events: none;
}

.panel-header {
  padding: 10px 12px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.panel-header-btn {
  width: 18px; height: 18px;
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  transition: all 0.2s;
}

.panel-header-btn:hover { color: var(--accent); background: var(--accent-glow); }

.file-tree {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}

.file-folder {
  padding: 5px 12px;
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

.file-folder:hover { background: var(--bg-hover); }

.file-item {
  padding: 5px 12px 5px 26px;
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'JetBrains Mono', monospace;
  position: relative;
}

.file-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.file-item.active { color: var(--accent); background: var(--accent-glow); }
.file-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.file-delete-btn {
  width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.file-item:hover .file-delete-btn { opacity: 1; }
.file-delete-btn:hover { color: var(--red) !important; background: rgba(255,71,87,0.12); }

/* ── EDITOR AREA ── */
.editor-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── TABS BAR ── */
.tabs-bar {
  height: 38px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  flex-shrink: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.editor-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  height: 38px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  border-right: 1px solid var(--border);
  white-space: nowrap;
  transition: all 0.15s;
  font-family: 'JetBrains Mono', monospace;
  position: relative;
  flex-shrink: 0;
}

.editor-tab:hover { color: var(--text-primary); background: var(--bg-hover); }
.editor-tab.active { color: var(--text-primary); background: var(--bg-base); border-bottom: 2px solid var(--accent); }

.editor-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 1px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.tab-dot { width: 6px; height: 6px; border-radius: 50%; }

.tab-close {
  width: 14px; height: 14px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.15s;
  font-size: 10px;
  color: var(--text-muted);
}

.editor-tab:hover .tab-close { opacity: 1; }
.tab-close:hover { color: var(--red); }

/* ── BOTTOM PANEL ── */
.bottom-panel {
  height: 170px;
  min-height: 100px;
  max-height: 300px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
}

.bottom-panel-resize {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  cursor: ns-resize;
  background: transparent;
  z-index: 10;
}

.bottom-panel-resize:hover { background: rgba(0,212,255,0.15); }

.bottom-tabs {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 0 14px;
  gap: 0;
  flex-shrink: 0;
  overflow-x: auto;
}

.bottom-tab {
  padding: 7px 12px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  letter-spacing: 0.3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.bottom-tab:hover { color: var(--text-secondary); }
.bottom-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── ACTION BAR ── */
.action-bar {
  height: 48px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  flex-shrink: 0;
  gap: 8px;
}

.action-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
}

.action-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.compiler-select {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 5px 8px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
  max-width: 160px;
}

.compiler-select:hover, .compiler-select:focus {
  border-color: var(--border-bright);
  color: var(--text-primary);
}

.compiler-select option { background: var(--bg-elevated); }

.gas-info {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  white-space: nowrap;
}

.gas-value { color: var(--orange); }

/* Buttons */
.btn-secondary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  white-space: nowrap;
}

.btn-secondary:hover {
  border-color: var(--border-bright);
  color: var(--text-primary);
  background: var(--bg-hover);
}

.btn-run {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(0,212,255,0.1), rgba(168,85,247,0.1));
  border: 1px solid var(--accent-dim);
  border-radius: 7px;
  color: var(--accent);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: all 0.25s;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.btn-run::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  opacity: 0;
  transition: opacity 0.25s;
}

.btn-run:hover::before { opacity: 0.15; }
.btn-run:hover { box-shadow: 0 0 24px rgba(0,212,255,0.3); transform: translateY(-1px); border-color: var(--accent); }
.btn-run span { position: relative; z-index: 1; }
.btn-run.running .run-icon { animation: spin 0.8s linear infinite; }

.btn-deploy {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #0a4a2a, #0d6035);
  border: 1px solid var(--green-dim);
  border-radius: 7px;
  color: var(--green);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: all 0.25s;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.btn-deploy::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--green), #00cc6a);
  opacity: 0;
  transition: opacity 0.25s;
}

.btn-deploy:hover::before { opacity: 0.15; }
.btn-deploy:hover { box-shadow: 0 0 24px rgba(0,255,136,0.3); transform: translateY(-1px); border-color: var(--green); }
.btn-deploy span { position: relative; z-index: 1; }
.btn-deploy.deploying .deploy-icon { animation: spin 0.8s linear infinite; }
