/* ==========================================================================
   DEVPEGS - Code Sandbox Styles
   ========================================================================== */

.sandbox-container {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  min-height: 600px;
}

.sandbox-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
}

.sandbox-toolbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.template-selector {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  outline: none;
  font-family: var(--font-sans);
}

.sandbox-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sandbox-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  min-height: 480px;
}

.sandbox-editor-pane {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-subtle);
  background: #050811;
  position: relative;
}

.pane-header {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.code-editor-textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  padding: 1.25rem;
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
  tab-size: 2;
  white-space: pre;
}

.sandbox-output-pane {
  display: flex;
  flex-direction: column;
  background: #080c18;
}

.preview-iframe {
  width: 100%;
  height: 220px;
  border: none;
  background: #ffffff;
}

.console-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #050811;
  border-top: 1px solid var(--border-subtle);
  overflow: hidden;
}

.console-logs {
  flex: 1;
  padding: 0.75rem 1rem;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.log-entry {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border-left: 3px solid #64748b;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-all;
}

.log-entry.info {
  border-left-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.08);
}

.log-entry.warn {
  border-left-color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.08);
  color: #fde68a;
}

.log-entry.error {
  border-left-color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.12);
  color: #fca5a5;
}

@media (max-width: 900px) {
  .sandbox-body {
    grid-template-columns: 1fr;
  }
  .sandbox-editor-pane {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
}
