/* Code Playground Component */

.code-playground {
  width: 100%;
  margin: 24px 0 8px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.1);
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.playground-header {
  background: linear-gradient(135deg, #e0f2fe 0%, #f8fafc 100%);
  padding: 16px 20px;
  border-bottom: 1px solid #dbeafe;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.playground-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1f2937;
}

.run-button {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.run-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.25);
}

textarea.code-editor {
  display: none;
}

.CodeMirror {
  height: 240px;
  font-size: 0.95rem;
  background: #1e1e1e;
  color: #d4d4d4;
  border-radius: 0;
}

.CodeMirror-scroll {
  background: #1e1e1e;
}

.CodeMirror-gutters {
  background: #252526;
  border-right: 1px solid #3e3e42;
  color: #858585;
  padding-left: 10px;
}

.CodeMirror-gutter.CodeMirror-linenumbers {
  width: 45px;
  padding-right: 10px;
}

.CodeMirror-linenumber {
  color: #858585;
  padding: 0 8px 0 0;
  text-align: right;
  min-width: 20px;
}

.CodeMirror-lines {
  padding: 16px 0;
}

.CodeMirror-line {
  padding: 0 16px 0 16px;
}

.CodeMirror pre {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

.CodeMirror .cm-comment {
  color: #6a9955;
}

.CodeMirror .cm-string {
  color: #ce9178;
}

.CodeMirror .cm-number {
  color: #b5cea8;
}

.CodeMirror .cm-keyword {
  color: #c586c0;
}

.CodeMirror .cm-operator {
  color: #d4d4d4;
}

.CodeMirror .cm-variable {
  color: #9cdcfe;
}

.CodeMirror .cm-def {
  color: #dcdcaa;
}

.CodeMirror .cm-builtin {
  color: #4ec9b0;
}

.CodeMirror-cursor {
  border-left: 1px solid #aeafad;
}

.CodeMirror-selected {
  background: #264f78;
}

.output-section {
  background: #1e1e1e;
  border-top: 1px solid #3e3e42;
  padding: 16px 20px;
  min-height: 78px;
}

.output-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #858585;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.output-content {
  background: #252526;
  color: #d4d4d4;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #3e3e42;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  font-size: 0.95rem;
  min-height: 38px;
  white-space: pre-wrap;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .CodeMirror {
    height: 280px;
  }
}
