@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap");

:root {
  --rounded: 0.45rem;
  --border-color: rgba(204, 204, 204, 0.753);
  --background: #fefefe;
  --text-clr: #0a0a0a;
  --option-hover-clr: #e9e9e9;
}

* {
  box-sizing: border-box;
  user-select: none;
}

body {
  font-family: "Poppins", sans-serif;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(to right, #457fca, #5691c8);
}

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

.select {
  position: relative;
  width: 25rem;
}

.selected {
  position: relative;
  background-color: var(--background);
  padding: 12px 24px;
  border-radius: var(--rounded);
  cursor: pointer;
}

.selected::after {
  content: "";
  position: absolute;
  top: 53%;
  transform: translateY(-50%);
  right: 10px;
  width: 1.5rem;
  height: 1.5rem;
  background: url("./chevron-down.svg");
  background-size: contain;
  background-repeat: no-repeat;
  transition: all 0.4s;
}

.options {
  position: absolute;
  top: calc(100% + 4px);
  background-color: var(--background);
  border-radius: var(--rounded);
  width: 100%;
  max-height: 0px;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  padding: 8px;
  opacity: 0;
}

.options.active {
  max-height: 200px;
  opacity: 1;
  overflow-y: scroll;
}

.options.active + .selected::after {
  transform: rotateX(180deg) translateY(50%);
}

.options::-webkit-scrollbar {
  width: 0.375rem;
}

.options::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 0 6px 6px 0;
}

.option {
  display: block;
  padding: 12px;
  cursor: pointer;
  border-radius: 4px;
}

.option:hover {
  background-color: var(--option-hover-clr);
}
