:root {
  /* Modern Dark Palette Variables */
  --unvisited-color: #23272e;
  --visited-color: #3e4451;
  --start-color: #98c379;
  --end-color: #e06c75;
  --obstacle-color: #181a1f;
  --highlight-color: #61afef;
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: rgb(0, 0, 0);
  color: white;
}

* {
  font-family: "Courier New", Courier, monospace;
  box-sizing: border-box;
}

canvas {
  display: block;
}

.title {
  font-size: 2rem;
}

.heading {
  margin-top: 10px;
  padding: 1px 10px;
}

.section {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  height: 95vh;
}

#canvasContainer {
  width: 60%;
  height: 100%;
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

#controls {
  width: 20%;
  min-width: 220px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1;
}

/* -------------------------
   SLEEK STANDARD BUTTONS
   ------------------------- */
#controls > button {
  background-color: #2c313c;
  color: #abb2bf;
  border: 1px solid #3e4451;
  padding: 8px 12px;
  min-width: 90px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: bold;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

#controls > button:hover {
  background-color: #3e4451;
  color: #ffffff;
  border-color: var(--highlight-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

#controls > button:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  background-color: #23272e;
  border-color: #3e4451;
}

/* -------------------------
   SEGMENTED MODE BUTTONS
   ------------------------- */
#modeGroup {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  border-radius: 6px;
  overflow: hidden; /* Keeps the rounded corners clean */
  border: 1px solid #3e4451;
}

#modeGroup button {
  flex-grow: 1;
  padding: 8px 8px;
  border-radius: 0;
  border: none;
  border-right: 1px solid #3e4451;
  background-color: #2c313c;
  color: #abb2bf;
  cursor: pointer;
  margin: 0;
  font-size: 0.85rem;
  font-weight: bold;
  transition: all 0.2s ease;
}

#modeGroup button:last-child {
  border-right: none;
}

#modeGroup button:hover {
  background-color: #3e4451;
  color: white;
}

/* Active State Colors for Modes */
#obstacle.activeMode {
  background-color: var(--obstacle-color);
  color: white;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5); /* Makes it look pressed in */
}

#start.activeMode {
  background-color: var(--start-color);
  color: black;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

#end.activeMode {
  background-color: var(--end-color);
  color: black;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

.activeMode {
  background-color: var(--highlight-color);
  color: black;
}

/* -------------------------
   CYBER CHECKBOXES
   ------------------------- */

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background-color: #23272e;
  border: 2px solid #3e4451;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  margin: 0;
}
label > span {
  margin-left: 5px;
}
input[type="checkbox"]:hover {
  border-color: var(--highlight-color);
  box-shadow: 0 0 8px rgba(97, 175, 239, 0.3); /* Subtle blue glow */
}

input[type="checkbox"]:checked {
  background-color: var(--highlight-color);
  border-color: var(--highlight-color);
  box-shadow: 0 0 8px rgba(97, 175, 239, 0.5); /* Stronger glow when active */
}

/* Drawing the custom checkmark using CSS */
input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #181a1f; /* Dark colored checkmark */
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* -------------------------
   MISC STYLES
   ------------------------- */
#controls p {
  margin: 0;
  padding: 0;
  color: #abb2bf;
  font-size: 0.9rem;
}

footer {
  text-align: center;
  padding: 16px;
  font-size: 14px;
  color: #5c6370;
}

footer a {
  color: var(--highlight-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

footer a:hover {
  color: white;
}

@media (max-width: 720px) {
  .section {
    flex-direction: column;
    height: auto;
  }
  #canvasContainer {
    width: 100%;
    height: auto;
  }
  #controls {
    width: 100%;
  }
}
