/* NexGen Group - Modern Engineering Design System */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-primary: #090d11;
  --bg-secondary: #0d1318;
  --bg-card: #121921;
  --bg-card-hover: #16202b;
  --accent-emerald: #10b981;
  --accent-emerald-dim: #059669;
  --accent-mint: #34d399;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-emerald: rgba(16, 185, 129, 0.25);
  --border-emerald-bright: rgba(52, 211, 153, 0.5);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.font-mono-code {
  font-family: 'Fira Code', monospace;
}

/* Subtle Architectural Grid */
.cyber-grid {
  background-size: 48px 48px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
}

/* Clean Depth Elevation */
.card-depth {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.card-depth:hover {
  border-color: var(--border-emerald);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 15px -3px rgba(16, 185, 129, 0.15);
}

/* Minimalist Badges */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.2rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-family: 'Fira Code', monospace;
  font-weight: 500;
  letter-spacing: 0.025em;
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--accent-mint);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #090d11;
}

::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Subtle Cursor Blink */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.cursor-blink {
  animation: blink 1.2s infinite;
}

/* Markdown Rendered Content Styling */
.markdown-content {
  color: #d1d5db;
  line-height: 1.8;
  font-size: 0.95rem;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4 {
  color: #ffffff;
  font-weight: 700;
  margin-top: 1.75em;
  margin-bottom: 0.75em;
  letter-spacing: -0.02em;
}

.markdown-content h1 {
  font-size: 1.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.5rem;
}

.markdown-content h2 {
  font-size: 1.35rem;
  color: #f3f4f6;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.35rem;
}

.markdown-content h3 {
  font-size: 1.15rem;
  color: #34d399;
}

.markdown-content p {
  margin-top: 1em;
  margin-bottom: 1em;
}

.markdown-content a {
  color: #10b981;
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.15s ease-in-out;
}

.markdown-content a:hover {
  color: #34d399;
}

.markdown-content img {
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 30px -6px rgba(0, 0, 0, 0.6);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  background-color: #06090d;
  cursor: zoom-in;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.markdown-content img:hover {
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 16px 35px -6px rgba(16, 185, 129, 0.15), 0 12px 30px -6px rgba(0, 0, 0, 0.7);
  transform: translateY(-2px);
}

.markdown-content p > em:only-child {
  display: block;
  font-size: 0.785rem;
  color: #94a3b8;
  text-align: center;
  margin-bottom: 2rem;
  font-family: 'Fira Code', monospace;
}

.markdown-content ul,
.markdown-content ol {
  margin-top: 1em;
  margin-bottom: 1em;
  padding-left: 1.5em;
}

.markdown-content ul {
  list-style-type: disc;
}

.markdown-content ol {
  list-style-type: decimal;
}

.markdown-content li {
  margin-top: 0.35em;
  margin-bottom: 0.35em;
}

.markdown-content blockquote {
  border-left: 3px solid #10b981;
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background-color: rgba(16, 185, 129, 0.06);
  border-radius: 0 0.5rem 0.5rem 0;
  color: #a7f3d0;
}

.markdown-content pre {
  background-color: #06090d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.markdown-content code {
  font-family: 'Fira Code', monospace;
  background-color: rgba(255, 255, 255, 0.06);
  color: #34d399;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.85em;
}

.markdown-content pre code {
  background-color: transparent;
  color: #e5e7eb;
  padding: 0;
  border-radius: 0;
  font-size: 0.85rem;
}

.markdown-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75rem 0;
  font-size: 0.875rem;
}

.markdown-content th,
.markdown-content td {
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem 1rem;
  text-align: left;
}

.markdown-content th {
  background-color: rgba(255, 255, 255, 0.04);
  color: #f3f4f6;
  font-weight: 600;
}

.markdown-content tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.015);
}

/* Code Window & Syntax Highlighting (Atom One Dark Theme) */
.code-window-container {
  background-color: #06090d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.875rem;
  margin: 1.75rem 0;
  overflow: hidden;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
}

.code-window-container pre {
  margin: 0 !important;
  padding: 1.25rem 1.25rem !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  overflow-x: auto;
}

.code-window-container code {
  font-family: 'Fira Code', monospace !important;
  font-size: 0.85rem !important;
  line-height: 1.65 !important;
  background: transparent !important;
  padding: 0 !important;
}

/* Highlight.js Styles (Atom One Dark Theme) */
.hljs {
  background: transparent !important;
  color: #abb2bf !important;
  padding: 0 !important;
}

.hljs-keyword, .hljs-selector-tag, .hljs-subst { color: #c678dd !important; font-weight: 600; }
.hljs-string, .hljs-title, .hljs-section, .hljs-attribute, .hljs-literal, .hljs-template-tag, .hljs-template-variable, .hljs-type, .hljs-addition { color: #98c379 !important; }
.hljs-comment, .hljs-quote, .hljs-deletion, .hljs-meta { color: #5c6370 !important; font-style: italic; }
.hljs-number, .hljs-symbol, .hljs-bullet, .hljs-link { color: #d19a66 !important; }
.hljs-title.function_, .hljs-function { color: #61afef !important; font-weight: 600; }
.hljs-built_in, .hljs-class .hljs-title { color: #e5c07b !important; }
.hljs-variable, .hljs-params, .hljs-attr { color: #e06c75 !important; }
.hljs-operator { color: #56b6c2 !important; }
.hljs-punctuation { color: #abb2bf !important; }

/* Pygments Syntax Highlighting (One-Dark Theme Fallback) */
.codehilite {
  position: relative;
  background-color: #06090d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  margin: 1.5rem 0;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.codehilite pre {
  margin: 0;
  padding: 1.25rem 1.25rem 1.25rem 1.25rem;
  overflow-x: auto;
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  background: transparent;
  border: none;
  box-shadow: none;
}

.codehilite code {
  font-family: 'Fira Code', monospace;
  background-color: transparent;
  color: #abb2bf;
  padding: 0;
  border-radius: 0;
}

.codehilite .k, .codehilite .kd, .codehilite .kn, .codehilite .kp, .codehilite .kr { color: #c678dd; font-weight: 600; }
.codehilite .kt, .codehilite .nc, .codehilite .nb, .codehilite .bp { color: #e5c07b; }
.codehilite .nf, .codehilite .fm { color: #61afef; font-weight: 600; }
.codehilite .nd { color: #61afef; }
.codehilite .s, .codehilite .s1, .codehilite .s2, .codehilite .sa, .codehilite .sb, .codehilite .sc, .codehilite .sd, .codehilite .se, .codehilite .sh, .codehilite .si, .codehilite .sx, .codehilite .sr, .codehilite .ss { color: #98c379; }
.codehilite .m, .codehilite .mb, .codehilite .mf, .codehilite .mh, .codehilite .mi, .codehilite .mo, .codehilite .il { color: #d19a66; }
.codehilite .o, .codehilite .ow { color: #56b6c2; }
.codehilite .c, .codehilite .ch, .codehilite .cm, .codehilite .c1, .codehilite .cs { color: #636d83; font-style: italic; }
.codehilite .na { color: #e06c75; }
.codehilite .nt { color: #e06c75; font-weight: 600; }
.codehilite .nv, .codehilite .vc, .codehilite .vg, .codehilite .vi, .codehilite .vm { color: #e06c75; }
.codehilite .gh { color: #abb2bf; font-weight: bold; }
.codehilite .gi { color: #98c379; }
.codehilite .gd { color: #e06c75; }

/* Table of Contents Styling */
.toc {
  font-family: 'Inter', sans-serif;
  font-size: 0.8125rem;
}

.toc ul {
  list-style: none !important;
  margin: 0 !important;
  padding-left: 0.75rem !important;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.toc > ul {
  padding-left: 0 !important;
  border-left: none !important;
}

.toc li {
  margin: 0.4rem 0 !important;
  line-height: 1.45;
}

.toc a {
  color: #94a3b8;
  text-decoration: none !important;
  display: block;
  padding: 0.15rem 0.25rem;
  border-radius: 0.25rem;
  transition: all 0.15s ease;
}

.toc a:hover {
  color: #34d399;
  background-color: rgba(16, 185, 129, 0.06);
}

/* Code block copy button */
.copy-code-btn {
  position: static !important;
  opacity: 1 !important;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.725rem;
  font-family: 'Fira Code', monospace;
  color: #94a3b8;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  line-height: 1;
}

.copy-code-btn:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.copy-code-btn.copied {
  color: #34d399 !important;
  background-color: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
}
