* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'sans';
}

@font-face {
  font-family: 'sans';
  src: url('../assets/px.ttf');
}

body {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 1fr auto;
}

#render-playground {
  position: relative;
  padding: 30px;
  grid-column: 1 / 3;
  grid-row: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

/* header */
header {
  grid-column: 1 / 3;
  grid-row: 1;
}

/* footer */
footer {
  grid-column: 1 / 3;
  grid-row: 3;
}

/* playground */
#buttons {
  order: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

button {
  background: white;
  border-radius: 20px;
  border: solid 1px black;
  cursor: pointer;
}

#buttons button {
  width: 115px;
  padding: 7px;
  margin: 0 10px;
}

#back-button {
  padding: 7px 12px;
  top: 30px;
  right: 40px;
  position: absolute;
}

button:disabled {
  color: lightgrey;
  border-color: lightgrey;
}

#render-wrapper {
  order: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#shape svg {
  padding-bottom: 40px;
}

.shape-selectors {
  position: relative;
  order: 3;
  display: flex;
  justify-content: center;
  width: 100vw;
  padding: 0px 50px;
}

.shape-selector {
  max-width: 40px;
  max-height: 40px;
  padding: 7px;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.delete-button {
  display: none;
}

.shape-selectors:not(.hoverable)
  .shape-selector:has(path:not(.selected)):hover
  .delete-button {
  display: block;
  position: absolute;
  transform: translateY(34px);
  top: 0;
  font-size: 10px;
  padding-top: 4px;
  border: none;
}

svg {
  overflow: visible;
}

.shape-selector svg path {
  stroke: black;
  stroke-width: 30px;
}

.shape-selectors.hoverable div svg:hover path:not(.not-hoverable) {
  stroke: grey;
  fill: grey;
  cursor: pointer;
}

.path-selector {
  position: absolute;
  top: -24px;
  padding: 3px 10px;
  font-size: 11px;
  color: rgb(140, 140, 140);
  border-color: rgb(140, 140, 140);
}

button.selected {
  color: white;
  background: black;
}

.shape-selectors:not(.hoverable) .shape-selector:hover button {
  color: black;
  border-color: black;
}

.shape-selector svg path.not-hoverable {
  fill: lightgrey;
  stroke: lightgrey;
}

.shape-selector svg path.selected:not(.not-hoverable) {
  fill: black;
  stroke: black;
  cursor: pointer;
}

#controls-panel {
  backdrop-filter: blur(2px);
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  z-index: 10;
}

button#close-controls-button {
  padding: 25px 20px;
  border-radius: 0px;
  border: none;
  border-left: solid 2px black;
  font-size: 30px;
  writing-mode: tb;
  transform: rotate(180deg);
  text-align: center;
}

#controls-wrapper {
  width: 295px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.75);
  border-right: solid 2px black;
  flex-direction: column;
}

#controls-wrapper:not(.hidden) {
  display: flex;
}

.settings-panel {
  width: 100%;
}

.settings-panel:first-child {
  margin-bottom: 30px;
}

.settings-panel div:not(:last-child) {
  margin-bottom: 5px;
}

.settings-panel p {
  margin-bottom: 15px;
  opacity: 0.45;
  font-size: 15px;
}

button.download {
  align-self: flex-end;
  font-size: 18px;
  padding: 15px;
  border-radius: 50px;
  transition: box-shadow 0.2s ease-in-out;
  background: black;
  color: white;
  width: 100%;
  padding: 7px 15px;
  margin-top: 8px;
}

button.download:disabled {
  cursor: default;
  background: none;
  color: lightgrey;
}

input,
select,
.switch {
  background: none;
  margin-right: 10px;
  outline: none;
  padding: 5px 10px;
  width: 65px;
  border: solid 1px black;
  border-radius: 20px;
  height: 28px;
  font-size: 13px;
}

select {
  padding: 5px;
  text-overflow: ellipsis;
}

label {
  font-size: 13px;
}

div span {
  color: rgb(160, 160, 160);
  margin-left: 5px;
  font-size: 13px;
}

#loop-control {
  display: flex;
  align-items: center;
}

.switch {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.switch-dot {
  left: 5px;
  width: 18px;
  height: 18px;
  background: rgb(170, 170, 170);
  position: absolute;
  border-radius: 50%;
}

.switch.active .switch-dot {
  background: black;
  left: 40px;
}

.settings-panel div.switch {
  margin-bottom: 0;
}

#scanimate-button {
  font-size: 18px;
  margin-top: 20px;
  padding: 7px;
  background: black;
  color: white;
  width: 100%;
}

#scanimation-render:not(.hidden) {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

#render-wrapper,
.displayable-canvas,
#grids,
.grid {
  height: 100%;
  max-width: 55vw;
  max-height: 55vh;
}

#loader:not(.hidden) {
  z-index: 10;
  pointer-events: none;
  top: 0;
  position: absolute;
  height: 100%;
  text-align: center;
  display: flex;
  align-items: center;
  font-size: 5vw;
}

#grids {
  position: absolute;
}

#grid-slider:not(.hidden) {
  order: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 40vw;
}

#grid-slider-input {
  width: 100%;
  height: 32px;
  border-radius: 30px;
  padding: 5px;
  background: none;
  border: solid 1px black;
  margin: 0;
}

input[type='range']#grid-slider-input {
  width: 100%;
  height: 32px;
  border-radius: 30px;
  padding: 5px;
  background: none;
  border: solid 1px black;
  margin: 0;
}

input[type='range']#grid-slider-input::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
}

input[type='range']:focus {
  outline: none;
}

input[type='range'] {
  appearance: none;
  height: 38px;
  outline: none;
  border-radius: 30px;
  cursor: pointer;
  padding: 7px;
}

input[type='range']::-webkit-slider-thumb {
  appearance: none;
  width: 26px;
  height: 26px;
  background: black;
  border-radius: 30px;
  outline: none;
}

#grid-label {
  margin-bottom: 10px;
  text-align: center;
}

#draw-playground:not(.hidden) {
  z-index: 1;
  position: absolute;
  background: white;
  border: 1px solid black;
  display: flex;
  justify-content: center;
  max-height: 70vh;
  width: 45vw;
  max-width: 70vh;
  min-width: 500px;
}

#new-shape-buttons {
  display: flex;
  align-items: center;
}

#import-button,
#drawing-button {
  width: 150px;
  padding: 7px;
  margin: 0 10px;
  position: relative;
}

#import-button label {
  cursor: pointer;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

#import-button input {
  display: none;
}

#draw-playground #add-drawn-shape-button {
  position: absolute;
  bottom: 30px;
  width: 130px;
  padding: 7px;
}

#draw-playground #close-draw-playground-button {
  position: absolute;
  top: 10px;
  right: 20px;
  border: none;
  font-size: 30px;
  background: none;
  mix-blend-mode: difference;
  color: white;
}

.draw-path {
  border: solid 1px black;
  height: 100%;
  width: 50%;
}

.draw-path svg {
  width: 100%;
  height: 100%;
}

.hidden,
div.hidden,
#new-shape-buttons.hidden {
  display: none;
}
