/**
 * ---
 * Project      : Coding Campus Platform
 * Module       : Static / Css
 * File         : ai_lesson_code_highlight.css
 *
 * Description  : Project css source for Ai Lesson Code Highlight.
 *
 * Author       : Jihun Kang
 * Organization : Coding Campus / OrbiSync
 * Contact      : makers.dev.ci@gmail.com
 *
 * Copyright (c) 2026 Jihun Kang. All rights reserved.
 * ---
 */
/* Shared syntax-highlighted code blocks for AI lesson player */

.ai-code-block,
.ai-lesson-code-block {
  width: 100%;
  border: 1px solid #1e293b;
  border-radius: 16px;
  background: #0f172a;
  color: #e5e7eb;
  overflow: hidden;
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

.ai-code-block--compact {
  max-width: 100%;
}

.ai-code-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  background: #1e293b;
  color: #cbd5e1;
  font-size: 13px;
  font-family: inherit;
}

.ai-code-block__pre,
.ai-lesson-code-block__pre {
  margin: 0;
  padding: 22px 26px;
  overflow-x: auto;
  overflow-y: hidden;
  font-family: inherit;
  font-size: 18px;
  line-height: 1.7;
  color: #e5e7eb;
  background: #0f172a;
  white-space: pre;
}

.ai-code-block__pre--scroll {
  max-height: min(36vh, 280px);
  overflow-y: auto;
}

.ai-code-block--compact .ai-code-block__pre {
  padding: 18px 22px;
  font-size: 17px;
  line-height: 1.65;
}

.ai-code-block--compact .ai-code-block__pre--scroll {
  max-height: min(32vh, 240px);
}

.ai-code-block__pre code,
.ai-lesson-code-block__pre code {
  display: block;
  white-space: pre;
  word-break: normal;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  background: transparent;
}

/* highlight.js tokens */
.ai-code-block .hljs,
.ai-lesson-code-block .hljs {
  background: transparent;
  padding: 0;
  color: #e5e7eb;
}

.ai-code-block .hljs-keyword,
.ai-lesson-code-block .hljs-keyword,
.ai-code-block .hl-keyword,
.ai-lesson-code-block .hl-keyword {
  color: #7dd3fc;
  font-weight: 600;
}

.ai-code-block .hljs-built_in,
.ai-lesson-code-block .hljs-built_in,
.ai-code-block .hljs-title.function_,
.ai-lesson-code-block .hljs-title.function_,
.ai-code-block .hl-builtin,
.ai-lesson-code-block .hl-builtin {
  color: #c4b5fd;
}

.ai-code-block .hljs-string,
.ai-lesson-code-block .hljs-string,
.ai-code-block .hl-string,
.ai-lesson-code-block .hl-string {
  color: #86efac;
}

.ai-code-block .hljs-number,
.ai-lesson-code-block .hljs-number,
.ai-code-block .hl-number,
.ai-lesson-code-block .hl-number {
  color: #fcd34d;
}

.ai-code-block .hljs-comment,
.ai-lesson-code-block .hljs-comment,
.ai-code-block .hl-comment,
.ai-lesson-code-block .hl-comment {
  color: #64748b;
  font-style: italic;
}

.ai-code-block .hljs-title,
.ai-lesson-code-block .hljs-title,
.ai-code-block .hljs-type,
.ai-lesson-code-block .hljs-type {
  color: #f9a8d4;
}

.ai-code-block .hljs-meta,
.ai-lesson-code-block .hljs-meta,
.ai-code-block .hljs-attr,
.ai-lesson-code-block .hljs-attr {
  color: #93c5fd;
}

/* Legacy wrappers — inherit lesson code block typography */
.ai-lesson-code-callout .ai-code-block,
.ai-layout-code-step .ai-code-block,
.ai-state-flow-code .ai-code-block,
.prompt-scroll-box .ai-code-block,
.ai-lesson-prompt-box .ai-code-block {
  margin-top: 0;
}

.ai-lesson-code-block > .ai-code-block,
.ai-lesson-code-block__pre:has(.hljs) {
  border: none;
  background: transparent;
}

.ai-pattern--state-code-flow-compact {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.ai-state-code-flow-compact__bullets {
  margin: 0;
  padding: 0 0 0 1.1rem;
  color: #334155;
  font-size: clamp(13px, 1.35vw, 15px);
  line-height: 1.5;
}

.ai-state-code-flow-compact__bullets li {
  margin: 0 0 4px;
}

.ai-state-code-flow-compact__summary {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #fde68a;
  background: #fffbeb;
}

.ai-state-code-flow-compact__summary-title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: #92400e;
}

.ai-state-code-flow-compact__summary-body {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #78350f;
}

.ai-lesson-screen--state-code-flow .ai-lesson-screen__visual {
  max-height: none;
}

.ai-lesson-screen--state-code-flow .ai-code-block__pre--scroll {
  max-height: min(34vh, 260px);
}

.ai-code-block--missing {
  padding: 16px 18px;
  border: 1px dashed #f59e0b;
  border-radius: 12px;
  background: #fffbeb;
  color: #92400e;
  font-size: 14px;
}

.ai-code-block--missing-learner {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

.ai-code-block--missing__title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
}

.ai-code-block--missing__hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.ai-state-flow-code__pre:empty,
.ai-state-flow-code__pre code:empty {
  display: none;
}

.ai-state-flow-code:not(:has(code:not(:empty))) {
  display: none;
}

@media (max-width: 768px) {
  .ai-code-block__pre,
  .ai-lesson-code-block__pre {
    font-size: 14px;
    line-height: 1.6;
    padding: 16px;
  }

  .ai-code-block--compact .ai-code-block__pre {
    font-size: 14px;
    padding: 14px 16px;
  }

  .ai-code-block__pre--scroll,
  .ai-lesson-screen--state-code-flow .ai-code-block__pre--scroll {
    max-height: min(30vh, 200px);
  }
}
