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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: system-ui;
  background-color: #181616;
  color: #c5c9c5;

  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 5px 10px;
}

.title {
  font-size: 30px;
  font-weight: bold;
}

main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
  margin-bottom: 10px;
}

#text-input {
  outline: none;
  font-family: system-ui;
  color: #c5c9c5;
  width: 100%;
  height: 45px;
  padding: 8px;
  background-color: #0d0c0c;
  border: none;
  border-bottom: 2px solid #e6c38480;
  cursor: text;
  transition: all 0.25s ease-in-out;

  &::placeholder {
    color: #c5c9c590;
  }

  &:hover,
  &:focus {
    border-bottom: 2px solid #c8c093;
  }
}

#img-width-input,
#img-height-input,
#txt-size-input,
#txt-width-input {
  outline: none;
  font-family: system-ui;
  color: #c5c9c5;
  height: 45px;
  padding: 8px;
  background-color: #0d0c0c;
  border: none;
  border-bottom: 2px solid #e6c38480;
  cursor: text;
  transition: all 0.25s ease-in-out;

  &::placeholder {
    color: #c5c9c590;
  }

  &:hover,
  &:focus {
    border-bottom: 2px solid #c8c093;
  }
}

.button {
  outline: none;
  text-decoration: none;
  border: 1px solid #e6c38480;
  color: #c8c093;
  font-family: system-ui;
  font-weight: 600;
  background-color: #0d0c0c;
  height: auto;
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.25s ease-in-out;

  &:hover {
    background-color: #c8c093;
    color: #0d0c0c;
  }

  &:disabled {
    opacity: 50%;
    cursor: not-allowed;
  }
}

#save-button {
  margin-top: 20px;
}

img {
  width: 50vw;
  height: auto;
  width: 100%;
}

svg {
  width: 32px;
  height: auto;
}

/* https: //stackoverflow.com/questions/23372903/hide-up-down-arrow-buttons-spinner-in-input-number-firefox-29 */
input[type='number'] {
  appearance: none;
  -moz-appearance: textfield;

  &::-webkit-inner-spin-button,
  &::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
}

input[type="color"] {
  display: inline-flex;
  vertical-align: bottom;
  padding: 0;
  border: 0;
  height: 40px;
  width: 100%;
  cursor: pointer;
  background-color: transparent;
  border-radius: 10px;

  &::-webkit-color-swatch-wrapper {
    padding: 0;
  }

  &::-webkit-color-swatch {
    border: 0;
  }

  &::-moz-color-swatch {
    border: 0;
  }
}

p {
  margin-top: 10px;
}

.name-link {
  text-decoration: none;
  color: #c5c9c5;

  &:hover {
    text-decoration: underline;
    color: #c4b28a;
  }
}

.container {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(280px, 1fr);
  gap: 24px;
  width: min(1120px, 100%);
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.sizes-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  align-self: center;
}

/* https: //developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Forms/Customizable_select */
select,
::picker(select) {
  appearance: base-select;
}

select {
  color: #c5c9c5;
  border: 2px solid #e6c38480;
  background: #0d0c0c;
  padding: 10px;
  width: 100%;
  border-radius: 0;

  &::picker-icon {
    color: #e6c38480;
  }
}

::picker(select) {
  border: none;
  max-height: 30%;
}

option {
  background: #181616;
  padding: 10px;
  transition: 0.4s;

  &:hover,
  &:focus {
    background: #e6c38480;
  }
}

@media (max-width: 900px) {
  main {
    padding: 20px 12px 0;
  }

  .container {
    grid-template-columns: 1fr;
  }
}