/* Modul-Spezialoptik 140_polynomiale_regression (aus sample3.html) — Rest deckt assets/css/style.css ab */

/* Architektur-Visualisierung: Netzwerk-Diagramm mit Layern/Neuronen */
.architecture-viz {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  margin: 2rem 0;
  border: 2px solid #0047AB;
}

.network-diagram {
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 2rem 0;
  padding: 2rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.layer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.neuron {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0047AB 0%, #003d99 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0,71,171,0.3);
}

.neuron.hidden {
  background: linear-gradient(135deg, #DC143C 0%, #b01030 100%);
  width: 50px;
  height: 50px;
  font-size: 0.85rem;
}

.neuron.neuron-out {
  background: linear-gradient(135deg, #28a745 0%, #218838 100%);
}

.layer-label {
  font-weight: 600;
  color: #0047AB;
  margin-top: 0.5rem;
}

.arrow {
  font-size: 2rem;
  color: #DC143C;
}

/* Training vs. Inferenz: Schritt-Boxen */
.training-steps {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  margin: 2rem 0;
  border: 2px solid #DC143C;
}

.step-box {
  min-width: 0;
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  margin: 1rem 0;
  border-left: 4px solid #0047AB;
}

.step-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #DC143C;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  flex-shrink: 0;
}

.step-title {
  color: #0047AB;
  font-weight: 600;
  font-size: 1.1rem;
}

/* Trainieren-Button: deaktiviert waehrend des Trainings (style.css kennt nur .btn-erfolg[disabled]) */
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Fortschrittsbalken beim Training (IDs wie im Markup: moduleProgress*) */
#moduleProgressContainer {
  margin-top: 1rem;
  background-color: #e9ecef;
  border-radius: 0.5rem;
  overflow: hidden;
  height: 30px;
  position: relative;
  display: none;
}

#moduleProgressBar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #0047AB 0%, #DC143C 100%);
  transition: width 0.3s ease;
}

#moduleProgressText {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 600;
  color: #333;
  text-shadow: 0 0 3px white;
}

.loss-display {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #666;
  font-family: 'Courier New', monospace;
}

/* Training vs. Inferenz: Vergleichs-Karten */
.comparison-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); /* minmax(0,..): Rechenzeilen duerfen die Spalte nicht aufblaehen */
  gap: 2rem;
  margin: 2rem 0;
}

.comparison-item {
  min-width: 0; /* Grid-Item darf schmaler werden als sein pre-Inhalt */
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  border: 3px solid #dee2e6;
}

.comparison-item.highlight {
  border-color: #28a745;
  background: #f0fff4;
}

.comparison-item h4 {
  color: #DC143C;
  margin-bottom: 1rem;
}

@media (max-width: 600px) {
  .comparison-box { grid-template-columns: minmax(0, 1fr); }
}

/* ===== Nachtrag 2026-09-02: Mobile-Optimierung + Rechenzeilen ===== */

/* Layer-Beschriftung unter den Neuronen (Desktop: Spalte, Handy: volle Zeile) */
.layer-meta{display:flex;flex-direction:column;align-items:center;gap:.15rem}
.layer-desc{font-size:.8rem;color:#666}
.neuron-dots{color:#DC143C;font-size:1.2rem;line-height:1}

/* Rechenzeilen: einzeilige Formeln/Vektoren — auf dem Handy scrollen statt umbrechen */
.rechenzeile{display:block;background:#fff;color:#DC143C;font-family:'Courier New',monospace;
  font-size:.88rem;line-height:1.7;padding:.5rem .7rem;border-radius:6px;margin-top:.5rem;
  border:1px solid #eee;overflow-x:auto;white-space:pre;-webkit-overflow-scrolling:touch}
.rechenzeile{max-width:100%}
.rechenzeile.blau{color:#0047AB}
.rechenzeile.gruen{color:#28a745}
.rechenzeile.grau{color:#555}

/* Handy: Diagramm stapeln (Layer untereinander, Neuronen nebeneinander), Pfeile drehen, Polster verkleinern */
@media (max-width:700px){
  .architecture-viz,.training-steps{padding:1.2rem .9rem}
  .network-diagram{flex-direction:column;padding:1rem .6rem;gap:.5rem}
  .layer{flex-direction:row;flex-wrap:wrap;justify-content:center;gap:.4rem}
  .layer-meta{flex-basis:100%;margin-top:.2rem}
  .arrow,.neuron-dots{transform:rotate(90deg)}
  .neuron{width:48px;height:48px}
  .neuron.hidden{width:42px;height:42px}
  .step-box{padding:1rem .8rem}
  .comparison-box{gap:1rem}
}
