/*--- Font definitions ---*/
@font-face {
  font-family: "Degular Mono";
  src: url("assets/fonts/degular_mono_regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: "Degular Mono";
  src: url("assets/fonts/degular_mono_medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
}
@font-face {
  font-family: "Degular Mono";
  src: url("assets/fonts/degular_mono_semibold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
}
@font-face {
  font-family: "Degular Mono";
  src: url("assets/fonts/degular_mono_bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: "Degular Mono";
  src: url("assets/fonts/degular_mono_black.otf") format("opentype");
  font-weight: 900;
  font-style: normal;
}
@font-face {
  font-family: "Degular Mono";
  src: url("assets/fonts/degular_mono_italic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
}
@font-face {
  font-family: "Degular Mono";
  src: url("assets/fonts/degular_mono_thin.otf") format("opentype");
  font-weight: 100;
  font-style: normal;
}
/*--- Apply font universally ---*/
body {
  position: relative;
  background-color: #111111;
  font-family: "Degular Mono", monospace;
  font-size: 0.9rem;
  margin: 0;
  padding: 0;
}

/*--- Left side: Canvas area ---*/
#canvas-area {
  position: fixed;
  margin: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
  height: calc(100vh - 4rem);
  width: calc(100vw - 27rem);
  box-sizing: border-box;
}

#bottom-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 1rem;
}

#upload-section, #export-section {
  display: flex;
  gap: 0.5rem;
}

.action-btn {
  background-color: transparent;
  color: white;
  border: none;
  border-radius: 0px;
  padding: 0.75rem 1.5rem;
  font-family: "Degular Mono", monospace;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  font-weight: 500;
}
.action-btn:hover {
  background-color: #3d3d3d;
}
.action-btn:active {
  background-color: #4d4d4d;
}
.action-btn:disabled {
  color: #666;
  cursor: not-allowed;
}

#canvas-container {
  background-color: #242424;
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 400px;
  min-height: 400px;
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
#canvas-container canvas {
  max-width: calc(100vw - 26rem);
  max-height: calc(100vh - 10rem);
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
  z-index: 1;
  pointer-events: none;
}

#controls {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 2rem;
  right: 2rem;
  width: 20rem;
  background-color: #242424;
  padding: 2.125rem 0 0;
  border-radius: 8px;
  color: white;
}
#controls > div {
  border-bottom: 1px solid #3D3D3D;
  padding-top: 1.5rem;
  padding-left: 2.125rem;
  padding-right: 2.125rem;
  margin-top: 0.5rem;
}

h1 {
  padding: 0 2.125rem;
  text-transform: uppercase;
  font-size: 2rem;
  font-weight: 400;
  line-height: 108%;
  margin-top: 0;
}

#style-select {
  display: none;
  padding-bottom: 1.8rem;
  flex-direction: row;
  gap: 1rem;
}
#style-select label {
  display: flex;
  align-items: baseline;
  margin-right: 24px;
}
#style-select input[type=radio] {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 0;
  background-color: white;
  cursor: pointer;
  position: relative;
  margin-right: 8px;
}
#style-select input[type=radio]:checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  background-color: black;
}

input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  background: transparent;
  cursor: pointer;
  outline: none;
  --fill-percentage: 0%;
}
input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 3px;
  background: linear-gradient(to right, white 0%, white var(--fill-percentage), #3d3d3d var(--fill-percentage), #3d3d3d 100%);
  border: none;
}
input[type=range]::-moz-range-track {
  width: 100%;
  height: 3px;
  background: linear-gradient(to right, white 0%, white var(--fill-percentage), #3d3d3d var(--fill-percentage), #3d3d3d 100%);
  border: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  margin-top: -4px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid #242424;
}
input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}
input[type=range]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  border: 2px solid #242424;
  cursor: pointer;
  transition: all 0.2s ease;
}
input[type=range]::-moz-range-thumb:hover {
  transform: scale(1.3);
}
input[type=range]:focus {
  outline: none;
}
input[type=range]:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}
input[type=range]:focus::-moz-range-thumb {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}
input[type=range]:active::-webkit-slider-thumb {
  transform: scale(1.15);
}
input[type=range]:active::-moz-range-thumb {
  transform: scale(1.15);
}

input[type=number] {
  background-color: #3d3d3d;
  border: 0px solid #000;
  color: inherit;
  text-align: right;
  padding: 2px 4px;
}
input[type=number]:focus {
  background-color: #4d4d4d;
  outline: none;
}

input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
}

#halftone-sliders, #dither-sliders {
  padding-bottom: 0.6rem;
}
#halftone-sliders > div, #dither-sliders > div {
  margin-bottom: 1.5rem;
}
#halftone-sliders > div:nth-of-type(3), #dither-sliders > div:nth-of-type(3) {
  display: none;
}
#halftone-sliders label, #dither-sliders label {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.5rem;
  align-items: center;
}
#halftone-sliders label input[type=range], #dither-sliders label input[type=range] {
  grid-row: 2;
  grid-column: 1;
}
#halftone-sliders label .number-modifier, #dither-sliders label .number-modifier {
  grid-row: 2;
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
#halftone-sliders label div, #dither-sliders label div {
  display: flex;
}
#halftone-sliders label .buttons-container, #dither-sliders label .buttons-container {
  display: flex;
  flex-direction: column;
  height: 1rem;
  margin-left: 2px;
}
#halftone-sliders label .buttons-container button, #dither-sliders label .buttons-container button {
  border: 0px;
  background-color: transparent;
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: end;
  overflow: none;
  width: 0.5rem;
  max-height: 50%;
  padding: 0 5px 0;
  font-family: "Degular Mono", monospace;
  font-size: 12px;
  color: inherit;
}
#halftone-sliders label .buttons-container button:hover, #dither-sliders label .buttons-container button:hover {
  background-color: #3d3d3d;
}
#halftone-sliders label .buttons-container button:first-of-type, #dither-sliders label .buttons-container button:first-of-type {
  align-items: start;
  margin-bottom: 1px;
}
#halftone-sliders label .buttons-container button span, #dither-sliders label .buttons-container button span {
  user-select: none;
  pointer-events: none;
}

#dither-sliders {
  display: none;
}

#dot-characters {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  margin-top: 0.5rem;
  padding-bottom: 2.5rem;
}
#dot-characters .dot-characters-label {
  grid-column: 1/-1;
  margin-bottom: 0.8rem;
}

.char-button {
  display: inline-block;
  cursor: pointer;
  /*  
  .char-checkbox:checked:hover + span {
       background-color: #5d5d5d;
  } 
  */
}
.char-button .char-checkbox {
  display: none;
}
.char-button span {
  border: none;
  border-radius: 0px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #3d3d3d;
  width: 100%;
  height: 0;
  min-width: 2rem;
  padding: 55% 0 55% 0;
  font-size: 1.6rem;
  font-weight: 400;
  transition: all 0.2s ease;
  user-select: none;
}
.char-button:hover span {
  background-color: #4d4d4d;
}
.char-button .char-checkbox:checked + span {
  background-color: #6f6f6f;
  color: white;
}

#font-weight-selector {
  padding: 1.5rem 2.125rem;
  border-bottom: 1px solid #3D3D3D;
}
#font-weight-selector label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
#font-weight-selector select {
  width: 100%;
  background-color: #3d3d3d;
  background-image: none;
  color: white;
  border: none;
  border-radius: 0px;
  padding: 0.5rem;
  font-family: "Degular Mono", monospace;
  font-size: 0.8rem;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}
#font-weight-selector select:hover {
  background-color: #4d4d4d;
}
#font-weight-selector select:focus {
  background-color: #4d4d4d;
  outline: 2px solid #666;
}
#font-weight-selector select option {
  background-color: #3d3d3d;
  color: white;
}

p {
  padding: 1rem 2.125rem;
  color: #999;
}

.spacer {
  height: 2rem;
  width: 20rem;
  position: absolute;
  bottom: -4rem;
  right: 0;
  background-color: transparent;
  z-index: 1;
  border: 0px !important;
}
