/* ========== Variables ========== */
$cool-gray: #eff1f1;
$secondary-light-gray: #f7f9fa;
$scroll-highlight: darken($cool-gray, 10%);

/* ========== Mixins ========== */
@mixin hide-scrollbars {
  -ms-overflow-style: none; // IE 10+
  scrollbar-width: none; // Firefox
  &::-webkit-scrollbar {
    display: none;
  }
}

/* ========== Container ========== */
.picker-wrapper {
  background: white;
  box-shadow: 0 0.5vw 2vw -5px rgba(0, 0, 0, 0.2);
  display: inline-flex;
  flex-direction: column;
  border-radius: 8px;
  position: absolute;
  z-index: 99;
}

/* ========== Header ========== */
.duration-header {
  background-color: $secondary-light-gray;
  text-align: center;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;

  h6 {
    font-size: 13px;
    margin: 0;
    font-weight: 600;
  }
}

/* ========== Title Labels ========== */
.d-title {
  display: inline-grid;
  grid-template-columns: repeat(3, fit-content(100px));
  justify-content: end;
  gap: 0.5em;
  font-weight: bold;
  font-size: 11px;
  padding: 8px 1rem 0;

  span {
    width: 40px;
    text-align: center;
    margin-right: 1em;
  }
}

/* ========== Picker Section ========== */
.picker {
  position: relative;
  display: inline-grid;
  grid-template-columns: repeat(3, fit-content(80px));
  justify-content: end;
  padding: 0 1rem;
  font-size: 13px;
  font-weight: 500;
  font-feature-settings: "tnum";

  &::before,
  &::after {
    content: "";
    position: absolute;
    width: 100%;
    pointer-events: none;
    z-index: 1;
  }

  &::before {
    top: 0;
    height: 50%;
    background: linear-gradient(white, rgba(255, 255, 255, 0));
  }

  &::after {
    bottom: 0;
    height: 50%;
    background: linear-gradient(rgba(255, 255, 255, 0), white);
  }

  ul {
    @include hide-scrollbars();
    max-height: 190px;
    overflow-y: scroll;
    padding: 1.5em 0;
    margin-right: 1em;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;

    li {
      scroll-snap-align: center;
      height: 2.35em;
      width: 40px;
      text-align: center;
      user-select: none;
      cursor: pointer;
      line-height: 2.35em;
      border-radius: 4px;

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

/* ========== Highlight Window ========== */
.picker-window {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2.4em;
  transform: translateY(-52%);
  border-top: 1px solid $scroll-highlight;
  border-bottom: 1px solid $scroll-highlight;
  pointer-events: none;
  z-index: 2;
}

/* ========== Footer Buttons ========== */
.duration-footer {
  padding: 0 1rem 1rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;

  .buttons {
    display: flex;
    gap: 0.5rem;
  }
}
