/* ==========================================================================
   8. GRAPH CANVAS & STATUS
   ========================================================================== */

#graphCanvas {
  position: relative;
  width: 100%;
  height: calc(100vh - 58px);
  background:
    linear-gradient(rgba(56, 189, 248, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.035) 1px, transparent 1px),
    radial-gradient(circle at center, rgba(56, 189, 248, 0.10), transparent 55%),
    var(--bg-base);
  background-size: 42px 42px, 42px 42px, auto, auto;
  overflow: hidden;
}

/* Top Right HUD Label */
#graphCanvas::before {
  content: "MOLECULAR GRAPH INTERFACE";
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 2;
  padding: 7px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--accent-primary);
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(234, 179, 8, 0.25);
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.25), inset 0 0 10px rgba(234, 179, 8, 0.08);
  pointer-events: none;
}

/* Vignette overlay */
#graphCanvas::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(56, 189, 248, 0.04), transparent 18%, transparent 82%, rgba(167, 139, 250, 0.05));
  box-shadow: inset 0 0 45px rgba(56, 189, 248, 0.08), inset 0 0 90px rgba(2, 6, 23, 0.8);
}

/* vis-network canvas layer */
#graphCanvas canvas {
  position: relative;
  z-index: 1;
}

/* Status Terminal Output */
#status {
  min-height: 1.5em;
  margin-top: 14px;
  color: var(--accent-success);
  font-size: 12px;
  font-family: var(--font-mono);
  line-height: 1.5;
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.35);
}
#status::before { content: ">_ "; animation: blinkCursor 1s step-end infinite; }


/* ==========================================================================
   10. ANIMATIONS & KEYFRAMES
   ========================================================================== */

@keyframes moleculePanelScan { from { left: -100%; } to { left: 100%; } }
@keyframes moleculePulseLine { 0% { opacity: 0.55; width: 70px; } 50% { opacity: 1; width: 125px; } 100% { opacity: 0.55; width: 70px; } }
@keyframes blinkCursor { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes cursorOrbitA { from { transform: rotate(25deg) scaleX(1.25); } to { transform: rotate(385deg) scaleX(1.25); } }
@keyframes cursorOrbitB { from { transform: rotate(-65deg) scaleX(1.25); } to { transform: rotate(-425deg) scaleX(1.25); } }
@keyframes moleculeTrailFade { from { opacity: 0.8; transform: translate(-50%, -50%) scale(1); } to { opacity: 0; transform: translate(-50%, -50%) scale(0); } }


/* ==========================================================================
   11. SCROLLBARS & RESPONSIVE DESIGN
   ========================================================================== */

.molecule-panel::-webkit-scrollbar { width: 8px; }
.molecule-panel::-webkit-scrollbar-track { background: rgba(2, 6, 23, 0.8); }
.molecule-panel::-webkit-scrollbar-thumb { background: rgba(234, 179, 8, 0.35); border-radius: 10px; border: 1px solid rgba(234, 179, 8, 0.5); }
.molecule-panel::-webkit-scrollbar-thumb:hover { background: rgba(234, 179, 8, 0.65); }

@media (max-width: 1050px) {
  body.molecule-editor-page {
    grid-template-columns: 260px 1fr;
  }
  .right-panel {
    position: fixed;
    right: 16px;
    top: 90px;
    width: 230px;
    height: auto;
    max-height: calc(100vh - 120px);
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 16px;
  }
}

@media (max-width: 760px) {
  body.molecule-editor-page {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .left-panel {
    height: auto;
    max-height: 42vh;
    border-right: none;
    border-bottom: 1px solid rgba(56, 189, 248, 0.22);
  }
  .right-panel {
    display: none;
  }
  #graphCanvas {
    height: 58vh;
  }
}

@media (pointer: coarse) {
  #molecule-cursor, .molecule-cursor-trail { display: none; }
}
