/* ==========================================================================
   NEURON // CYBER-VAULT & 3D KNOWLEDGE MATRIX
   Interactive Force-Directed Graph & Markdown Reading Engine
   ========================================================================== */

:root {
  --neon-cyan: #00f0ff;
  --neon-violet: #b026ff;
  --neon-green: #00ffaa;
  --neon-amber: #ffaa00;

  --vault-bg: #04070d;
  --vault-panel: rgba(8, 14, 24, 0.82);
  --vault-card: rgba(14, 22, 36, 0.7);
  --vault-border: rgba(0, 240, 255, 0.2);
  --vault-border-bright: rgba(0, 240, 255, 0.6);

  --text-main: #d8e8f5;
  --text-muted: #648099;
  --text-bright: #ffffff;

  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-sans: 'Inter', -apple-system, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--vault-bg);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
}

/* Background Cyber Matrix Grid */
.vault-bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(0, 240, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  z-index: 0;
}

.vault-shell {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- 1. Top Ribbon ---------- */
.vault-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  background: var(--vault-panel);
  border-bottom: 1px solid var(--vault-border);
  backdrop-filter: blur(14px);
  z-index: 20;
}

.vault-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vault-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid var(--vault-border);
  color: var(--neon-cyan);
  text-decoration: none;
  font-size: 11px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.vault-back-link:hover {
  background: rgba(0, 240, 255, 0.2);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
  transform: translateX(-2px);
}

.vault-title-block h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.vault-badge {
  font-size: 9.5px;
  padding: 2px 6px;
  background: rgba(0, 240, 255, 0.14);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  border-radius: 3px;
}

.vault-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(14, 22, 36, 0.8);
  border: 1px solid var(--vault-border);
  border-radius: 4px;
  padding: 5px 12px;
  width: 260px;
}

.vault-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: inherit;
  font-size: 11.5px;
  width: 100%;
}
.vault-search-input::placeholder {
  color: var(--text-muted);
}

/* ---------- 2. Split Workspace (Graph Left + Markdown Right) ---------- */
.vault-workspace {
  display: grid;
  grid-template-columns: 55% 45%;
  flex: 1;
  min-height: 0;
  position: relative;
}

/* Left: Interactive 3D Force Graph Stage */
.vault-graph-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-right: 1px solid var(--vault-border);
  background: radial-gradient(circle at 50% 50%, rgba(8, 16, 28, 0.4) 0%, rgba(3, 6, 12, 0.95) 100%);
}

#graphCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
}
#graphCanvas:active {
  cursor: grabbing;
}

.vault-graph-hint {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 15;
  font-size: 10.5px;
  color: var(--text-muted);
  background: var(--vault-panel);
  border: 1px solid var(--vault-border);
  padding: 5px 10px;
  border-radius: 4px;
  backdrop-filter: blur(10px);
  pointer-events: none;
}

/* Right: Markdown Document Viewport */
.vault-doc-deck {
  display: flex;
  flex-direction: column;
  background: var(--vault-panel);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.vault-doc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--vault-border);
  background: rgba(14, 22, 36, 0.7);
  font-size: 11px;
}

.vault-doc-filename {
  color: var(--neon-cyan);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.vault-doc-tabs {
  display: flex;
  gap: 6px;
}

.vault-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  transition: all 0.15s ease;
}

.vault-tab-btn.active,
.vault-tab-btn:hover {
  border-color: var(--vault-border);
  color: #fff;
  background: rgba(0, 240, 255, 0.1);
}

/* Markdown Reader / Editor Body */
.vault-doc-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

/* Rendered Markdown Styling */
.vault-markdown-view {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.68;
  color: var(--text-main);
  max-width: 68ch;
}

.vault-markdown-view h1 {
  font-size: 1.7rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--vault-border);
}

.vault-markdown-view h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--neon-cyan);
  margin-top: 24px;
  margin-bottom: 8px;
}

.vault-markdown-view h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin-top: 18px;
  margin-bottom: 6px;
}

.vault-markdown-view p {
  margin-bottom: 14px;
}

.vault-markdown-view ul,
.vault-markdown-view ol {
  margin-left: 20px;
  margin-bottom: 14px;
}

.vault-markdown-view li {
  margin-bottom: 4px;
}

.vault-markdown-view pre {
  background: #020509;
  border: 1px solid var(--vault-border);
  border-radius: 6px;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #a8d9ff;
  overflow-x: auto;
  margin: 16px 0;
}

.vault-markdown-view code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(0, 240, 255, 0.1);
  color: var(--neon-cyan);
  padding: 2px 5px;
  border-radius: 3px;
}

.vault-markdown-view blockquote {
  border-left: 3px solid var(--neon-cyan);
  background: rgba(0, 240, 255, 0.05);
  padding: 10px 14px;
  border-radius: 0 4px 4px 0;
  margin: 14px 0;
  color: #b8d4ea;
}

/* Markdown Raw Editor Mode */
.vault-editor-textarea {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #92d4f5;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  resize: none;
  display: none;
}
.vault-editor-textarea.active {
  display: block;
}

/* Responsive */
@media (max-width: 900px) {
  .vault-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: 45vh 55vh;
  }
}

