@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap");

:root {
  --text: #444444;
  --pink: #ddb4f6;
  --blue: #8dd0fc;
  --track: #ddb4f666;
  --thumb: violet;
  --delete: #d21010;
  --download: #222222;
}

* {
  font-family: "Poppins", sans-serif;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

body {
  display: grid;
  place-items: center;
  min-height: 100svh;
  color: var(--text);
  background: var(--pink);
  background: linear-gradient(135deg, var(--pink), var(--blue));
}

img {
  width: 100%;
  height: auto;
  display: block;
}

input[type="range"] {
  appearance: none;
  background: var(--track);
  outline-color: var(--pink);
  width: 100%;
  height: 4px;
  border-radius: 4px;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  background: var(--thumb);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.25);
}

input[type="range"]:disabled::-webkit-slider-thumb {
  background: var(--pink);
}

.container {
  margin-block: 1.5rem;
  width: 90%;
  max-width: 1200px;
  background-color: #fff;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.25);
  display: grid;
  gap: 1rem;
}

.image-container {
  border: 3px dashed #ddd;
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.image-container input {
  display: none;
}

.image-container span[class^="material-"] {
  font-size: 5rem;
}

.image-container label {
  cursor: pointer;
  font-weight: 500;
  width: 100%;
  height: 100%;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.image-preview {
  position: relative;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s;
}

.image-preview:hover {
  transform: scale(1.02);
}

.image-preview img {
  border-radius: inherit;
}

.image-preview:has(img) ~ label {
  display: none;
}

.image-preview .remove-button {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 99;
  cursor: pointer;
  width: 30px;
  height: 30px;
  font-size: 24px;
  line-height: 30px;
  border-radius: 50%;
  border: none;
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.25);
  background: var(--delete);
  color: #fff;
  transform: scale(0) translate(50%, -50%);
  transition: transform 0.2s;
  transform-origin: top right;
}

.image-preview:hover .remove-button {
  transform: scale(1) translate(50%, -50%);
}

.settings {
  display: grid;
  grid-template-columns: auto auto;
  gap: 1rem;
}

.settings div:last-child {
  grid-column: 1 / span 2;
}

.settings label {
  display: block;
}

.actions {
  padding-top: 1rem;
  border-top: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.actions button {
  cursor: pointer;
  border: none;
  border-radius: 5px;
  padding: 10px;
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.25);
}

.actions button[data-save] {
  background: var(--download);
  color: #fff;
}

@media (min-width: 768px) {
  .container {
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-block: 1rem;
  }

  .image-container {
    padding: 2rem;
  }

  .settings {
    grid-template-columns: auto;
  }

  .settings div:last-child {
    grid-column: unset;
  }

  .actions {
    grid-column: 1 / span 2;
    justify-content: flex-end;
  }
}
