/**
 * Shared styles for HTML/CSS demos in docs/demos/html-css-demo/
 * Link this file in every demo page so all demos look consistent.
 */

/* ---------- Page layout ---------- */
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  line-height: 1.5;
  padding: 24px;
  color: #111;
  max-width: 900px;
  margin: 0 auto;
}

h1, h2 {
  margin: 0 0 12px 0;
}

/* ---------- Demo sections ---------- */
.section {
  margin: 20px 0 36px;
}

.demo {
  border: 1px solid #e0e0e0;
  padding: 12px;
  border-radius: 6px;
  background: #fafafa;
}

.render {
  padding: 12px;
  background: #fff;
  border: 1px dashed #ddd;
  margin-bottom: 12px;
}

/* ---------- Code blocks ---------- */
.code {
  background: #0f1720;
  color: #d1d5db;
  padding: 12px;
  overflow: auto;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Courier New", monospace;
  font-size: 13px;
}

.code code {
  white-space: pre-wrap;
}

/* ---------- Notes and explanations ---------- */
.note {
  font-size: 13px;
  color: #374151;
  margin-bottom: 8px;
}

.explain {
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  padding: 10px 12px;
  margin-top: 10px;
  font-size: 14px;
}

.explain strong {
  color: #1d4ed8;
}

/* ---------- Layout helpers (for multi-column or future demos) ---------- */
.row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.col {
  flex: 1;
  min-width: 200px;
}

/* ---------- Demo-specific: block / inline boxes (e.g. inline-block demo) ---------- */
.block-box {
  display: block;
  width: 100%;
  background: #d1fae5;
  border: 1px solid #86efac;
  padding: 8px;
  margin: 6px 0;
}

.inline-box {
  display: inline-block;
  width: 120px;
  height: 72px;
  background: #fde68a;
  border: 1px solid #facc15;
  padding: 8px;
  margin-right: 8px;
  vertical-align: top;
}

/* ---------- Demo-specific: ul styled as ol (e.g. list demos) ---------- */
ul.styled-as-ol {
  list-style-type: decimal;
  padding-left: 1.5em;
}

/* ---------- JavaScript Interactive Demos ---------- */
.container {
  background-color: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.demo-area {
  background-color: #e8f4fd;
  border: 1px solid #b6d4fe;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  text-align: center;
}

.interactive-button {
  background-color: #3498db;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.interactive-button:hover {
  background-color: #2980b9;
}

.interactive-output {
  margin-top: 15px;
  font-size: 18px;
  font-weight: bold;
  color: #e74c3c;
  min-height: 27px;
}

.keyword { color: #c678dd; }
.string { color: #98c379; }
.function { color: #61afef; }
.variable { color: #e06c75; }
.comment { color: #7f848e; font-style: italic; }
