/* ============================================================
   PLAYGROUND STYLES
   Uses CSS custom properties from the agentbets theme (style.css).
   ============================================================ */

.playground-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.playground-header h1 {
  margin-bottom: 0.25rem;
}

.playground-subtitle {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* --- Tabs --- */
.playground-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
  overflow-x: auto;
}

.tab {
  padding: 0.6rem 1.2rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.9rem;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}

.tab:hover {
  color: var(--text);
}

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

/* --- Description --- */
.playground-description {
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* --- Split Panels --- */
.playground-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
  min-height: 450px;
}

.playground-editor-panel,
.playground-response-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* --- Toolbars --- */
.editor-toolbar,
.response-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.editor-actions {
  display: flex;
  gap: 0.5rem;
}

.editor-label,
.response-label {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Code Editor --- */
#code-editor {
  flex: 1;
  width: 100%;
  min-height: 400px;
  padding: 1rem;
  background: transparent;
  color: var(--text);
  border: none;
  resize: none;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.6;
  tab-size: 2;
  outline: none;
}

#code-editor:focus {
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* --- Response Output --- */
#response-output {
  flex: 1;
  margin: 0;
  padding: 1rem;
  background: transparent;
  overflow: auto;
  font-size: 0.8rem;
  line-height: 1.5;
  min-height: 400px;
}

#response-output code {
  font-family: var(--mono);
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

#response-output code.error {
  color: var(--orange);
}

/* --- Buttons --- */
.run-button,
.copy-button {
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: none;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.8rem;
  transition: background 0.2s, border-color 0.2s;
}

.run-button {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 500;
}

.run-button:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.run-button:disabled {
  opacity: 0.5;
  cursor: wait;
}

.copy-button:hover {
  border-color: var(--text-muted);
}

/* --- CTA Section --- */
.playground-cta {
  margin: 2rem 0;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
  transition: border-color 0.2s;
}

.playground-cta.cta-highlighted {
  border-color: var(--accent);
}

.playground-cta h3 {
  margin-bottom: 0.5rem;
}

.playground-cta > .cta-inner > p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.cta-button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  transition: background 0.2s, border-color 0.2s;
}

.cta-button:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent);
  color: var(--text);
  text-decoration: none;
}

.cta-note {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- Guide Links --- */
.playground-guides {
  margin-top: 2rem;
}

.playground-guides h3 {
  margin-bottom: 0.75rem;
}

.guide-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.guide-links a {
  color: var(--text-muted);
  transition: color 0.2s;
}

.guide-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .playground-split {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  #code-editor {
    min-height: 250px;
  }

  #response-output {
    min-height: 250px;
  }

  .playground-tabs {
    gap: 0;
  }

  .tab {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }
}
