@import './var.less';
@import './popup.less';

.@{prefix}-picker {
  &-box {
    padding-bottom: constant(safe-area-inset-bottom);
    padding-bottom: env(safe-area-inset-bottom);
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 10001;
    color: var(--text-primary);
    background-color: var(--background-dialogue);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    overflow: hidden;
  }

  &__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
  }

  &__title {
    flex: 1;
    font-weight: bold;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  &__btn {
    font-size: 17px;
    padding: 16px 15px;
    appearance: none;
    border: 0;
    background-color: transparent;
    flex-shrink: 0;
    color: var(--text-primary);
    &:active {
      opacity: 0.5;
    }
  }

  &__content {
    display: flex;
    justify-content: space-around;
    position: relative;
    overflow: hidden;
  }

  &__indicator {
    position: absolute;
    top: 50%;
    left: 16px;
    right: 16px;
    transform: translateY(-50%);
    height: 46px;
    &::after,
    &::before {
      content: '';
      position: absolute;
      width: 100%;
      height: 1px;
      transform: scaleY(0.5);
      background: var(--border-standard);
    }

    &::before {
      top: 0;
    }

    &::after {
      bottom: 0;
    }
  }

  &-list {
    flex: 1;
    overflow: hidden;
    text-align: center;
  }

  &-column,
  &-column__item {
    padding: 0;
    margin: 0;
  }

  &-column__item {
    font-size: 17px;
    height: 46px;
    line-height: 46px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
  }
}

@media (prefers-color-scheme: dark) {
  .dark;
}

.dark {
  .@{prefix}-picker {
    &__mask {
      &-top {
        flex: 1;
        background: linear-gradient(to bottom, rgba(38, 38, 38, 0.85), rgba(38, 38, 38, 0.6));
      }

      &-bottom {
        flex: 1;
        background: linear-gradient(to top, rgba(38, 38, 38, 0.85), rgba(38, 38, 38, 0.6));
      }
    }
  }
}
