:root {
  --line-height: 1.5;
  --padding-multiplier: 0.75;

  @media (min-width: 320px) {
    --padding-multiplier: 1;
  }

  @media (min-width: 768px) {
    --padding-multiplier: 1.125;
  }

  @media (min-width: 1024px) {
    --padding-multiplier: 1.25;
  }
}

html,
body {
  box-sizing: border-box;
  font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol";
  font-size: 16px;
  line-height: var(--line-height);
  margin: 0;
  max-width: 100%;
  min-height: 100%;
  padding: 0;
  width: 100%;

  @media (min-width: 1024px) {
    max-height: 100%;
  }
}

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

body {
  align-items: center;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  padding: calc(16px * var(--padding-multiplier));
}

header {
  flex-grow: 0;
  flex-shrink: 0;
  margin-bottom: calc(16px * var(--padding-multiplier));
  text-align: center;
  width: 100%;
}

main {
  align-items: center;
  display: flex;
  flex-grow: 1;
  flex-direction: column;
  justify-content: flex-start;
  gap: calc(16px * var(--padding-multiplier));
  margin: 0;
  width: 100%;
  max-width: 100%;

  @media (min-width: 1024px) {
    align-items: flex-start;
    flex-direction: row;
    justify-content: flex-start;
  }
}

h1 {
  font-size: 1.5rem;
  margin: 0;
}

select {
  -moz-appearance: none;
  -webkit-appearance: none;
  appearance: none;
  background: url(data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0Ljk1IDEwIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2ZmZjt9LmNscy0ye2ZpbGw6IzQ0NDt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPmFycm93czwvdGl0bGU+PHJlY3QgY2xhc3M9ImNscy0xIiB3aWR0aD0iNC45NSIgaGVpZ2h0PSIxMCIvPjxwb2x5Z29uIGNsYXNzPSJjbHMtMiIgcG9pbnRzPSIxLjQxIDQuNjcgMi40OCAzLjE4IDMuNTQgNC42NyAxLjQxIDQuNjciLz48cG9seWdvbiBjbGFzcz0iY2xzLTIiIHBvaW50cz0iMy41NCA1LjMzIDIuNDggNi44MiAxLjQxIDUuMzMgMy41NCA1LjMzIi8+PC9zdmc+)
    no-repeat 97.5% 50%;
  background-color: #ffffff;
  border: 1px solid #cccccc;
  border-radius: 8px;
  color: #000000;
  font-size: 1rem;
  line-height: var(--line-height);
  padding: calc(4px * var(--padding-multiplier)) calc(8px * var(--padding-multiplier));
  width: 100%;
}

input[type="color"] {
  height: 32px;
  padding: 0;
}

/*********** Baseline, reset styles ***********/
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  width: 100%;
}

/* Removes default focus */
input[type="range"]:focus {
  outline: none;
}

/******** Chrome, Safari, Opera and Edge Chromium styles ********/
/* slider track */
input[type="range"]::-webkit-slider-runnable-track {
  background-color: #ebebeb;
  border-radius: 8px;
  height: 8px;
}

/* slider thumb */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; /* Override default look */
  appearance: none;
  margin-top: -4px; /* Centers thumb on the track */
  background-color: #007fad;
  border-radius: 8px;
  height: 16px;
  width: 16px;
}

input[type="range"]:focus::-webkit-slider-thumb {
  outline: 3px solid #007fad;
  outline-offset: 2px;
}

/*********** Firefox styles ***********/
/* slider track */
input[type="range"]::-moz-range-track {
  background-color: #ebebeb;
  border-radius: 8px;
  height: 8px;
}

/* slider thumb */
input[type="range"]::-moz-range-thumb {
  background-color: #007fad;
  border: none; /*Removes extra border that FF applies*/
  border-radius: 8px;
  height: 16px;
  width: 16px;
}

input[type="range"]:focus::-moz-range-thumb {
  outline: 3px solid #007fad;
  outline-offset: 2px;
}

input[type="text"] {
  border-radius: 8px;
  border: 1px solid #cccccc;
  font-size: 1rem;
  line-height: var(--line-height);
  padding: 4px 8px;
  width: 100%;
}

.input-group {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: calc(8px * var(--padding-multiplier));
  justify-content: center;
  padding: calc(4px * var(--padding-multiplier)) 0;
}

.input-group-inline {
  align-items: center;
  display: flex;
  flex-direction: row;
  gap: calc(8px * var(--padding-multiplier));
  width: 100%;
}

#controlsColumn {
  display: flex;
  flex-direction: column;
  gap: calc(16px * var(--padding-multiplier));
  width: 100%;
  max-width: 400px;
}

#controlsContainer {
  background-color: #ffffff;
  border-radius: 1rem;
  border: 1px solid #cccccc;
  height: auto;
  max-height: 100%;
  overflow-y: auto;
  padding: calc(16px * var(--padding-multiplier));
  width: 100%;
  max-width: 100%;
}

.downloadContainer {
  display: flex;
  justify-content: center;
  width: 100%;
}

#downloadButton {
  background-color: #007fad;
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-size: 1rem;
  padding: calc(8px * var(--padding-multiplier)) calc(16px * var(--padding-multiplier));
  transition: background-color 0.2s;
  width: 100%;
}

#downloadButton:hover {
  background-color: #006089;
}

#tabsContainer {
  border: 1px solid #cccccc;
  border-radius: 8px;
  display: flex;
  flex-direction: row;
  margin-bottom: calc(16px * var(--padding-multiplier));
  overflow-x: scroll;
  width: 100%;

  .tab-button {
    background-color: transparent;
    border: 0;
    cursor: pointer;
    flex: 1;
    padding: calc(8px * var(--padding-multiplier)) calc(16px * var(--padding-multiplier));

    &:first-child {
      border-top-left-radius: 8px;
      border-bottom-left-radius: 8px;
    }

    &:last-child {
      border-top-right-radius: 8px;
      border-bottom-right-radius: 8px;
    }

    &:not(:last-child) {
      border-right: 1px solid #cccccc;
    }

    &:hover {
      background-color: #f0f0f0;
    }

    &.active {
      background-color: #f0f0f0;
      color: #000000;
    }
  }

  + hr {
    border-top: 1px solid #cccccc;
    color: transparent;
    margin: calc(16px * var(--padding-multiplier)) 0;
  }
}

.tab {
  display: flex;
  flex-direction: column;
  gap: calc(16px * var(--padding-multiplier));
}

#fontStyleOptions {
  align-items: center;
  border: 1px solid #cccccc;
  border-radius: 8px;
  display: flex;
  flex-direction: row;
  justify-content: center;

  input[type="checkbox"] {
    display: none;
  }

  label {
    background-color: #ffffff;
    cursor: pointer;
    display: inline-block;
    padding: calc(4px * var(--padding-multiplier)) calc(8px * var(--padding-multiplier));

    &:first-child {
      border-top-left-radius: 8px;
      border-bottom-left-radius: 8px;
    }

    &:last-child {
      border-top-right-radius: 8px;
      border-bottom-right-radius: 8px;
    }

    &:not(:last-child) {
      border-right: 1px solid #cccccc;
    }

    &.active {
      background-color: #f0f0f0;
      color: #000000;
    }

    &:hover {
      background-color: #f0f0f0;
    }
  }
}

#inputBackgroundColor,
#inputTextFontColor,
#inputLinesEndsColor,
#inputLinesColor,
#svgArrowsColor {
  flex: 1;
}

#wallpaperContainer {
  align-items: center;
  display: flex;
  flex-grow: 1;
  height: auto;
  justify-content: center;
  width: 100%;

  @media (min-width: 1024px) {
    height: calc(100vh - 2rem - (16px * var(--padding-multiplier) * 3));
    width: 100%;
  }
}

#wallpaper {
  border: 1px solid #cccccc;
}

[debug] {
  outline: 1px solid red;
}

[nestDebug] * {
  outline: 1px solid red;
}
