*,
*::after,
::before {
  box-sizing: border-box;
  margin: 0;
}
i,
svg,
path {
  pointer-events: none;
}
body {
  background-image: linear-gradient(
    45deg,
    rgb(226, 156, 156),
    rgb(188, 223, 142),
    rgb(160, 160, 229),
    rgb(156, 228, 224),
    rgb(226, 122, 217),
    rgb(228, 227, 172),
    rgb(226, 156, 156),
    rgb(188, 223, 142),
    rgb(160, 160, 229),
    rgb(156, 228, 224),
    rgb(226, 122, 217),
    rgb(228, 227, 172)
  );
}
.container {
  font-family: "Mali", cursive;
  max-width: 1440px;
  margin: 0 auto;
  box-shadow: 0 0 2rem 0 rgba(0, 0, 0, 0.7);
  background-color: white;
}
.colors {
  display: grid;
  /* grid-template-columns: repeat(5, 1fr); */
  grid-auto-columns: 1fr;
  grid-auto-rows: 50vh;
  grid-template-areas:
    "one two "
    "three four "
    "five five ";
  min-height: 80vh;
}
.color:nth-child(1) {
  grid-area: one;
}
.color:nth-child(2) {
  grid-area: two;
}
.color:nth-child(3) {
  grid-area: three;
}
.color:nth-child(4) {
  grid-area: four;
}
.color:nth-child(5) {
  grid-area: five;
}
@media (min-width: 700px) {
  .colors {
    grid-auto-rows: 60vh;
    grid-template-areas:
      "one two"
      "three four"
      "five five";
  }
}
@media (min-width: 900px) {
  .colors {
    grid-auto-rows: 80vh;
    grid-template-areas: "one two three four five";
  }
}
.color {
  display: grid;
  color: rgb(87, 81, 81);
  justify-items: center;
  align-content: space-evenly;
  position: relative;
  overflow: hidden;
}
.btn {
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  background: none;
  font-weight: bold;
  padding: 0.5rem 1rem;
  border-radius: 1rem;
  transition: all 180ms cubic-bezier(0.42, -0.05, 0.11, 1.11);
}

.hex {
  cursor: pointer;
}
.controls {
  display: grid;
  gap: 2.5rem;
}
.color-sliders {
  background-color: rgb(253, 253, 253);
  width: 80%;
  position: absolute;
  bottom: 0%;
  border-top-left-radius: 1rem;
  border-top-right-radius: 1rem;
  padding: 1rem;
  pointer-events: none;
  transform: translateY(100px);
  transition: all 0.4s ease-in-out;
  opacity: 0;
  max-width: 18.75rem;
}
input[type="range"] {
  -webkit-appearance: none;
  margin: 1rem 0;
  width: 100%;
  cursor: pointer;
  border-radius: 1rem;
}
.color-sliders.active {
  transform: translateY(0px);
  pointer-events: all;
  opacity: 1;
}
.close {
  position: fixed;
  top: 0;
  right: 0;
  font-size: 1rem;
  border-radius: 1rem;
  margin: 0.2rem;
  background-color: rgb(131, 125, 125);
}
.brightness-slider,
.hue-slider,
.saturation-slider {
  display: grid;
  place-items: center;
}
.panels {
  display: flex;
  min-height: 20vh;
  justify-content: space-evenly;
  align-items: center;
  padding: 2rem;
}
.btn-panel {
  background-color: rgb(40, 36, 65);
  padding: 0.7rem 1.2rem;
  color: white;
  border-radius: 1.1rem;
}
.library-panel,
.save-panel,
.generate-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.library-popup,
.save-popup {
  position: relative;
}
.copy-container,
.save-container,
.library-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.76);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease-in-out;
  opacity: 0;
}
.copy-popup,
.save-popup,
.library-popup {
  background-color: white;
  width: 70%;
  min-height: 30vh;
  max-width: 650px;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  border-radius: 2rem;
  transition: transform 0.4s ease-in-out;
  transform: translateY(-2rem);
}
.library-popup {
  border-radius: 0;
}
.popup-title {
  font-size: clamp(1rem, 2.5vw, 1.6rem);
  z-index: 10;
}
.copy-container.active,
.save-container.active,
.library-container.active {
  opacity: 1;
  pointer-events: all;
}
.copy-container.active .copy-popup,
.save-container.active .save-popup,
.library-container.active .library-popup {
  transform: translateY(0);
}
.close-save,
.close-library {
  margin-right: 0.5rem;
}
.save-popup .save-name {
  padding: 0.7rem 1rem;
  width: 60%;
  font-size: 1rem;
}
.save-popup .save-submit {
  padding: 0.8rem 2.5rem;
  font-size: 1.2rem;
  color: white;
  background-color: rgb(40, 36, 65);
  border: none;
  border-radius: 1rem;
  cursor: pointer;
}
.library-popup {
  min-width: 40%;
  max-height: 50vh;
  overflow-y: scroll;
  justify-content: flex-start;
  padding: 2rem;
}

.custom-palette {
  display: flex;
  align-items: center;

  padding: 2rem;
  width: 100%;
}
.custom-palette + .custom-palette {
  padding: 2rem;
}
.custom-palette h4 {
  flex: 1;
  font-size: 1.2rem;
}
.preview-colors {
  display: flex;
  flex-grow: 1;
}
.mini-color {
  height: 5rem;
  flex-grow: 1;
  min-width: 2rem;
}
.pick-palette {
  height: 5rem;
  font-size: 1.2rem;
  background-color: rgb(71, 71, 71);
  color: white;
  border-radius: 0;
}
.pick-palette:hover {
  background-color: rgb(99, 97, 97);
}
