body {
  margin: 0;
  padding: 0;
  font-family: sans-serif;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 100vh;
  background-color: #f0f0f0;
}
#mainContainer {
  display: flex;
  flex-direction: row;
  width: 100%;
  flex-grow: 1;
}
#configPanel {
  margin: 20px;
  padding: 20px;
  border: 1px solid #888;
  background-color: #fff;
  width: 250px;
  flex-shrink: 0;
}
#simGraphContainer {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  margin: 20px;
  gap: 20px;
}
#simulationContainer {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #fff;
  border: 1px solid #888;
  min-height: 500px;
  position: relative;
  padding: 10px;
  box-sizing: border-box;
}
#simulationCanvas {
  border: 1px solid #333;
  background-color: #fff;
  display: block;
  cursor: pointer;
}
#painLegend {
  width: 502px;
  margin-top: 10px;
}
#painLegendCanvas {
  width: 502px;
  height: 40px;
  display: block;
  border: 1px solid #333;
  background-color: #f9f9f9;
  box-sizing: border-box;
}
#graphContainer {
  min-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border: 1px solid #888;
  padding: 10px;
  position: relative;
  box-sizing: border-box;
}
#distanceCanvas, #painStateCanvas, #rewardCanvas {
  border: 1px solid #333;
  background-color: #fff;
  display: block;
  margin-bottom: 10px;
  margin-top: 12px;
  width: 500px;
  height: 200px;
}
button {
  margin: 5px;
  padding: 8px 12px;
  font-size: 16px;
  cursor: pointer;
}
#startBtn, #downloadCSV, #configureAgentsBtn {
  background-color: #4fc3f7;
  color: white;
  border: none;
  border-radius: 4px;
  transition: background-color 0.2s;
}
#startBtn:hover, #downloadCSV:hover, #configureAgentsBtn:hover {
  background-color: #0288d1;
}
#startBtn {
  min-width: 120px;
  text-align: center;
}
label {
  display: block;
  margin-bottom: 10px;
  text-align: left;
}
select, input[type="number"] {
  width: 100%;
  padding: 5px;
  margin-bottom: 10px;
  border: 1px solid #888;
  border-radius: 4px;
}
#agentParamsTable {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background-color: #f9f9f9;
  font-size: 12.5px;
  max-height: 200px;
  overflow-y: auto;
  overflow-x: auto;
  display: block;
  table-layout: fixed;
}
#agentParamsTable::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
#agentParamsTable::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 2px;
}
#agentParamsTable::-webkit-scrollbar-track {
  background: #f1f1f1;
}
#agentParamsTable th, #agentParamsTable td {
  border: 1px solid #888;
  padding: 8px;
  text-align: center;
  width: 25%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#rewardTable {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background-color: #f9f9f9;
  font-size: 14px;
  table-layout: fixed;
}
#rewardTable th, #rewardTable td {
  border: 1px solid #888;
  padding: 8px;
  text-align: center;
  width: 30%;
}
#rewardTable th, #agentParamsTable th {
  background-color: #ddd;
}
#iterationStatusTable {
  width: 502px;
  border-collapse: collapse;
  margin-top: 10px;
  background-color: #f9f9f9;
  font-size: 14px;
  max-height: 100px;
  overflow-y: auto;
  display: block;
  table-layout: fixed;
}
#iterationStatusTable th, #iterationStatusTable td {
  border: 1px solid #888;
  padding: 8px;
  text-align: center;
}
#iterationStatusTable th:nth-child(1), #iterationStatusTable td:nth-child(1) {
  width: 20%;
}
#iterationStatusTable th:nth-child(2), #iterationStatusTable td:nth-child(2) {
  width: 40%;
}
#iterationStatusTable th:nth-child(3), #iterationStatusTable td:nth-child(3) {
  width: 20%;
}
#iterationStatusTable th:nth-child(4), #iterationStatusTable td:nth-child(4) {
  width: 20%;
}
#iterationStatusTable::-webkit-scrollbar {
  width: 4px;
}
#iterationStatusTable::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 2px;
}
#iterationStatusTable::-webkit-scrollbar-track {
  background: #f1f1f1;
}
.hidden {
  display: none;
}
#agentParamsPopup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fff;
  padding: 20px;
  border: 1px solid #888;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  z-index: 1000;
  width: 450px;
  max-height: 80vh;
  overflow-y: auto;
}
#graphPopup, #simulationCompletePopup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fff;
  padding: 20px;
  border: 1px solid #888;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  z-index: 1000;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
}
#graphPopup {
  width: 850px;
}
#graphPopup h3, #simulationCompletePopup h3 {
  margin-top: 0;
}
#closeAgentParamsPopup, #saveAgentParams, #closeGraphPopup, #closeSimulationPopup, #graphPopupDownload {
  position: absolute;
  top: 15px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #888;
}
#closeAgentParamsPopup, #closeGraphPopup, #closeSimulationPopup {
  right: 10px;
}
#saveAgentParams, #graphPopupDownload {
  right: 35px;
}
#closeAgentParamsPopup:hover, #saveAgentParams:hover, #closeGraphPopup:hover, #closeSimulationPopup:hover, #graphPopupDownload:hover {
  color: #333;
}
#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  z-index: 999;
  display: none;
}
#progress {
  margin-top: 10px;
  font-size: 14px;
  color: #333;
}
.icon {
  position: absolute;
  top: 10px;
  width: 20px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.7;
  padding: 0;
}
#distanceZoom {
  right: 50px;
}
#distanceDownload {
  right: 25px;
}
#painStateZoom {
  top: 220px;
  right: 50px;
}
#painStateDownload {
  top: 220px;
  right: 25px;
}
#rewardZoom {
  top: 430px;
  right: 50px;
}
#rewardDownload {
  top: 430px;
  right: 25px;
}
.icon:hover {
  opacity: 1;
  transform: scale(1.1);
}
.download-icon svg, .zoom-in-icon svg {
  width: 100%;
  height: 100%;
  fill: #333;
}
@media (max-width: 1200px) {
  #mainContainer {
    flex-direction: column;
  }
  #configPanel {
    width: 100%;
    box-sizing: border-box;
  }
  #simGraphContainer {
    width: 100%;
    margin: 20px 0;
  }
  #simulationContainer, #graphContainer {
    min-width: 100%;
  }
}