@import '../../style/themes/default';
@import '../../style/mixins/hairline';

@zindex-modal: 1000;

@dawer-prefix-cls: am-popup;
@mask-opacity: 0.6;

.@{dawer-prefix-cls} {

  &-title {
    color: @heading-color;
    font-size: @font-size-lg;
    font-weight: 500;
    line-height: 22px;
    margin: 0;
    &-wrap {
      display: flex;
    }
  }

  &-close {
    background: transparent;
    border: 0;
    color: @text-color-secondary;
    cursor: pointer;
    display: none;
    font-weight: 700;
    line-height: 1;
    outline: 0;
    padding: 0;
    position: absolute;
    right: 0;
    text-decoration: none;
    top: 0;
    transition: color @animation-duration-slow;
    z-index: 10;

    &-x {
      display: block;
      font-size: @font-size-lg;
      font-style: normal;
      height: 56px;
      line-height: 56px;
      text-align: center;
      text-rendering: auto;
      text-transform: none;
      width: 56px;
    }

    &:focus,
    &:hover {
      color: #444;
      text-decoration: none;
    }
  }

  & &-header {
    align-items: center;
    display: flex;
    position: relative;
    padding: 0;
    .hairline('bottom');

    &-title {
      flex: 1;
    }

    & & {

      &-right {
        text-align: right;
      }
    }
  }

  &-item {
    align-items: center;
    box-sizing: border-box;
    color: @brand-primary;
    display: flex;
    font-size: @font-size-heading;
    height: @option-height;
    justify-content: center;
    padding: @v-spacing-md @h-spacing-lg;

    &&-disabled {
      color: @color-text-disabled;
    }
    & > .am-icon {
      margin-right: 8px;
    }
    &-active {
      background-color: @fill-tap;
    }
  }

}

@keyframes antdmDrawerFadeIn {

  0% {
    opacity: 0;
  }

  100% {
    opacity: @mask-opacity;
  }
}


[class^="@{dawer-prefix-cls}"],
[class*=" @{dawer-prefix-cls}"] {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
  font-size: 14px;
  box-sizing: border-box;

  &::before, &::after {
    box-sizing: border-box;
  }
}

[class^="@{dawer-prefix-cls}"] [class^="@{dawer-prefix-cls}"],
[class*=" @{dawer-prefix-cls}"] [class^="@{dawer-prefix-cls}"],
[class^="@{dawer-prefix-cls}"] [class*=" @{dawer-prefix-cls}"],
[class*=" @{dawer-prefix-cls}"] [class*=" @{dawer-prefix-cls}"] {
  box-sizing: border-box;
}

[class^="@{dawer-prefix-cls}"] [class^="@{dawer-prefix-cls}"]::before,
[class*=" @{dawer-prefix-cls}"] [class^="@{dawer-prefix-cls}"]::before,
[class^="@{dawer-prefix-cls}"] [class*=" @{dawer-prefix-cls}"]::before,
[class*=" @{dawer-prefix-cls}"] [class*=" @{dawer-prefix-cls}"]::before,
[class^="@{dawer-prefix-cls}"] [class^="@{dawer-prefix-cls}"]::after,
[class*=" @{dawer-prefix-cls}"] [class^="@{dawer-prefix-cls}"]::after,
[class^="@{dawer-prefix-cls}"] [class*=" @{dawer-prefix-cls}"]::after,
[class*=" @{dawer-prefix-cls}"] [class*=" @{dawer-prefix-cls}"]::after {
  box-sizing: border-box;
}

.@{dawer-prefix-cls} {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;

  &-pure {
    position: relative;
    background: #ffffff;

    &.@{dawer-prefix-cls}-left {
      box-shadow: 6px 0 16px 0 rgba(0, 0, 0, 0.08), 3px 0 6px -4px rgba(0, 0, 0, 0.12), 9px 0 28px 8px rgba(0, 0, 0, 0.05);
    }

    &.@{dawer-prefix-cls}-right {
      box-shadow: -6px 0 16px 0 rgba(0, 0, 0, 0.08), -3px 0 6px -4px rgba(0, 0, 0, 0.12), -9px 0 28px 8px rgba(0, 0, 0, 0.05);
    }
    &.@{dawer-prefix-cls}-top {
      box-shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
    }

    &.@{dawer-prefix-cls}-bottom {
      box-shadow: 0 -6px 16px 0 rgba(0, 0, 0, 0.08),0 -3px 6px -4px rgba(0, 0, 0, 0.12),0 -9px 28px 8px rgba(0, 0, 0, 0.05);
    }
  }
  &-inline {
    position: absolute;
  }
  .@{dawer-prefix-cls}-mask {
    position: absolute;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.45);
    pointer-events: auto;
  }

  .@{dawer-prefix-cls}-content-wrapper {
    position: absolute;
    z-index: 1000;
    transition: all 0.3s;
  }

  .@{dawer-prefix-cls}-content-wrapper-hidden {
    display: none;
  }
  &-left {
    & > .@{dawer-prefix-cls}-content-wrapper {
      top: 0;
      bottom: 0;
      left: 0;
      box-shadow: 6px 0 16px 0 rgba(0, 0, 0, 0.08), 3px 0 6px -4px rgba(0, 0, 0, 0.12), 9px 0 28px 8px rgba(0, 0, 0, 0.05);
    }
  }
  &-right {
    & > .@{dawer-prefix-cls}-content-wrapper {
      top: 0;
      right: 0;
      bottom: 0;
      box-shadow: -6px 0 16px 0 rgba(0, 0, 0, 0.08), -3px 0 6px -4px rgba(0, 0, 0, 0.12), -9px 0 28px 8px rgba(0, 0, 0, 0.05);
    }
  }
  &-top {
    & > .@{dawer-prefix-cls}-content-wrapper {
      top: 0;
      inset-inline: 0;
      box-shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
    }
  }
  &-bottom {
    & > .@{dawer-prefix-cls}-content-wrapper {
      bottom: 0;
      inset-inline: 0;
      box-shadow: 0 -6px 16px 0 rgba(0, 0, 0, 0.08),0 -3px 6px -4px rgba(0, 0, 0, 0.12),0 -9px 28px 8px rgba(0, 0, 0, 0.05);
    }
  }
  .@{dawer-prefix-cls}-content {
    width: 100%;
    height: 100%;
    overflow: auto;
    background: #ffffff;
    pointer-events: auto;
  }

  .@{dawer-prefix-cls}-wrapper-body {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
  }

  .@{dawer-prefix-cls}-header {
    display: flex;
    flex: 0;
    align-items: center;
    font-size: 16px;
    line-height: 1.5;
    border-bottom: 1px solid rgba(5, 5, 5, 0.06);
  }

  .@{dawer-prefix-cls}-header-title {
    display: flex;
    flex: 1;
    align-items: center;
    min-width: 0;
    min-height: 0;
  }

  .@{dawer-prefix-cls}-extra {
    flex: none;
  }

  .@{dawer-prefix-cls}-close {
    display: inline-block;
    margin-inline-end: 12px;
    color: rgba(0, 0, 0, 0.45);
    font-weight: 600;
    font-size: 16px;
    font-style: normal;
    line-height: 1;
    text-align: center;
    text-transform: none;
    text-decoration: none;
    background: transparent;
    border: 0;
    outline: 0;
    cursor: pointer;
    transition: color 0.2s;
    text-rendering: auto;
  }

  .@{dawer-prefix-cls}-close:focus,
  .@{dawer-prefix-cls}-close:hover {
    color: rgba(0, 0, 0, 0.88);
    text-decoration: none;
  }

  .@{dawer-prefix-cls}-title {
    flex: 1;
    margin: 0;
    color: rgba(0, 0, 0, 0.88);
    font-weight: 600;
    font-size: 16px;
    line-height: 1.5;
  }

  .@{dawer-prefix-cls}-body {
    flex: 1;
    min-width: 0;
    min-height: 0;
    padding: 0;
    overflow: auto;
  }

  .@{dawer-prefix-cls}-footer {
    flex-shrink: 0;
    padding: 8px 16px;
    border-top: 1px solid rgba(5, 5, 5, 0.06);
  }

  .@{dawer-prefix-cls}-mask-motion-enter-active,
  .@{dawer-prefix-cls}-mask-motion-appear-active,
  .@{dawer-prefix-cls}-mask-motion-leave-active {
    transition: all 0.3s;
  }

  .@{dawer-prefix-cls}-mask-motion-enter,
  .@{dawer-prefix-cls}-mask-motion-appear {
    opacity: 0;
  }

  &-rtl {
    direction: rtl;
  }

  .@{dawer-prefix-cls}-mask-motion-enter-active,
  .@{dawer-prefix-cls}-mask-motion-appear-active {
    opacity: 1;
  }

  .@{dawer-prefix-cls}-mask-motion-leave {
    opacity: 1;
  }

  .@{dawer-prefix-cls}-mask-motion-leave-active {
    opacity: 0;
  }

  .@{dawer-prefix-cls}-panel-motion-left-enter-start,
  .@{dawer-prefix-cls}-panel-motion-left-appear-start,
  .@{dawer-prefix-cls}-panel-motion-left-leave-start {
    transition: none;
  }
  .@{dawer-prefix-cls}-panel-motion-left-enter-active,
  .@{dawer-prefix-cls}-panel-motion-left-appear-active,
  .@{dawer-prefix-cls}-panel-motion-left-leave-active {
    transition: all 0.3s;
  }
  .@{dawer-prefix-cls}-panel-motion-left-enter-start,
  .@{dawer-prefix-cls}-panel-motion-left-appear-start {
    transform: translateX(-100%) !important;
  }
  .@{dawer-prefix-cls}-panel-motion-left-enter-active,
  .@{dawer-prefix-cls}-panel-motion-left-appear-active {
    transform: translateX(0);
  }

  .@{dawer-prefix-cls}-panel-motion-left-leave {
    transform: translateX(0);
  }

  .@{dawer-prefix-cls}-panel-motion-left-leave-active {
    transform: translateX(-100%);
  }

  .@{dawer-prefix-cls}-panel-motion-right-enter-start,
  .@{dawer-prefix-cls}-panel-motion-right-appear-start,
  .@{dawer-prefix-cls}-panel-motion-right-leave-start {
    transition: none;
  }

  .@{dawer-prefix-cls}-panel-motion-right-enter-active,
  .@{dawer-prefix-cls}-panel-motion-right-appear-active,
  .@{dawer-prefix-cls}-panel-motion-right-leave-active {
    transition: all 0.3s;
  }

  .@{dawer-prefix-cls}-panel-motion-right-enter-start,
  .@{dawer-prefix-cls}-panel-motion-right-appear-start {
    transform: translateX(100%) !important;
  }

  .@{dawer-prefix-cls}-panel-motion-right-enter-active,
  .@{dawer-prefix-cls}-panel-motion-right-appear-active {
    transform: translateX(0);
  }

  .@{dawer-prefix-cls}-panel-motion-right-leave {
    transform: translateX(0);
  }

  .@{dawer-prefix-cls}-panel-motion-right-leave-active {
    transform: translateX(100%);
  }

  .@{dawer-prefix-cls}-panel-motion-top-enter-start,
  .@{dawer-prefix-cls}-panel-motion-top-appear-start,
  .@{dawer-prefix-cls}-panel-motion-top-leave-start {
    transition: none;
  }

  .@{dawer-prefix-cls}-panel-motion-top-enter-active,
  .@{dawer-prefix-cls}-panel-motion-top-appear-active,
  .@{dawer-prefix-cls}-panel-motion-top-leave-active {
    transition: all 0.3s;
  }

  .@{dawer-prefix-cls}-panel-motion-top-enter-start,
  .@{dawer-prefix-cls}-panel-motion-top-appear-start {
    transform: translateY(-100%) !important;
  }

  .@{dawer-prefix-cls}-panel-motion-top-enter-active,
  .@{dawer-prefix-cls}-panel-motion-top-appear-active {
    transform: translateY(0);
  }

  .@{dawer-prefix-cls}-panel-motion-top-leave {
    transform: translateY(0);
  }

  .@{dawer-prefix-cls}-panel-motion-top-leave-active {
    transform: translateY(-100%);
  }

  .@{dawer-prefix-cls}-panel-motion-bottom-enter-start,
  .@{dawer-prefix-cls}-panel-motion-bottom-appear-start,
  .@{dawer-prefix-cls}-panel-motion-bottom-leave-start {
    transition: none;
  }

  .@{dawer-prefix-cls}-panel-motion-bottom-enter-active,
  .@{dawer-prefix-cls}-panel-motion-bottom-appear-active,
  .@{dawer-prefix-cls}-panel-motion-bottom-leave-active {
    transition: all 0.3s;
  }

  .@{dawer-prefix-cls}-panel-motion-bottom-enter-start,
  .@{dawer-prefix-cls}-panel-motion-bottom-appear-start {
    transform: translateY(100%) !important;
  }

  .@{dawer-prefix-cls}-panel-motion-bottom-enter-active,
  .@{dawer-prefix-cls}-panel-motion-bottom-appear-active {
    transform: translateY(0);
  }

  .@{dawer-prefix-cls}-panel-motion-bottom-leave {
    transform: translateY(0);
  }

  .@{dawer-prefix-cls}-panel-motion-bottom-leave-active {
    transform: translateY(100%);
  }
}
