@import '../dao-color.scss';
$dialog-overlay: rgba(31, 33, 38, 0.2);
$dialog-header-bg-color: #F5F7FA;
$dialog-header-bg-img: linear-gradient(0deg, rgb(242, 244, 247) 0%, rgb(245, 247, 250) 100%);
$dialog-border-color: #CCD1D9;
.dao-dialog {
  &-backdrop {
    transform: translate3d(0, 0, 0);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: $dialog-overlay;
    z-index: 9998;
    transition: opacity .3s ease;
    overflow: auto;
    display: flex;
    align-items: center;
    flex-direction: column;
    &.middle {
      justify-content: space-between;
    }
  }
  &-padding-block {
    width: 100%;
    flex-shrink: 0;
  }
  &-container {
    max-height: 100vh;
    max-width: 100vw;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    width: 600px;
    border-radius: 4px;
    background-color: $white;
    box-shadow: 0 15px 35px 0 rgba(61, 68, 79, 0.10), 0 5px 15px 0 rgba(0, 0, 0, 0.10);
    overflow: hidden;
    position: relative;
    .resizer {
      position: absolute;
      right: 0;
      bottom: 0;
      $resizeSvg: "data:image/svg+xml;utf8,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20fill=%27%23ccd1d9%27%20viewBox=%270%200%2032%2032%27%3E%3Cg%3E%3Cpolygon%20points=%2721.414%2028%2028%2021.414%2028%2018.586%2018.586%2028%2021.414%2028%27/%3E%3Cpolygon%20points=%275.414%2028%2028%205.414%2028%202.586%202.586%2028%205.414%2028%27/%3E%3Cpolygon%20points=%2713.414%2028%2028%2013.414%2028%2010.586%2010.586%2028%2013.414%2028%27/%3E%3C/g%3E%3C/svg%3E";
      height: 16px;
      width: 16px;
      cursor: nwse-resize;
      background: url($resizeSvg);
    }
    .dao-dialog {
      &-header {
        display: flex;
        flex: 0 0 auto;
        justify-content: space-between;
        padding: 10px 20px;
        background-color: $dialog-header-bg-color;
        background-image: $dialog-header-bg-img;
        border-radius: 4px 4px 0 0;
        box-shadow: inset 0 -1px 0 $dialog-border-color;
        color: $black-dark;
        font-size: 16px;
        font-weight: 400;
        line-height: 20px;
        .center {
          flex: 1;
          text-align: center;
          padding: 0 30px;
        }
        .dao-close {
          display: flex;
          align-items: center;
          cursor: pointer;
          svg {
            width: 16px;
            height: 16px;
            fill: #aab2bd;
            &:hover {
              fill: #656d78;
            }
          }
        }
      }
      &-body {
        flex: 1 1 auto;
        background-color: white;
        color: $black-dark;
        font-size: 14px;
        font-weight: 400;
        line-height: 21px;
        overflow-y: auto;
      }
      &-footer {
        flex: 0 0 auto;
        padding: 10px 20px;
        text-align: right;
        border-top: 1px solid $dialog-border-color;
        background-color: $dialog-header-bg-color;
        background-image: $dialog-header-bg-img;
        border-radius: 0 0 4px 4px;
        user-select: none;
      }
    }
    animation: showDialog .3s;
  }
}

@keyframes showDialog {
  0% {
    transform: scale(0.7);
    -webkit-transform: scale(0.7);
  }
  100% {
    transform: scale(1);
    -webkit-transform: scale(1);
  }
}

.dao-dialog-leave-active {
  opacity: 0;
}

.dao-dialog-leave-active .dao-dialog-container {
  transform: translate(0, 0);
}