body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

nav {
  display: flex;
  background: #2c3e50;
  flex-wrap: wrap;
}

nav a {
  color: white;
  text-decoration: none;
  padding: 12px 18px;
  font-weight: bold;
  flex-grow: 1;
  text-align: center;
  transition: background 0.3s;
}

nav a.active { background: #1abc9c; }
nav a:hover { background: #34495e; }

@media (max-width: 480px) {
  nav { flex-direction: column; }
  nav a { flex-grow: 0; }
}

.tab-content {
  display: none;
  padding: 1rem;
  min-height: 100vh;
  color: white;
  border-radius: 8px;
  margin: 1rem;
  overflow-x: auto;
  box-sizing: border-box;
}

#home { background: linear-gradient(135deg, #6a11cb, #2575fc); }
#ppp { background: linear-gradient(135deg, #a6f9c4, #3fe5ff); color: black; }
#glycolysis { background: linear-gradient(135deg, #ff9ee3, #93baff); color: black; }
#krebbs { background: linear-gradient(135deg, #ffa95e, #ff95e1); color: black; }
#about { background: linear-gradient(135deg, #18b43f, #cbf630); }

.controls { margin-top: 1rem; }

#toggleStudy {
  font-weight: bold;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

.mermaid-wrapper {
  text-align: center;
  margin: 1rem 0 2rem 0;
}

.mermaid-wrapper .mermaid {
  display: inline-block;
  width: 100%;
  max-width: 1000px;
  height: auto;
}

.diagram-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.diagram-header select,
.diagram-header button {
  padding: 0.3rem 0.6rem;
  font-size: 0.9rem;
}

/* --- Study Mode Styles --- */
.node.study-blur {
  filter: blur(3px);
  cursor: pointer;
  transition: filter 0.3s ease;
  touch-action: manipulation;
  pointer-events: all;
}

.node.study-hide rect,
.node.study-hide text,
.node.study-hide tspan,
.node.study-hide title {
  fill: transparent;
  pointer-events: all;
}

.node.revealed rect,
.node.revealed text,
.node.revealed tspan,
.node.revealed title {
  filter: none;
  fill: currentColor;
  pointer-events: auto;
}

/* temporary (hover) reveal controlled by JS */
.node.study-blur.hovering { filter: none !important; }

/* keep SVG children in sync */
g.node.study-blur.hovering rect,
g.node.study-blur.hovering text,
g.node.study-blur.hovering tspan {
  filter: none !important;
}

/* Desktop: allow real hover if you prefer (optional, but JS now controls hovering) */
@media (hover: hover) {
  /* you can keep a hover visual if desired, but JS 'hovering' has priority */
  .node.study-blur:hover { /* optional fallback */ }
}

/* Mobile / touch: don't rely on :hover transitions */
@media (hover: none) {
  .node.study-blur { transition: none; }
}

#modeSelect {
  background-color: #2c3e50;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 1rem;
  line-height: normal;
  cursor: pointer;
  vertical-align: middle;
}
#modeSelect option {
  background-color: white;
  color: black;
  line-height: normal;
}
