* {
  font-family: monospace;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}
body {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

#sidebar {
  width: 20vw;
  height: 100%;
  background-color: #2c3e50;
  color: white;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}
body.light-mode #sidebar {
  background-color: #ecf0f1;
  color: black;
}

#sidebar button, #sidebar label {
  background-color: #34495e;
  color: white;
  border: none;
  padding: 10px;
  font-size: 14px;
  border-radius: 5px;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.3s;
}
body.light-mode #sidebar button,
body.light-mode #sidebar label {
  background-color: #bdc3c7;
  color: black;
}

#sidebar button:hover {
  background-color: #3e5871;
}
#sidebar button.active {
  background-color: #1abc9c;
}
body.light-mode #sidebar button:hover {
  background-color: #aab7b8;
}
body.light-mode #sidebar button.active {
  background-color: #3498db;
}

#main {
  background-color: #888;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px;
}
body.light-mode #main {
  background-color: white;
}

#weightDisplay {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
}

#grid {
  display: grid;
  grid-template-columns: repeat(50, 15px);
  grid-template-rows: repeat(50, 15px);
  gap: 1px;
  background-color: #666;
  border: 1px solid #555;
}
body.light-mode #grid {
  background-color: #ddd;
  border: 1px solid #ccc;
}

footer {
  width: 100%;
  padding: 10px;
  text-align: center;
  color: white;
  background-color: #888;
}
body.light-mode footer {
  background-color: white;
  color: black;
}

.cell {
  width: 15px;
  height: 15px;
  background-color: #888;
  border: 1px solid #777;
  position: relative;
  overflow: hidden;
}
body.light-mode .cell {
  background-color: white;
  border: 1px solid #eee;
}

#app {
  display: flex;
  flex: 1;
}

#modeSwitch {
  font-size: 10px;
  padding: 6px 8px;
  align-self: flex-start;
}

#themeToggle {
  cursor: pointer;
  font-size: 18px;
  align-self: flex-end;
  transition: transform 0.3s ease, opacity 0.3s ease, left 0.3s ease, top 0.3s ease;
  position: relative;
}

#rowsInput {
  width: 60px;
}

#colsInput {
  width: 60px;
}

#weightInput {
  width: 60px;
}

.cell > div {
  display: none;
}
.cell.start { background-color: green !important; }
.cell.end { background-color: red !important; }
.cell.wall { background-color: black !important; }
.cell.visited { background-color: lightblue !important; }
.cell.path { background-color: yellow !important; }


#openMap {
  background-color: #777;
  border: 1px solid #666;
}
body.light-mode #openMap {
  background-color: #ddd;
  border: 1px solid #ccc;
}
#openWeightDisplay {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
}

#topBar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#infoButton {
  background-color: #34495e;
  color: white;
  border: none;
  padding: 6px 10px;
  font-size: 14px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}
#infoButton:hover {
  background-color: #3e5871;
}
body.light-mode #infoButton {
  background-color: #bdc3c7;
  color: black;
}
body.light-mode #infoButton:hover {
  background-color: #aab7b8;
}

#infoPanel {
  position: fixed;
  top: 60px;
  left: 22vw;
  width: 300px;
  background-color: #2c3e50;
  color: white;
  border-radius: 10px;
  padding: 20px;
  z-index: 1000;
  box-shadow: 0 0 10px rgba(0,0,0,0.4);
  transition: opacity 0.3s ease;
}
body.light-mode #infoPanel {
  background-color: #ecf0f1;
  color: black;
}

#infoPanel.hidden {
  display: none;
}

#infoPanel #closeInfo {
  position: absolute;
  top: 8px;
  right: 10px;
  background: transparent;
  color: inherit;
  border: none;
  font-size: 16px;
  cursor: pointer;
}

