/* IntelliJ IDEA Darcula Theme for Code Preview */

/* Import JetBrains Mono font */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* Base styles for code blocks in preview */
.editor-content-preview .hljs.intellij-darcula-theme,
.editor-content-preview pre.hljs.intellij-darcula-theme,
.hljs.intellij-darcula-theme {
  background: #2b2b2b !important;
  color: #a9b7c6 !important;
  font-family: 'JetBrains Mono', 'Fira Mono', 'Consolas', 'Monaco', 'Courier New', monospace !important;
  padding: 1.5em !important;
  border-radius: 8px !important;
  line-height: 1.6 !important;
  border: 1px solid #3c3f41 !important;
  overflow-x: auto !important;
  white-space: pre !important;
  margin: 1em 0 !important;
  font-size: 14px !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
  position: relative !important;
}

/* Add a subtle glow effect */
.editor-content-preview .hljs.intellij-darcula-theme::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

/* Code token colors for IntelliJ IDEA Darcula */
.editor-content-preview .hljs.intellij-darcula-theme .hljs-keyword,
.editor-content-preview .hljs.intellij-darcula-theme .hljs-selector-tag,
.editor-content-preview .hljs.intellij-darcula-theme .hljs-meta-keyword,
.editor-content-preview .hljs.intellij-darcula-theme .hljs-doctag,
.editor-content-preview .hljs.intellij-darcula-theme .hljs-name,
.editor-content-preview .hljs.intellij-darcula-theme .hljs-selector-id,
.editor-content-preview .hljs.intellij-darcula-theme .hljs-selector-class,
.hljs.intellij-darcula-theme .hljs-keyword,
.hljs.intellij-darcula-theme .hljs-selector-tag,
.hljs.intellij-darcula-theme .hljs-meta-keyword,
.hljs.intellij-darcula-theme .hljs-doctag,
.hljs.intellij-darcula-theme .hljs-name,
.hljs.intellij-darcula-theme .hljs-selector-id,
.hljs.intellij-darcula-theme .hljs-selector-class {
  color: #cc7832 !important; /* Orange for keywords */
  font-weight: 600 !important;
}

.editor-content-preview .hljs.intellij-darcula-theme .hljs-string,
.editor-content-preview .hljs.intellij-darcula-theme .hljs-regexp,
.editor-content-preview .hljs.intellij-darcula-theme .hljs-meta-string,
.hljs.intellij-darcula-theme .hljs-string,
.hljs.intellij-darcula-theme .hljs-regexp,
.hljs.intellij-darcula-theme .hljs-meta-string {
  color: #6a8759 !important; /* Green for strings */
}

.editor-content-preview .hljs.intellij-darcula-theme .hljs-number,
.editor-content-preview .hljs.intellij-darcula-theme .hljs-literal,
.hljs.intellij-darcula-theme .hljs-number,
.hljs.intellij-darcula-theme .hljs-literal {
  color: #6897bb !important; /* Blue for numbers */
}

.editor-content-preview .hljs.intellij-darcula-theme .hljs-title,
.editor-content-preview .hljs.intellij-darcula-theme .hljs-section,
.editor-content-preview .hljs.intellij-darcula-theme .hljs-built_in,
.hljs.intellij-darcula-theme .hljs-title,
.hljs.intellij-darcula-theme .hljs-section,
.hljs.intellij-darcula-theme .hljs-built_in {
  color: #ffc66d !important; /* Yellow for functions */
}

.editor-content-preview .hljs.intellij-darcula-theme .hljs-variable,
.editor-content-preview .hljs.intellij-darcula-theme .hljs-template-variable,
.hljs.intellij-darcula-theme .hljs-variable,
.hljs.intellij-darcula-theme .hljs-template-variable {
  color: #a9b7c6 !important; /* Light gray for variables */
}

.editor-content-preview .hljs.intellij-darcula-theme .hljs-attr,
.editor-content-preview .hljs.intellij-darcula-theme .hljs-attribute,
.editor-content-preview .hljs.intellij-darcula-theme .hljs-class,
.hljs.intellij-darcula-theme .hljs-attr,
.hljs.intellij-darcula-theme .hljs-attribute,
.hljs.intellij-darcula-theme .hljs-class {
  color: #9876aa !important; /* Purple for properties */
}

.editor-content-preview .hljs.intellij-darcula-theme .hljs-tag,
.hljs.intellij-darcula-theme .hljs-tag {
  color: #e8bf6a !important; /* Gold for tags */
}

.editor-content-preview .hljs.intellij-darcula-theme .hljs-comment,
.editor-content-preview .hljs.intellij-darcula-theme .hljs-quote,
.hljs.intellij-darcula-theme .hljs-comment,
.hljs.intellij-darcula-theme .hljs-quote {
  color: #808080 !important; /* Gray for comments */
  font-style: italic !important;
}

.editor-content-preview .hljs.intellij-darcula-theme .hljs-punctuation,
.editor-content-preview .hljs.intellij-darcula-theme .hljs-operator,
.hljs.intellij-darcula-theme .hljs-punctuation,
.hljs.intellij-darcula-theme .hljs-operator {
  color: #cc7832 !important; /* Orange for punctuation */
}

/* Additional token types */
.editor-content-preview .hljs.intellij-darcula-theme .hljs-link {
  color: #287bde !important; /* Blue for URLs */
  text-decoration: underline !important;
}

.editor-content-preview .hljs.intellij-darcula-theme .hljs-addition {
  color: #6a8759 !important; /* Green for additions */
  background-color: rgba(106, 135, 89, 0.1) !important;
}

.editor-content-preview .hljs.intellij-darcula-theme .hljs-deletion {
  color: #cc7832 !important; /* Orange for deletions */
  background-color: rgba(204, 120, 50, 0.1) !important;
}

.editor-content-preview .hljs.intellij-darcula-theme .hljs-emphasis {
  font-style: italic !important;
}

.editor-content-preview .hljs.intellij-darcula-theme .hljs-strong {
  font-weight: bold !important;
}

/* Scrollbar styling for code blocks */
.editor-content-preview .hljs.intellij-darcula-theme::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.editor-content-preview .hljs.intellij-darcula-theme::-webkit-scrollbar-track {
  background: #2b2b2b;
  border-radius: 4px;
}

.editor-content-preview .hljs.intellij-darcula-theme::-webkit-scrollbar-thumb {
  background: #4a5568;
  border-radius: 4px;
}

.editor-content-preview .hljs.intellij-darcula-theme::-webkit-scrollbar-thumb:hover {
  background: #5a6a7a;
}

/* Language indicator */
.editor-content-preview .hljs.intellij-darcula-theme::after {
  content: attr(data-language);
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 11px;
  color: #808080;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Inline code styling */
.editor-content-preview .editor-text-code {
  background: #f3f4f6 !important; /* gris très clair pour le mode light */
  color: #2b2b2b !important;      /* texte foncé pour le mode light */
  font-family: 'JetBrains Mono', 'Fira Mono', monospace !important;
  padding: 0.2em 0.4em !important;
  border-radius: 4px !important;
  font-size: 0.9em !important;
  border: 1px solid #d1d5db !important;
}

/* Dark mode compatibility */
.dark .editor-content-preview .hljs.intellij-darcula-theme {
  background: #2b2b2b !important;
  color: #a9b7c6 !important;
  border-color: #3c3f41 !important;
}

/* Light mode fallback */
.editor-content-preview .hljs.intellij-darcula-theme {
  background: #2b2b2b !important;
  color: #a9b7c6 !important;
  border-color: #3c3f41 !important;
}

/* Forcer la couleur du texte même si text-gray-900 est présent dans le HTML généré */
.editor-text-code .text-gray-900 {
  color: #2b2b2b !important;
}
.dark .editor-text-code .text-gray-900 {
  color: #a9b7c6 !important;
}

.hljs.intellij-darcula-theme, .hljs.intellij-darcula-theme * {
  color: #a9b7c6 !important;
} 