/* ── Biochemie-Flussdiagramm-Trainer: Spezifische Styles ── */

.biochemie-container {
  width: 100%;
  max-width: 1300px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.biochemie-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .biochemie-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

/* ──────────────────────────────────────────────────────────
   LEFT PANEL: Flowchart Workspace
   ────────────────────────────────────────────────────────── */

.workspace-box {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.clinical-banner {
  background: rgba(34, 211, 238, 0.04);
  border: 1.5px solid rgba(34, 211, 238, 0.15);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  position: relative;
  overflow: hidden;
}

.clinical-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--cyan);
}

.clinical-title {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--cyan);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.clinical-desc {
  font-size: 0.84rem;
  color: var(--text-primary);
  margin-top: 0.25rem;
  line-height: 1.5;
  font-weight: 500;
}

.clinical-goal-box {
  margin-top: 0.5rem;
  padding: 6px 10px;
  background: rgba(57, 255, 110, 0.04);
  border: 1px dashed rgba(57, 255, 110, 0.2);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--green-ekg);
}

/* Flowchart Board & Grid */
.flowchart-board {
  position: relative;
  width: 100%;
  min-height: 480px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Flex/Grid layout of nodes in the flowchart */
.flowchart-canvas {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem; /* Gap handles the connector arrow spaces */
  width: 100%;
  max-width: 600px;
}

/* Horizontal sub-chains or side inputs */
.flow-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
}

.flow-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

/* ──────────────────────────────────────────────────────────
   FLOWCHART NODES & DROPZONES
   ────────────────────────────────────────────────────────── */

.flow-node {
  min-width: 150px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  transition: all 0.25s cubic-bezier(0.2, 1, 0.2, 1);
}

.flow-node.fixed {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
}

/* Type categories - disabled for neutral difficulty */
/*
.flow-node.type-substrate {
  border-left: 4px solid var(--cyan);
}
.flow-node.type-enzyme {
  border-left: 4px solid var(--violet);
  background: rgba(24, 18, 48, 0.85);
}
.flow-node.type-regulator {
  border-left: 4px solid var(--orange);
  background: rgba(43, 27, 12, 0.85);
}
.flow-node.type-inhibitor {
  border-left: 4px solid var(--rose);
  background: rgba(48, 15, 24, 0.85);
}
*/

/* Dropzone styling */
.dropzone {
  min-width: 155px;
  height: 48px;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.01);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.25s cubic-bezier(0.2, 1, 0.2, 1);
  cursor: pointer;
}

.dropzone::before {
  content: '? ';
  font-weight: 800;
  opacity: 0.6;
}

.dropzone.drag-over {
  border-color: var(--cyan);
  background: rgba(34, 211, 238, 0.15);
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(34, 211, 238, 0.3);
}

/* Specific dropzones based on category - disabled for neutral difficulty */
/*
.dropzone.type-substrate { border-color: rgba(34, 211, 238, 0.3); color: rgba(34, 211, 238, 0.7); }
.dropzone.type-enzyme { border-color: rgba(167, 139, 250, 0.3); color: rgba(167, 139, 250, 0.7); }
.dropzone.type-regulator { border-color: rgba(251, 146, 96, 0.3); color: rgba(251, 146, 96, 0.7); }
.dropzone.type-inhibitor { border-color: rgba(244, 63, 94, 0.3); color: rgba(244, 63, 94, 0.7); }
*/

/* Dropped state */
.dropzone.filled {
  border-style: solid;
  border-width: 1.5px;
  background: rgba(15, 23, 42, 0.95);
  padding: 0 10px;
  animation: pop-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop-in {
  0% { transform: scale(0.9); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

.dropzone.filled .node-title {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.76rem;
}

/* ──────────────────────────────────────────────────────────
   FLOW CONNECTORS & ARROWS
   ────────────────────────────────────────────────────────── */

.flow-connector {
  width: 24px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.15);
  position: relative;
  z-index: 1;
}

.flow-connector.arrow-down svg {
  transform: rotate(90deg);
}

.flow-connector.arrow-side svg {
  transform: rotate(0deg);
}

/* Regulation link side branching line */
.branch-connector {
  position: relative;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  flex-grow: 1;
}

/* Allosteric input ports layout */
.regulator-ports {
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(0, 0, 0, 0.15);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.reg-label {
  font-size: 0.6rem;
  font-weight: 900;
  padding: 2px 4px;
  border-radius: 3px;
}
.reg-label.plus {
  background: rgba(57, 255, 110, 0.15);
  color: var(--green-ekg);
}
.reg-label.minus {
  background: rgba(244, 63, 94, 0.15);
  color: var(--rose);
}

/* Compartment separators */
.compartment-divider {
  width: 100%;
  text-align: center;
  border-top: 1.5px dashed rgba(255, 255, 255, 0.07);
  line-height: 0.1em;
  margin: 1.5rem 0 1rem;
}

.compartment-divider span {
  background: #0d1526;
  padding: 0 12px;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
}

/* ──────────────────────────────────────────────────────────
   RIGHT PANEL: Toolbox & Explanation
   ────────────────────────────────────────────────────────── */

.toolbox-box {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.toolbox-desc {
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.toolbox-pool {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  min-height: 180px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.5rem;
}

/* Draggable item cards */
.drag-card {
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: grab;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 6px;
}

.drag-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--cyan);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 4px 12px rgba(34, 211, 238, 0.2);
}

.drag-card:active {
  cursor: grabbing;
}

.drag-card.used {
  opacity: 0.15;
  cursor: not-allowed;
  pointer-events: none;
}

/* Node indicator dot inside cards - disabled for neutral difficulty */
/*
.drag-card-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.drag-card-dot.substrate { background: var(--cyan); }
.drag-card-dot.enzyme { background: var(--violet); }
.drag-card-dot.regulator { background: var(--orange); }
.drag-card-dot.inhibitor { background: var(--rose); }
*/

/* Action Buttons */
.biochem-action-buttons {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* ──────────────────────────────────────────────────────────
   VERIFICATION STATES & ANIMATIONS
   ────────────────────────────────────────────────────────── */

/* Validation glow effects on dropzones */
.dropzone.success {
  border-color: var(--green-ekg) !important;
  background: rgba(57, 255, 110, 0.1) !important;
  box-shadow: 0 0 12px rgba(57, 255, 110, 0.3) !important;
}

.dropzone.error {
  border-color: var(--rose) !important;
  background: rgba(244, 63, 94, 0.1) !important;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.3) !important;
  animation: shake-error 0.4s ease-in-out;
}

@keyframes shake-error {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* Pulse scroll animations for connections when solved */
.flowchart-board.solved .flow-connector svg {
  color: var(--green-ekg);
  filter: drop-shadow(0 0 4px rgba(57,255,110,0.5));
}

.flowchart-board.solved .flow-node {
  border-color: var(--green-ekg) !important;
  box-shadow: 0 0 14px rgba(57, 255, 110, 0.2) !important;
}

/* ──────────────────────────────────────────────────────────
   PHYSIOLOGICAL EXPLANATION BANNER
   ────────────────────────────────────────────────────────── */

.biochem-explanation {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.biochem-explanation-title {
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
}

.biochem-explanation-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-top: 0.6rem;
}

.high-yield-box {
  margin-top: 1rem;
  background: rgba(251, 146, 60, 0.03);
  border: 1px solid rgba(251, 146, 60, 0.12);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.high-yield-title {
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--orange);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 5px;
}

.high-yield-text {
  font-size: 0.78rem;
  color: var(--text-primary);
  margin-top: 0.3rem;
  line-height: 1.5;
}
