/* OmniTools - Code Editor with line numbers */

.code-editor {
  display: flex;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  font-family: "Fira Code", "Consolas", "Monaco", monospace;
  font-size: 12px;
  line-height: 1.5;
  position: relative;
}

.code-editor:focus-within {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.code-editor .line-numbers {
  flex-shrink: 0;
  width: 44px;
  padding: 12px 0;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  text-align: right;
  color: #94a3b8;
  font-weight: 500;
  user-select: none;
  overflow: hidden;
  position: relative;
}

.code-editor .line-numbers .ln {
  padding-right: 10px;
  cursor: pointer;
  transition: color 0.15s;
}

.code-editor .line-numbers .ln:hover {
  color: #4f46e5;
}

.code-editor .line-numbers .ln.error {
  color: #dc2626;
  font-weight: 700;
}

.code-editor .line-numbers .ln.active {
  color: #4f46e5;
  font-weight: 700;
}

.code-editor textarea {
  flex: 1;
  min-height: 200px;
  padding: 12px 14px;
  border: none;
  outline: none;
  resize: vertical;
  background: transparent;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: #1c1e21;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
  tab-size: 2;
}

.code-editor textarea::selection {
  background: rgba(79, 70, 229, 0.2);
}

/* Error line highlight (absolute overlay) */
.code-editor .error-line-highlight {
  position: absolute;
  left: 44px;
  right: 0;
  background: rgba(220, 38, 38, 0.08);
  border-left: 3px solid #dc2626;
  pointer-events: none;
  z-index: 1;
}

/* Dark theme (for future) */
.code-editor.dark {
  background: #0f172a;
  border-color: #334155;
}

.code-editor.dark .line-numbers {
  background: #1e293b;
  border-color: #334155;
  color: #64748b;
}

.code-editor.dark textarea {
  color: #e2e8f0;
}