/* Sandbox page styles */

/* Override style.css body width: fit-content */
body {
  width: unset;
  /* Have space at the bottom to make it easier to expand the editor. */
  margin-bottom: 120px;
}

.intro {
  max-width: 600px;
}

.sandbox-container {
  margin: 20px;
  max-width: 1200px;
}

.help-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.help-header h1 {
  margin: 0;
  font-size: 1.5em;
}

p {
  color: var(--color-text-muted);
  line-height: 1.4;
}

p code {
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: var(--font-family-mono);
}

/* Two-column layout using flexbox for natural wrapping */
.editor-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.editor-panel {
  flex: 0 0 auto;
}

.output-panel {
  flex: 1 1 300px;
  min-width: 300px;
}

/* Panel headers */
.panel-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-bottom: 10px;
  min-height: 28px;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.1em;
  color: var(--color-text-muted);
}

/* Button group */
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
}

.btn-group button {
  white-space: nowrap;
}

/* Code editor */
.editor {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-small);
  line-height: 1.5;
  padding: 15px;
  border-radius: 5px;
  border: 1px solid var(--color-border);
  background: #2d2d44;
  color: #f8f8f2;
  overflow: auto;
  tab-size: 2;
  white-space: pre-wrap;
  word-wrap: break-word;
  resize: vertical;
  width: 80ch;
  height: 400px;
}

.editor:focus {
  outline: 2px solid var(--color-primary);
}

/* Console output */
.output {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  padding: 15px;
  font-family: var(--font-family-mono);
  font-size: var(--font-size-small);
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
  height: 200px;
}

.output.error {
  color: var(--color-error);
}

.output.success {
  color: #2e7d32;
}

/* Constraint string section */
.result-section {
  margin-top: 15px;
}

.result-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #f5f5f5;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  padding: 10px;
  font-family: var(--font-family-mono);
  font-size: var(--font-size-small);
  min-height: 40px;
  overflow: hidden;
}

.result-box.copied {
  background: #e8f5e9;
}

#constraint-string {
  flex: 1;
  min-width: 0;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: hidden;
}

/* Copy button */
.copy-button {
  flex-shrink: 0;
  background: transparent;
  border: none;
  padding: 4px;
  margin: -4px -4px -4px 4px;
  cursor: pointer;
  opacity: 0.5;
  border-radius: 4px;
  transition: opacity 0.2s, background-color 0.2s;
  text-shadow: none;
  box-shadow: none;
}

.copy-button:hover,
.copy-button:hover:enabled {
  opacity: 1;
  background: rgba(0, 0, 0, 0.1);
}

.copy-button img {
  width: 16px;
  height: 16px;
  display: block;
  filter: none;
}