/* Prism.js 테마 - GitHub 스타일 */
/* 다크 모드와 라이트 모드 지원 */

code[class*='language-'],
pre[class*='language-'] {
  color: var(--text-color);
  background: var(--code-bg);
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  word-wrap: normal;
  line-height: 1.5;
  -moz-tab-size: 4;
  -o-tab-size: 4;
  tab-size: 4;
  -webkit-hyphens: none;
  -moz-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
}

pre[class*='language-']::-moz-selection,
pre[class*='language-'] ::-moz-selection,
code[class*='language-']::-moz-selection,
code[class*='language-'] ::-moz-selection {
  text-shadow: none;
  background: rgba(0, 0, 0, 0.2);
}

pre[class*='language-']::selection,
pre[class*='language-'] ::selection,
code[class*='language-']::selection,
code[class*='language-'] ::selection {
  text-shadow: none;
  background: rgba(0, 0, 0, 0.2);
}

/* 라이트 모드 코드 블록 */
:root pre[class*='language-'] {
  border: 1px solid #e1e4e8;
  border-radius: 6px;
}

:root code[class*='language-'] {
  background: #f6f8fa;
  border-radius: 3px;
}

/* 다크 모드 코드 블록 */
[data-theme='dark'] pre[class*='language-'] {
  border: 1px solid #30363d;
  border-radius: 6px;
}

[data-theme='dark'] code[class*='language-'] {
  background: #2d333b;
  border-radius: 3px;
}

/* 토큰 색상 */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #6a737d;
}

.token.punctuation {
  color: var(--text-color);
}

.token.property,
.token.tag,
.token.constant,
.token.symbol,
.token.deleted {
  color: #005cc5;
}

[data-theme='dark'] .token.property,
[data-theme='dark'] .token.tag,
[data-theme='dark'] .token.constant,
[data-theme='dark'] .token.symbol,
[data-theme='dark'] .token.deleted {
  color: #79b8ff;
}

.token.boolean,
.token.number {
  color: #005cc5;
}

[data-theme='dark'] .token.boolean,
[data-theme='dark'] .token.number {
  color: #79b8ff;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: #032f62;
}

[data-theme='dark'] .token.selector,
[data-theme='dark'] .token.attr-name,
[data-theme='dark'] .token.string,
[data-theme='dark'] .token.char,
[data-theme='dark'] .token.builtin,
[data-theme='dark'] .token.inserted {
  color: #9ecbff;
}

.token.operator,
.token.entity,
.token.url,
.token.variable {
  color: #d73a49;
}

[data-theme='dark'] .token.operator,
[data-theme='dark'] .token.entity,
[data-theme='dark'] .token.url,
[data-theme='dark'] .token.variable {
  color: #f97583;
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: #d73a49;
}

[data-theme='dark'] .token.atrule,
[data-theme='dark'] .token.attr-value,
[data-theme='dark'] .token.keyword {
  color: #f97583;
}

.token.function {
  color: #6f42c1;
}

[data-theme='dark'] .token.function {
  color: #b392f0;
}

.token.regex,
.token.important {
  color: #e36209;
}

[data-theme='dark'] .token.regex,
[data-theme='dark'] .token.important {
  color: #ffab70;
}

/* 라인 하이라이트 */
.line-highlight {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme='dark'] .line-highlight {
  background: rgba(0, 0, 0, 0.2);
}

/* 라인 넘버 */
.line-numbers .line-numbers-rows {
  border-right: 1px solid #e1e4e8;
  padding-right: 8px;
}

[data-theme='dark'] .line-numbers .line-numbers-rows {
  border-right: 1px solid #30363d;
}

.line-numbers-rows > span:before {
  color: #6a737d;
}

/* 커맨드 라인 */
.command-line-prompt {
  border-right: 1px solid #e1e4e8;
  padding-right: 8px;
}

[data-theme='dark'] .command-line-prompt {
  border-right: 1px solid #30363d;
}

.command-line-prompt > span:before {
  color: #d73a49;
  content: '$ ';
  font-weight: bold;
}

/* Diff 하이라이팅 */
pre.diff-highlight > code .token.deleted:not(.prefix) {
  background-color: rgba(255, 11, 31, 0.15);
}

pre.diff-highlight > code .token.inserted:not(.prefix) {
  background-color: rgba(16, 185, 129, 0.15);
}

[data-theme='dark'] pre.diff-highlight > code .token.deleted:not(.prefix) {
  background-color: rgba(255, 11, 31, 0.3);
}

[data-theme='dark'] pre.diff-highlight > code .token.inserted:not(.prefix) {
  background-color: rgba(16, 185, 129, 0.3);
}
