@import '../style/mixins/hairline';

:root {
  --van-share-sheet-header-padding: var(--van-padding-sm) var(--van-padding-md);
  --van-share-sheet-title-color: var(--van-text-color);
  --van-share-sheet-title-font-size: var(--van-font-size-md);
  --van-share-sheet-title-line-height: var(--van-line-height-md);
  --van-share-sheet-description-color: var(--van-text-color-2);
  --van-share-sheet-description-font-size: var(--van-font-size-sm);
  --van-share-sheet-description-line-height: 16px;
  --van-share-sheet-icon-size: 48px;
  --van-share-sheet-option-name-color: var(--van-gray-7);
  --van-share-sheet-option-name-font-size: var(--van-font-size-sm);
  --van-share-sheet-option-description-color: var(--van-text-color-3);
  --van-share-sheet-option-description-font-size: var(--van-font-size-sm);
  --van-share-sheet-cancel-button-font-size: var(--van-font-size-lg);
  --van-share-sheet-cancel-button-height: 48px;
  --van-share-sheet-cancel-button-background: var(--van-background-2);
}

.van-share-sheet {
  &__header {
    padding: var(--van-share-sheet-header-padding);
    text-align: center;
  }

  &__title {
    margin-top: var(--van-padding-xs);
    color: var(--van-share-sheet-title-color);
    font-weight: normal;
    font-size: var(--van-share-sheet-title-font-size);
    line-height: var(--van-share-sheet-title-line-height);
  }

  &__description {
    display: block;
    margin-top: var(--van-padding-xs);
    color: var(--van-share-sheet-description-color);
    font-size: var(--van-share-sheet-description-font-size);
    line-height: var(--van-share-sheet-description-line-height);
  }

  &__options {
    position: relative;
    display: flex;
    padding: var(--van-padding-md) 0 var(--van-padding-md) var(--van-padding-xs);
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;

    &--border::before {
      .hairline-top(var(--van-border-color), var(--van-padding-md));
    }

    &::-webkit-scrollbar {
      height: 0;
    }
  }

  &__option {
    display: flex;
    flex-direction: column;
    align-items: center;
    user-select: none;
  }

  &__icon,
  &__image-icon {
    width: var(--van-share-sheet-icon-size);
    height: var(--van-share-sheet-icon-size);
    margin: 0 var(--van-padding-md);
  }

  &__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--van-gray-7);
    border-radius: 100%;
    background-color: var(--van-gray-2);

    &--link,
    &--poster,
    &--qrcode {
      font-size: 26px;
    }

    &--weapp-qrcode {
      font-size: 28px;
    }

    &--qq,
    &--weibo,
    &--wechat,
    &--wechat-moments {
      font-size: 30px;
      color: var(--van-white);
    }

    &--qq {
      background-color: #38b9fa;
    }

    &--wechat {
      background-color: #0bc15f;
    }

    &--weibo {
      background-color: #ee575e;
    }

    &--wechat-moments {
      background-color: #7bc845;
    }
  }

  &__name {
    margin-top: var(--van-padding-xs);
    padding: 0 var(--van-padding-base);
    color: var(--van-share-sheet-option-name-color);
    font-size: var(--van-share-sheet-option-name-font-size);
  }

  &__option-description {
    padding: 0 var(--van-padding-base);
    color: var(--van-share-sheet-option-description-color);
    font-size: var(--van-share-sheet-option-description-font-size);
  }

  &__cancel {
    display: block;
    width: 100%;
    padding: 0;
    font-size: var(--van-share-sheet-cancel-button-font-size);
    line-height: var(--van-share-sheet-cancel-button-height);
    text-align: center;
    background: var(--van-share-sheet-cancel-button-background);
    border: none;
    cursor: pointer;

    &::before {
      display: block;
      height: var(--van-padding-xs);
      background-color: var(--van-background);
      content: ' ';
    }

    &:active {
      background-color: var(--van-active-color);
    }
  }
}
