:root {
  --bg: #101318;
  --panel: #181d25;
  --text: #f2f5f8;
  --line: #343d4c;
}

#network-wrapper {
  width: 100%;
  position:relative;
  height: 710px;
}

#hint-box-container{
  position: fixed;
  top: 80px;
  right: 20px;
  max-width: 400px;
  z-index: 9999;
}

.hint-box {
  background: white;
  color: black;
  padding: 10px;
  border: 1px solid var(--text);
  border-radius: 5px;
  margin-bottom: 10px;
}

.hint-box.error {
  background: darkred;
  color: white;
}

#canvas-wrapper {
  max-width: 300px;
  aspect-ratio: 1 / 1;
  display: none;
}

#steps {
  font-size: 24px;
  text-align: center;
  padding: 20px;
}

.row {
  display: block;
  width: 100%;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;

}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  height: 100%;
}

body {
  width: 100%;
  height: 100%;
  margin: 0;
  font-family: math;
  //font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

img {
  max-width: 100%;
}

a {
  color: #648FFF;
}

a:visited {
  color: #FFB000;
}

svg text{
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  font-family: monospace;
}
.row.charts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chart-wrapper {
  border: 1px solid var(--text);
  padding: 10px;
  width: 100%;
}

.chart-title {
  font-size: 22px;
}

#lossChart_wrapper {
  display: block;
  max-height: 500px;
}

#layerLearningChart_wrapper {
  display: block;



}

#lossChart,
#layerLearningChart{
  max-height: 300px;
}



.network-controls {
  max-width: 300px;
}


.network-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.network-control-group {
  flex: 1;
  padding: 8px;
  border: 1px solid #ddd;
}

.network-control-group button, #nextImage {
  padding: 8px;
  background: #FFB000;
  cursor: pointer;
}

.control-title {
  font-weight: bold;
  margin: 0 0 5px;
}

.control-description {
  margin: 0 0 12px;
}

.target-control {
  margin-bottom: 12px;
}



.actionbar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  padding: 8px 16px;
  width: 100%;
  background-color: var(--panel);

  flex-direction: column;
}

#train {
  padding: 15px;
  border: 0;
  background: green;
  color: white;
  cursor: pointer;
}
#stop,
#reset {
  padding: 15px;
  border: 0;
  background: #dc267f;
  cursor: pointer;
  color: white;
}

.bar-entry {
  width: 100%;
}



.config-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-direction: column;
}

.config-wrapper input,
.config-wrapper select,
.config-wrapper .action-button{
  //min-width: 160px;
  width: 100%;
  padding: 4px 8px;
  border: 1px solid #bbb;
  border-radius: 5px;
  font: inherit;
}



.visualizer-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;

  //height: 600px;
  flex-direction: column;
}

circle:hover {
  cursor: pointer;
}

.equation-wrapper{
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.image-wrapper .equation-info {
  max-width: 300px;
}

.equation-info {
  font-family: math;
  font-size: 18px;
  text-align: center;
}


#equation, #linear, #sigmoid, #result {
  max-width: 100%;
  font-size: 18px;
}


html .app mjx-container {
  margin: 0;
}



#predictions {
  transform: translateX(-30px) translateY(-5px);
  padding-right: 8px;
  width: 10%;
  display: flex;
  flex-direction: column;
  gap: 40px;
  //font-family: sans-serif;
  font-size: 14px;
}



.prediction-row {
  display: grid;
  grid-template-columns: 24px 1fr 45px;
  align-items: center;
  gap: 6px;
}

.prediction-label {
  text-align: right;
}

.prediction-bar-bg {
  height: 14px;
  //background: #ddd;
  //border-radius: 4px;
  //overflow: hidden;
}

.prediction-bar-fill {
  height: 100%;
  width: 0;
  background: #4caf50;
  transition: width 120ms linear;
}

.prediction-value {
  text-align: right;
}

#close_neuron_details {
  position: absolute;
  cursor: pointer;
  top: 5px;
  right: 5px;
}

#info {
  position: absolute;
  display: none;
  background-color: var(--bg);
  padding: 5px;
  border: 1px solid var(--line);
  width: 300px;
  float: right;
  z-index: 9998;
}

.info-container {
  max-width: 1200px;
  padding: 20px 0;
  margin: 0 auto;
  text-align: center;
}


input[type="range"] {
  width: 100%;
}

/* Help Dialog */

.help-dialog {
  width: 500px;
  padding: 20px;

  border: 1px solid #777;
  background: white;
  color: black;
}

.help-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.help-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.help-dialog-header h2 {
  margin: 0;
}

.dialog-close-button {
  border: none;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
}


.help-button.action-button {
  width: auto;
  height: auto;
  border: 0;
}

.help-button.rect {
  padding: 6px;
  border-radius: 0;
  width: auto;
  height: auto;
}

.help-button {

  border: none;

  width: 20px;
  height: 20px;
  padding: 0;

  border-radius: 50%;
  background: #FFB000;
  color: inherit;

  font-size: 14px;
  font-weight: 700;
  line-height: 1;

  cursor: pointer;
}

.help-button:hover {
  background: rgba(128, 128, 128, 0.15);
}

#network-stats-container {
  font-size: 18px;
}

#network-stats-accuracy {
  font-size: 22px;
  color: #FFB000;
}

#info button {
  display: block;
  margin-bottom: 5px;
}


#neuron_weights {
  display: grid;
  grid-template-columns: 50px 1fr;
}

#neuron_weights_header {
  margin: 0;
}
#neuron_weights label {
}

#neuron_weights input {

}

.click-info {
  position: absolute;
  top:38%;
  right:10px;
  color:black;
}


.equation-info.speech-bubble {
  position: relative;
  margin-bottom: 15px;
  color: black;
}

.speech-bubble {
  background: #ffffff;
  border: 2px solid #333;
  border-radius: 10px;
  padding: 12px 16px;
}

/* Speech bubble pointer */
.speech-bubble::after {
  content: "";
  position: absolute;

  left: 50%;
  bottom: -12px;
  transform: translateX(-50%);

  width: 0;
  height: 0;

  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 12px solid #ffffff;
}

@media (min-width: 768px) {
  .actionbar {
    flex-direction: row;
  }

  .bar-entry {
    padding: 20px;
  }

  .visualizer-wrapper {
    height: 710px;
    flex-direction: row;
  }

  .equation-info {
    font-size: 24px;
  }

  .equation-info.large {
    font-size: 34px;
  }

  #equation, #linear, #sigmoid, #result {
    font-size: 24px;
  }

  #network-wrapper {
    width: 65%;
  }

  .config-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .config-wrapper input,
  .config-wrapper select,
  .config-wrapper .action-button{

  }

  .row.charts {
    flex-direction: row;
  }

  .chart-wrapper {
    width: 50%;
  }

}


@media (min-width: 1024px) {

  .network-stats {
    max-width: 300px;
  }

  .config-wrapper {
    flex-direction: row;
  }

  .config-wrapper label{

    min-width: 160px;

  }
}