/* ============================================
   Code Snippet Block - Professional Design
   ============================================ */

.code-snippet-block {
  margin: 20px 0;
  border: 1px solid #b8c9d9;
  border-radius: 10px;
  overflow: hidden;
  background: #e2eaf4;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.code-snippet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #c5d4e8;
  border-bottom: 1px solid #b8c9d9;
}

.code-snippet-lang {
  color: #3d5a80;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.code-snippet-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.code-snippet-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 26px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  color: #3d5a80;
  font-size: 13px;
  transition: all 0.2s ease;
}

.code-snippet-actions button:hover {
  background: rgba(61, 90, 128, 0.15);
  color: #1e3a5f;
}

.code-snippet-actions button.copied {
  color: #22c55e;
}

.code-snippet-content {
  padding: 16px 20px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #1e3a5f;
  min-height: 60px;
}

.code-snippet-content[contenteditable="true"] {
  outline: 2px solid #3d5a80;
  outline-offset: -2px;
  background: rgba(255, 255, 255, 0.5);
}

.code-snippet-content:empty::before {
  content: attr(data-placeholder);
  color: #5a7a9e;
}

/* Dark theme support (for main site blog viewer) */
.blog-content-inner .code-snippet-block,
.site-root .code-snippet-block {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.12);
}

.blog-content-inner .code-snippet-header,
.site-root .code-snippet-header {
  background: #334155;
  border-bottom-color: #475569;
}

.blog-content-inner .code-snippet-lang,
.site-root .code-snippet-lang {
  color: #94a3b8;
}

.blog-content-inner .code-snippet-actions button,
.site-root .code-snippet-actions button {
  color: #94a3b8;
}

.blog-content-inner .code-snippet-actions button:hover,
.site-root .code-snippet-actions button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.blog-content-inner .code-snippet-content,
.site-root .code-snippet-content {
  color: #e2e8f0;
}

.blog-content-inner .code-snippet-content:empty::before,
.site-root .code-snippet-content:empty::before {
  color: #64748b;
}

/* Rendered output when viewing blog (code runs as HTML) */
.code-snippet-output {
  padding: 16px 20px;
  min-height: 20px;
  overflow-x: auto;
  color: inherit;
  font-family: inherit;
}

.code-snippet-output img {
  max-width: 100%;
  height: auto;
}

.code-snippet-output iframe {
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
}
