:root {
  --base-clr: #212121;
  --text-clr: #e6e6ef;
  --line-clr: #181818;
  --hover-clr: #7F8CAA;
  --active-clr: #0089d2;

  --settings-panel-clr: #727878;

  --checkbox-bg-unchecked: #d9d9d9;
  --checkbox-bg-checked: #0089d2;
  --checkbox-switch-clr: #ffffff;
}

* {
  margin: 0;
  padding: 0;
}

html {
  font-family: "Roboto", sans-serif;
  line-height: 1.rem;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--base-clr);
  color: var(--text-clr);
  display: grid;
  grid-template-columns: auto 1fr;
}

canvas {
  display: block;
  max-width: 100%;
}

#sidebar {
  box-sizing: border-box;
  /*height: calc(100vh - 60px);*/
  height: 100vh;
  /*margin-top: 60px;*/
  width: 60px;
  padding: 5px;
  background-color: var(--base-clr);
  border-right: 1px solid var(--line-clr);
}

#sidebar svg {
  flex-shrink: 0;
  fill: var(--text-clr);
}

#sidebar ul {
  list-style: none;
}

#sidebar ul li.active {
  color: var(--line-clr);

  svg {
    fill: var(--line-clr);
  }
}

#sidebar button {
  border-radius: .5em;
  padding: .85em;
  text-decoration: none;
  color: var(--text-clr);
  display: flex;
  align-items: center;
  gap: 1em;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
}

#sidebar button:hover {
  background-color: var(--hover-clr);
}

#sidebar button.active {
  background-color: var(--active-clr);
}

#sidebar .sub-menu {
  display: grid;
  grid-template-rows: 0fr;
  transition: 300ms ease-in-out;

  >div {
    overflow: hidden;
  }
}

#sidebar .sub-menu.show {
  grid-template-rows: 1fr;
}

.canvas-container {
  position: absolute;
  left: 60px;
  top: 0;
  right: 0;
  bottom: 0;
  background: white;
}

#cartesian-coordinate-system {
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.zoom-indicator {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 11px;
  z-index: 100;
}

.coordinate-display {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(44, 62, 80, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 12px;
  z-index: 100;
}

.canvas-controls {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  gap: 5px;
  z-index: 100;
}

.canvas-controls button {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ddd;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.2s ease;
}

.canvas-controls button:hover {
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.settings-container {
  position: fixed;
  background-color: var(--settings-panel-clr);
  padding: 2em;
  width: 80%;
  max-width: 550px;
  border-radius: 1rem;
  box-shadow: 0 12px 12px rgba(black, 0.15);
  z-index: 9999;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

header {
  color: var(--heading-clr);
  margin-bottom: 2rem;
}

.setting {
 margin: 2rem auto;
 color: var(--settings-info-clr);
 display: flex;
 justify-content: space-between;
 align-items: center;
 label {
  width: 80%;
  span {
    display: block;
    &:last-of-type {
      font-weight: 300;
    }
  }
 }
 input { 
  appearance: none;
  -webkit-appearance: none;
  width: 45px;
  height: 25px;
  border-radius: 25px;
  background-color: var(--checkbox-bg-unchecked);
  position: relative;
  transition: background-color .3s ease;
  &::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 30%;
    transform: translate(-50%, -50%);
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background-color: var(--checkbox-switch-clr);
    transition: left .3s ease;
  }
  &:checked {
    background-color: var(--checkbox-bg-checked);
    &::after {
      left: 70%;
    }
  }
 }
}

.settings-close-btn {
  background-color: #0095ff;
  border: 1px solid transparent;
  border-radius: 3px;
  box-shadow: rgba(255, 255, 255, .4) 0 1px 0 0 inset;
  box-sizing: border-box;
  color: #fff;
  cursor: pointer;
  display: inline-block;
  font-family: -apple-system,system-ui,"Segoe UI","Liberation Sans",sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.15385;
  margin: 0;
  outline: none;
  padding: 8px .8em;
  position: relative;
  text-align: center;
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  vertical-align: baseline;
  white-space: nowrap;
}

.settings-close-btn:hover,
.settings-close-btn:focus {
  background-color: #07c;
}

.settings-close-btn:focus {
  box-shadow: 0 0 0 4px rgba(0, 149, 255, .15);
}

.settings-close-btn:active {
  background-color: #0064bd;
  box-shadow: none;
}

.hidden {
  display: none;
}