@import url(../var.less);
@import url(../mixins/_drawer.less);

@drawer-prefix: ~"@{prefix}drawer";

.drawer-animation(rtl);
.drawer-animation(ltr);
.drawer-animation(ttb);
.drawer-animation(btt);

.@{drawer-prefix}{
  position: absolute;
  box-sizing: border-box;
  background-color: @dialog-background-color;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 10px -5px rgba(0, 0, 0, 0.2),
  0 16px 24px 2px rgba(0, 0, 0, 0.14),
  0 6px 30px 5px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  outline: 0;

  .loop(@i) when (@i < (length(@directions)+1)) {
    .animation-out(extract(@directions, @i));
    .animation-in(extract(@directions, @i));
    .loop(@i+1);
  }
  
  .loop(1);

  &__wrapper {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    overflow: hidden;
    margin: 0;
  }

  &__header {
    font-weight: @font-weight-medium;
    align-items: center;
    border-bottom:1px solid @border-lighter-color;
    display: flex;
    margin-bottom: 32px;
    padding: @dialog-padding-primary;
    & > :first-child {
      flex: 1;
    }
  }

  &__title {
    margin: 0;
    flex: 1;
    line-height: inherit;
    font-size: 1rem;
  }

  &__close-btn {
    border: none;
    cursor: pointer;
    font-size: @font-size-extra-large;
    color: inherit;
    background-color: transparent;
  }

  &__body {
    flex: 1;
    overflow: auto;
    & > * {
      box-sizing: border-box;
    }
  }

  &.ltr, &.rtl {
    height: 100%;
    top: 0;
    bottom: 0;
  }

  &.ttb, &.btt {
    width: 100%;
    left: 0;
    right: 0;
  }

  &.ltr {
    left: 0;
  }

  &.rtl {
    right: 0;
  }

  &.ttb {
    top: 0;
  }

  &.btt {
    bottom: 0;
  }
}

.w-drawer__container {
  position: relative;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  height: 100%;
  width: 100%;
}

.w-drawer-fade-enter-active {
  animation: w-drawer-fade-in .3s;
}

.w-drawer-fade-leave-active {
  animation: w-drawer-fade-in .3s reverse;
}