*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

body {
    height: 100vh;
    background-color: rgb(212, 255, 212);
    font-family: Arial, Helvetica, sans-serif;
    color: #111111;
}

h1 {
    font-family: Georgia, 'Times New Roman', Times, serif;
}

header {
    text-align: center;
    background-color: rgb(255, 255, 208);
    padding: 1em;
}

.main {
    display: flex;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    padding: 1em;
}

.content {
    display: flex;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1em;
    width: 1100px;
}

.container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    width: clamp(300px, 100%, 85vh);
    background-color: white;
    border: 1px solid black;
}

.pixel {
    aspect-ratio: 1; /* make it square */
}

.gridlines .pixel {
    border: 1px solid black;
}

.controls {
    flex-grow: 1;
    flex-shrink: 1;
    max-width: clamp(300px, 100%, 85vh);
    padding: 1.5em;
    background-color: rgb(255, 221, 242);
    font-size: 20px;
    border-radius: 25px;
    box-shadow: 
      0 1px 1px hsl(0deg 0% 0% / 0.075),
      0 2px 2px hsl(0deg 0% 0% / 0.075),
      0 4px 4px hsl(0deg 0% 0% / 0.075);
}

h2 {
    margin-bottom: 0.5em;
}

#grid-size-form {
    display: flex;
    align-items: center;
    gap: 1em;
}

#grid-size-form input {
    flex: 1;
    height: 36px;
    font-size: 16px;
    margin-left: 10px;
    border-radius: 5px;
    padding: 0.5em;
    border: 2px #111111 solid;
}

#grid-size-form button {
    height: 36px;
    font-size: 16px;
    width: 100px;
    background-color: rgb(255, 125, 222);
    transition: 0.3s;
    border: 2px #111111 solid;
    border-radius: 25px;
    padding: 0.5em;
    line-height: 0; /* vertically center text */

}

#grid-size-form button:hover {
    background-color: rgb(255, 242, 125);
}

/* --- Toggle Switch Component --- */
.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1em;
    /* background-color: yellow;
    border: 1px solid red; */
    margin: 1em 0;
}

.toggle {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

/* Hide default HTML checkbox */
.toggle input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc; /* Unchecked color */
  transition: .3s;
}

/* The knob */
.slider:before { 
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s;
}

input:checked + .slider {
  background-color: rgb(255, 125, 222); /* Checked color */
}

input:focus + .slider {
  box-shadow: 0 0 1px rgb(255, 125, 222);
}

input:checked + .slider:before {
  transform: translateX(26px); /* Knob to right */
}

/* Rounded sliders */
.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* --- End Toggle Switch Component --- */