/**
 * Reusable Content Box Styles
 * Provides consistent styling for different types of content boxes in markdown
 */

/* Base box style - shared properties */
.content-box {
  padding: 15px;
  border-radius: 8px;
  margin: 20px 0;
  border-left: 4px solid transparent;
}

/* Key Insight Box - Yellow background for important concepts */
.insight-box {
  background-color: #fff8dc;
  border-left-color: #f4a261;
}

/* Interactive Exercise Box - Light blue for hands-on activities */
.exercise-box {
  background-color: #f0f8ff;
  border-left-color: #2a9d8f;
}

/* Summary/Takeaway Box - Light green for conclusions */
.summary-box {
  background-color: #e8f5e8;
  border-left-color: #52b788;
}

/* Warning/Problem Box - Light red for alerts */
.warning-box {
  background-color: #ffebee;
  border-left-color: #e63946;
}

/* Info Box - Light gray for general information */
.info-box {
  background-color: #f8f9fa;
  border-left-color: #6c757d;
}

/* Note Box - Light purple for side notes */
.note-box {
  background-color: #f3e5f5;
  border-left-color: #9c27b0;
}

/* Example Box - Light orange for examples */
.example-box {
  background-color: #fff3e0;
  border-left-color: #ff9800;
}

/* Question Box - Light cyan for self-check questions */
.question-box {
  background-color: #e0f7fa;
  border-left-color: #00acc1;
}

/* Strong text styling within boxes */
.content-box strong {
  font-weight: 600;
  color: #2c3e50;
}

/* Emoji styling for better visual hierarchy */
.content-box .emoji-title {
  font-size: 1.1em;
  margin-bottom: 8px;
  display: block;
}

/* List styling within boxes */
.content-box ul {
  margin: 10px 0;
  padding-left: 20px;
}

.content-box li {
  margin: 5px 0;
}

/* Code styling within boxes */
.content-box code {
  background-color: rgba(0, 0, 0, 0.1);
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 0.9em;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .content-box {
    margin: 15px 0;
    padding: 12px;
  }
}

/* ── Khối Định nghĩa / Định lý / Chứng minh (cùng kiểu với khoá Toán rời rạc) ──
   Dùng: <div class="textbook-definition|textbook-theorem|textbook-lemma|textbook-proof" markdown="1">
   Dòng đầu là nhãn in đậm, ví dụ **Định nghĩa 1.2 (Tên)**. Theorem/Corollary/Proposition dùng textbook-theorem.
   textbook-proof tự thêm ∎; thêm class textbook-proof-marked khi nội dung đã có sẵn ký hiệu kết thúc. */
.textbook-definition,
.textbook-theorem,
.textbook-lemma,
.textbook-proof {
  --blk: #2c5282;
  --blk-bg: #eef4fb;
  margin: 1.4rem 0;
  padding: 0.85rem 1.15rem;
  text-align: left;
  background: var(--blk-bg);
  border: 1px solid rgba(44, 82, 130, 0.22);
  border-left: 4px solid var(--blk);
  border-radius: 0 6px 6px 0;
}

.textbook-theorem,
.textbook-lemma {
  --blk: #9c4221;
  --blk-bg: #fdf3ec;
  border-color: rgba(156, 66, 33, 0.22);
  border-left-color: #9c4221;
}

.textbook-proof {
  --blk: #718096;
  --blk-bg: #f7f7f5;
  border-color: rgba(113, 128, 150, 0.22);
  border-left-color: #718096;
  border-left-width: 3px;
  font-size: 0.98rem;
}

.textbook-proof::after {
  content: "\220E";
  display: block;
  text-align: right;
  color: var(--blk);
}

.textbook-proof.textbook-proof-marked::after { content: none; }

.textbook-definition > :first-child,
.textbook-theorem > :first-child,
.textbook-lemma > :first-child,
.textbook-proof > :first-child { margin-top: 0; }

.textbook-definition > :last-child,
.textbook-theorem > :last-child,
.textbook-lemma > :last-child,
.textbook-proof > :last-child { margin-bottom: 0; }

.textbook-definition > p:first-child > strong:first-child,
.textbook-theorem > p:first-child > strong:first-child,
.textbook-lemma > p:first-child > strong:first-child,
.textbook-proof > p:first-child > strong:first-child {
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--blk);
}

.textbook-definition pre,
.textbook-theorem pre,
.textbook-lemma pre,
.textbook-proof pre { background: #fff; }
