/* Swift-specific syntax highlighting for dark theme */
@media (prefers-color-scheme: dark) {
  html:not([data-mode]) .language-swift .highlight,
  html[data-mode='dark'] .language-swift .highlight {
    background-color: #252629;
    color: #DFDFE0;

    /* Core syntax elements */
    --swift-plain-text: #FFFFFF;
    --swift-comment: #6C7986;
    --swift-doc-markup: #6C7986;
    --swift-doc-markup-keywords: #92A1B1;
    --swift-marks: #92A1B1;
    --swift-string: #FC6A5D;
    --swift-character: #D0BF69;
    --swift-number: #D0BF69;
    --swift-regex-literal: #FC6A5D;
    --swift-regex-numbers: #D0BF69;
    --swift-regex-capture: #67B7A4;
    --swift-regex-character: #A167E6;
    --swift-regex-operator: #FFFFFF;
    --swift-keyword: #FC5FA3;
    --swift-preprocessor: #FD8F3F;
    --swift-url: #5482FF;
    --swift-attribute: #BF8555;
    --swift-type-declaration: #5DD8FF;
    --swift-other-declaration: #41A1C0;
    --swift-heading: #AA0D91;

    /* Project-specific elements */
    --swift-project-class: #9EF1DD;
    --swift-project-function: #67B7A4;
    --swift-project-constant: #67B7A4;
    --swift-project-type: #9EF1DD;
    --swift-project-property: #67B7A4;
    --swift-project-preprocessor: #FD8F3F;

    /* Other elements */
    --swift-other-class: #D0A8FF;
    --swift-other-function: #A167E6;
    --swift-other-constant: #A167E6;
    --swift-other-type: #D0A8FF;
    --swift-other-property: #A167E6;
    --swift-other-preprocessor: #FD8F3F;
  }
}

html[data-mode='dark'] .language-swift .highlight {
  background-color: #252629;
  color: #DFDFE0;

  /* Core syntax elements */
  --swift-plain-text: #FFFFFF;
  --swift-comment: #6C7986;
  --swift-doc-markup: #6C7986;
  --swift-doc-markup-keywords: #92A1B1;
  --swift-marks: #92A1B1;
  --swift-string: #FC6A5D;
  --swift-character: #D0BF69;
  --swift-number: #D0BF69;
  --swift-regex-literal: #FC6A5D;
  --swift-regex-numbers: #D0BF69;
  --swift-regex-capture: #67B7A4;
  --swift-regex-character: #A167E6;
  --swift-regex-operator: #FFFFFF;
  --swift-keyword: #FC5FA3;
  --swift-preprocessor: #FD8F3F;
  --swift-url: #5482FF;
  --swift-attribute: #BF8555;
  --swift-type-declaration: #5DD8FF;
  --swift-other-declaration: #41A1C0;
  --swift-heading: #AA0D91;

  /* Project-specific elements */
  --swift-project-class: #9EF1DD;
  --swift-project-function: #67B7A4;
  --swift-project-constant: #67B7A4;
  --swift-project-type: #9EF1DD;
  --swift-project-property: #67B7A4;
  --swift-project-preprocessor: #FD8F3F;

  /* Other elements */
  --swift-other-class: #D0A8FF;
  --swift-other-function: #A167E6;
  --swift-other-constant: #A167E6;
  --swift-other-type: #D0A8FF;
  --swift-other-property: #A167E6;
  --swift-other-preprocessor: #FD8F3F;
}

/* Syntax highlighting implementations */
@media (prefers-color-scheme: dark) {
  html:not([data-mode]) .language-swift .highlight pre,
  html[data-mode='dark'] .language-swift .highlight pre {
    background-color: transparent;
  }
}

html[data-mode='dark'] .language-swift .highlight pre {
  background-color: transparent;
}

/* Keywords */
@media (prefers-color-scheme: dark) {
  html:not([data-mode]) .language-swift .k,
  html:not([data-mode]) .language-swift .kd,
  html[data-mode='dark'] .language-swift .k,
  html[data-mode='dark'] .language-swift .kd {
    color: var(--swift-keyword) !important;
  }
}

html[data-mode='dark'] .language-swift .k,
html[data-mode='dark'] .language-swift .kd {
  color: var(--swift-keyword) !important;
}

/* Strings */
@media (prefers-color-scheme: dark) {
  html:not([data-mode]) .language-swift .s,
  html:not([data-mode]) .language-swift .s1,
  html:not([data-mode]) .language-swift .s2,
  html[data-mode='dark'] .language-swift .s,
  html[data-mode='dark'] .language-swift .s1,
  html[data-mode='dark'] .language-swift .s2 {
    color: var(--swift-string) !important;
  }
}

html[data-mode='dark'] .language-swift .s,
html[data-mode='dark'] .language-swift .s1,
html[data-mode='dark'] .language-swift .s2 {
  color: var(--swift-string) !important;
}

/* Comments */
@media (prefers-color-scheme: dark) {
  html:not([data-mode]) .language-swift .c,
  html:not([data-mode]) .language-swift .cm,
  html:not([data-mode]) .language-swift .cp,
  html:not([data-mode]) .language-swift .c1,
  html[data-mode='dark'] .language-swift .c,
  html[data-mode='dark'] .language-swift .cm,
  html[data-mode='dark'] .language-swift .cp,
  html[data-mode='dark'] .language-swift .c1 {
    color: var(--swift-comment) !important;
  }
}

html[data-mode='dark'] .language-swift .c,
html[data-mode='dark'] .language-swift .cm,
html[data-mode='dark'] .language-swift .cp,
html[data-mode='dark'] .language-swift .c1 {
  color: var(--swift-comment) !important;
}

/* Numbers */
@media (prefers-color-scheme: dark) {
  html:not([data-mode]) .language-swift .mi,
  html:not([data-mode]) .language-swift .mf,
  html[data-mode='dark'] .language-swift .mi,
  html[data-mode='dark'] .language-swift .mf {
    color: var(--swift-number) !important;
  }
}

html[data-mode='dark'] .language-swift .mi,
html[data-mode='dark'] .language-swift .mf {
  color: var(--swift-number) !important;
}

/* Class Names */
@media (prefers-color-scheme: dark) {
  html:not([data-mode]) .language-swift .nc,
  html[data-mode='dark'] .language-swift .nc {
    color: var(--swift-project-class) !important;
  }
}

html[data-mode='dark'] .language-swift .nc {
  color: var(--swift-project-class) !important;
}

/* Type Declarations */
@media (prefers-color-scheme: dark) {
  html:not([data-mode]) .language-swift .kt,
  html[data-mode='dark'] .language-swift .kt {
    color: var(--swift-type-declaration) !important;
  }
}

html[data-mode='dark'] .language-swift .kt {
  color: var(--swift-type-declaration) !important;
}

/* Plain Text */
@media (prefers-color-scheme: dark) {
  html:not([data-mode]) .language-swift .n,
  html[data-mode='dark'] .language-swift .n {
    color: var(--swift-plain-text) !important;
  }
}

html[data-mode='dark'] .language-swift .n {
  color: var(--swift-plain-text) !important;
}

/* Documentation Markup */
@media (prefers-color-scheme: dark) {
  html:not([data-mode]) .language-swift .nl,
  html[data-mode='dark'] .language-swift .nl {
    color: var(--swift-doc-markup) !important;
  }
}

html[data-mode='dark'] .language-swift .nl {
  color: var(--swift-doc-markup) !important;
}

/* Regex Capture */
@media (prefers-color-scheme: dark) {
  html:not([data-mode]) .language-swift .nx,
  html[data-mode='dark'] .language-swift .nx {
    color: var(--swift-regex-capture) !important;
  }
}

html[data-mode='dark'] .language-swift .nx {
  color: var(--swift-regex-capture) !important;
}

/* Punctuation */
@media (prefers-color-scheme: dark) {
  html:not([data-mode]) .language-swift .p,
  html[data-mode='dark'] .language-swift .p {
    color: var(--swift-plain-text) !important;
  }
}

html[data-mode='dark'] .language-swift .p {
  color: var(--swift-plain-text) !important;
}

/* Operators */
@media (prefers-color-scheme: dark) {
  html:not([data-mode]) .language-swift .o,
  html[data-mode='dark'] .language-swift .o {
    color: var(--swift-regex-operator) !important;
  }
}

html[data-mode='dark'] .language-swift .o {
  color: var(--swift-regex-operator) !important;
}

/* Documentation and Markup */
@media (prefers-color-scheme: dark) {
  html:not([data-mode]) .language-swift .cd,
  html[data-mode='dark'] .language-swift .cd {
    color: var(--swift-doc-markup) !important;
  }

  html:not([data-mode]) .language-swift .cp,
  html[data-mode='dark'] .language-swift .cp {
    color: var(--swift-preprocessor) !important;
  }
}

html[data-mode='dark'] .language-swift .cd {
  color: var(--swift-doc-markup) !important;
}

html[data-mode='dark'] .language-swift .cp {
  color: var(--swift-preprocessor) !important;
}

/* Project-specific elements */
@media (prefers-color-scheme: dark) {
  html:not([data-mode]) .language-swift .class-name,
  html[data-mode='dark'] .language-swift .class-name {
    color: var(--swift-project-class) !important;
  }

  html:not([data-mode]) .language-swift .function,
  html[data-mode='dark'] .language-swift .function {
    color: var(--swift-project-function) !important;
  }

  html:not([data-mode]) .language-swift .constant,
  html[data-mode='dark'] .language-swift .constant {
    color: var(--swift-project-constant) !important;
  }

  html:not([data-mode]) .language-swift .property,
  html[data-mode='dark'] .language-swift .property {
    color: var(--swift-project-property) !important;
  }
}

html[data-mode='dark'] .language-swift .class-name {
  color: var(--swift-project-class) !important;
}

html[data-mode='dark'] .language-swift .function {
  color: var(--swift-project-function) !important;
}

html[data-mode='dark'] .language-swift .constant {
  color: var(--swift-project-constant) !important;
}

html[data-mode='dark'] .language-swift .property {
  color: var(--swift-project-property) !important;
}

/* Other elements */
@media (prefers-color-scheme: dark) {
  html:not([data-mode]) .language-swift .other-class,
  html[data-mode='dark'] .language-swift .other-class {
    color: var(--swift-other-class) !important;
  }

  html:not([data-mode]) .language-swift .other-function,
  html[data-mode='dark'] .language-swift .other-function {
    color: var(--swift-other-function) !important;
  }

  html:not([data-mode]) .language-swift .other-constant,
  html[data-mode='dark'] .language-swift .other-constant {
    color: var(--swift-other-constant) !important;
  }

  html:not([data-mode]) .language-swift .other-property,
  html[data-mode='dark'] .language-swift .other-property {
    color: var(--swift-other-property) !important;
  }
}

html[data-mode='dark'] .language-swift .other-class {
  color: var(--swift-other-class) !important;
}

html[data-mode='dark'] .language-swift .other-function {
  color: var(--swift-other-function) !important;
}

html[data-mode='dark'] .language-swift .other-constant {
  color: var(--swift-other-constant) !important;
}

html[data-mode='dark'] .language-swift .other-property {
  color: var(--swift-other-property) !important;
}

/* Additional styles for better visibility */
@media (prefers-color-scheme: dark) {
  html:not([data-mode]) .language-swift .highlight,
  html[data-mode='dark'] .language-swift .highlight {
    padding: 1em;
    border-radius: 6px;
    margin: 1em 0;
  }
}

html[data-mode='dark'] .language-swift .highlight {
  padding: 1em;
  border-radius: 6px;
  margin: 1em 0;
}
