@import '../../styles/mixins/index';

.nut-dialog {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: $dialog-width;
  min-height: $dialog-min-height;
  padding: $dialog-padding;
  box-sizing: border-box;

  &__outer {
    position: fixed;
    max-height: $dialog-max-height;
    overflow-y: auto;
    background-color: $white;
    transition: transform 0.2s, -webkit-transform 0.2s;
    -webkit-overflow-scrolling: touch;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    border-radius: $dialog-outer-border-radius;
    z-index: $dialog-outer-z-index;
    animation-duration: 0.3s;
  }

  &__header {
    display: block;
    box-sizing: border-box;
    text-align: center;
    font-size: $nsui-font-size-6;
    color: $nsui-gray9;
    margin: $dialog-header-margin;
    padding: $dialog-header-padding;
    font-weight: $dialog-header-font-weight;
    @include oneline-ellipsis();
    &-only {
      margin: $dialog-header-only-margin;
    }
  }

  &__content {
    width: 100%;
    overflow: auto;
    box-sizing: border-box;
    flex: 1;
    margin: $dialog-content-margin;
    max-height: $dialog-content-max-height;
    line-height: $dialog-content-line-height;
    padding: $dialog-header-padding;
    font-size: $dialog-content-font-size;
    color: $dialog-content-color;
    word-wrap: break-word;
    word-break: break-all;
    white-space: pre-wrap;
    text-align: $dialog-content-text-align;
  }

  &__footer {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: space-around;
    position: relative;
    &.round {
      box-sizing: border-box;
      padding: $dialog-footer-round-padding;
      &.vertical {
        .nut-button { 
          &.nut-dialog__footer-cancel {
            height: 22px;
            line-height: 22px;
            margin-top: 12px;
          }
        }
      }
      .nut-button { 
        &.nut-dialog__footer-cancel {
          margin-right: $dialog-footer-cancel-margin-right;
        }
      }
    }
    &.vertical {
      flex-direction: column-reverse;

      .nut-button {
        min-width: 100%;
        margin: 0;
        flex: 1;
        &.nut-button--none {
          box-sizing: border-box;
          height: $dialog-footer-button-none-height;
        }
        &.nut-dialog__footer-cancel {
          color: $dialog-footer-cancel-color;
          border: 0;
          margin-right: 0;
        }

        &.nut-dialog__footer-ok {
          // margin-top: $dialog-vertical-footer-ok-margin-top;
        }
      }
    }

    &-divider {
      height: 100%;
      width: 0px;
      position: absolute;
      transform: scaleX(0.5);
      border-right: $dialog-footer-border-top;
    }
    .nut-button {
      min-width: $dialog-footer-button-min-width;
      flex: 1;
      &.nut-button--none {
        padding: $dialog-footer-button-padding;
        height: $dialog-footer-button-height;
        line-height: $dialog-footer-button-height;
        box-sizing: content-box;
        border-radius: $dialog-footer-border-radius;
        border: none;
        &::after {
          border-top: $dialog-footer-border-top;
          border-radius: 0;
          content: '';
          position: absolute;
          top: 0;
          width: 100%;
          left: 0;
          transform: scaleY(0.5);
        }
      }
      
      // border-top: $dialog-footer-border-top;
      // border-image: linear-gradient( to bottom,transparent  50%,rgba(0, 0, 0, 0.6) 50%) 0 0 100% 0 ;
    }

    &-cancel.nut-dialog__footer-cancel {
      &.nut-button--none {
        color: $dialog-footer-cancel-color;
      }
      
    }

    &-ok {
      // max-width: $dialog-footer-ok-max-width;
      font-weight: $dialog-footer-button-font-weight;
    }
  }
}

// .fadeDialog-enter,
// .fadeDialog-appear {
//   opacity: 0;
// }

// .fadeDialog-enter-active,
// .fadeDialog-appear-active {
//   opacity: 1;
//   transition: opacity 1s cubic-bezier(0.3, 1.3, 0.3, 1);
// }

// .fadeDialog-exit {
//   opacity: 1;
// }

// .fadeDialog-exit-active {
//   opacity: 0;
//   transition: opacity 1s cubic-bezier(0.3, 1.3, 0.3, 1);
// }
