:root {
  --page-padding: clamp(16px, 2vw, 32px);
  --panel-radius: 16px;
  --panel-shadow: 0 10px 28px rgba(15, 40, 70, 0.15);
  --info-accent: #0a365c;
  --instruction-bg: #f1f5f9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: #0c1421;
  background: aliceblue;
  min-height: 100vh;
}

.microsim-shell {
  padding: var(--page-padding);
}

.microsim-title {
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  margin: 0 0 0.25rem;
}

.microsim-subtitle {
  font-size: 1rem;
  color: #35516d;
  margin: 0 0 1.25rem;
}

.canvas {
  display: flex;
  flex-wrap: nowrap;
  gap: 20px;
  align-items: stretch;
}

/* workflow diagram on the left side */
.diagram-panel {
  flex: 0 0 30%;
  min-width: 230px;
  min-height: 420px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--panel-radius);
  /* what are these ? top, right, bottom left */
  padding: 12px 0 12px 12px;
  box-shadow: var(--panel-shadow);
}

.mermaid {
  width: 100%;
  height: 100%;
  font-size: 18px;
}

.diagram-panel .mermaid svg {
  display: block;
  margin: 0 !important;
}

/* right side information panel */
.info-panel {
  flex: 1 0 70%;
  min-width: 260px;
  background: #ffffff;
  border-radius: var(--panel-radius);
  box-shadow: var(--panel-shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.info-panel h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--info-accent);
}

.info-panel h2 span {
  font-weight: 400;
  color: #4c6278;
}

.info-panel .instructions {
  background: var(--instruction-bg);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.95rem;
  color: #3b4a5c;
}

.info-panel.details-active h2,
.info-panel.details-active .instructions {
  display: none;
}

#info-display {
  flex: 1;
  border: 1px dashed #c2d1e1;
  border-radius: 12px;
  padding: 16px;
  font-size: 1rem;
  line-height: 1.5;
  color: #132033;
}

.info-title {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--info-accent);
}

.info-content p {
  margin: 0 0 0.75rem;
}

.info-content p:last-child {
  margin-bottom: 0;
}

.tooltip-hint {
  font-size: 0.85rem;
  color: #6d7c8f;
}

.node.selected rect,
.node.selected polygon,
.node.selected path {
  stroke: #0c1421 !important;
  stroke-width: 4px !important;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
}

.node:hover rect,
.node:hover polygon,
.node:hover path {
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
}

/* allows us to change the CSS within each node */
.node foreignObject > div {
  padding: 4px !important;
}

/* Panels must stay side-by-side; enable horizontal scroll on tiny embeds */
.canvas {
  overflow-x: auto;
}
