/**
 * DSL Editor Styles
 */

.dsl-editor-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
}

.dsl-editor-wrapper {
  position: relative;
  flex: 1;
  min-height: 200px;
  display: flex;
  overflow: hidden;
}

/* Line numbers */
.dsl-line-numbers {
  width: 35px;
  padding: 10px 5px;
  background: #2d2d2d;
  color: #666;
  text-align: right;
  font-size: 12px;
  line-height: 1.5;
  user-select: none;
  overflow: hidden;
  flex-shrink: 0;
}

.dsl-line-numbers .line-number {
  height: 1.5em;
}

/* Textarea (editable layer) */
.dsl-textarea {
  position: absolute;
  top: 0;
  left: 35px;
  right: 0;
  bottom: 0;
  width: calc(100% - 35px);
  height: 100%;
  margin: 0;
  padding: 10px;
  border: none;
  background: transparent;
  color: transparent;
  caret-color: #fff;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  resize: none;
  outline: none;
  overflow: auto;
  white-space: pre;
  z-index: 2;
}

/* Highlighted layer (behind textarea) */
.dsl-highlight-layer {
  position: absolute;
  top: 0;
  left: 35px;
  right: 0;
  bottom: 0;
  width: calc(100% - 35px);
  height: 100%;
  margin: 0;
  padding: 10px;
  background: #1e1e1e;
  color: #d4d4d4;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  overflow: auto;
  white-space: pre;
  pointer-events: none;
  z-index: 1;
}

/* Syntax highlighting colors */
.hl-keyword {
  color: #569cd6;
  font-weight: bold;
}

.hl-builtin {
  color: #dcdcaa;
}

.hl-number {
  color: #b5cea8;
}

.hl-string {
  color: #ce9178;
}

.hl-comment {
  color: #6a9955;
  font-style: italic;
}

.hl-operator {
  color: #d4d4d4;
}

/* Error banner */
.dsl-error-banner {
  padding: 8px 12px;
  background: #5a1d1d;
  color: #f48771;
  font-size: 12px;
  border-top: 1px solid #7a3d3d;
}

/* Result display */
.dsl-result-display {
  padding: 10px;
  background: #252526;
  border-top: 1px solid #3c3c3c;
  max-height: 200px;
  overflow-y: auto;
}

.result-title {
  color: #888;
  font-size: 11px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.mc-note {
  color: #666;
  font-size: 10px;
  text-transform: none;
  font-style: italic;
}

.result-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 18px;
}

.result-value {
  width: 40px;
  text-align: right;
  color: #9cdcfe;
  font-size: 12px;
}

.result-bar-container {
  flex: 1;
  height: 14px;
  background: #333;
  border-radius: 2px;
  overflow: hidden;
}

.result-bar {
  height: 100%;
  background: #4ec9b0;
  border-radius: 2px;
}

.result-prob {
  width: 45px;
  text-align: right;
  color: #b5cea8;
  font-size: 12px;
}

/* Tooltip */
.dsl-tooltip {
  position: fixed;
  padding: 10px;
  background: #252526;
  border: 1px solid #3c3c3c;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  max-width: 300px;
  font-size: 12px;
}

.tooltip-var {
  color: #9cdcfe;
  font-weight: bold;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #3c3c3c;
}

.tooltip-var .mc-note {
  color: #888;
  font-weight: normal;
  font-size: 10px;
  font-style: italic;
}

.tooltip-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tooltip-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 16px;
}

.tooltip-value {
  width: 30px;
  text-align: right;
  color: #d4d4d4;
  font-size: 11px;
}

.tooltip-bar-container {
  flex: 1;
  height: 10px;
  background: #333;
  border-radius: 2px;
  overflow: hidden;
  min-width: 60px;
}

.tooltip-bar {
  height: 100%;
  background: #569cd6;
  border-radius: 2px;
}

.tooltip-prob {
  width: 40px;
  text-align: right;
  color: #b5cea8;
  font-size: 11px;
}

.tooltip-more {
  color: #666;
  font-size: 10px;
  margin-top: 4px;
  font-style: italic;
}

/* Without line numbers variant */
.dsl-editor-container.no-line-numbers .dsl-textarea,
.dsl-editor-container.no-line-numbers .dsl-highlight-layer {
  left: 0;
  width: 100%;
}

/* Copy prediction button */
.dsl-copy-prediction-btn {
  margin-top: 10px;
  padding: 8px 16px;
  background: #4ec9b0;
  color: #1e1e1e;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

.dsl-copy-prediction-btn:hover {
  background: #6fd9c0;
}

.dsl-copy-prediction-btn:disabled {
  background: #555;
  color: #888;
  cursor: not-allowed;
}
