@import "./miniui.scss";

/*******************************
             Modal
*******************************/
.sheet {
  display: block;
  position: fixed;
  background-color: #FFFFFF;
  user-select: text;
  z-index: 999;
  transition: all 0.3s ease-out;

  &.rtl {
    top: 0;
    bottom: 0;
    right: -100%;
    left: auto;
    height: 100vh;
  }
  &.ltr {
    top: 0;
    bottom: 0;
    right: auto;
    left: -100%;
    height: 100vh;
  }
  &.btt {
    top: auto;
    bottom: -100vh;
    right: 0;
    left: 0;
    width: 100vw;
  }
  &.ttb {
    top: -100vh;
    bottom: auto;
    right: 0;
    left: 0;
    width: 100vw;
  }

  &.medium {
    &.ltr, &.rtl {
      width: 50vw;
    }
    &.btt, &.ttb {
      height: 50vh;
    }
  }
  &.small {
    &.ltr, &.rtl {
      width: 25vw;
    }
    &.btt, &.ttb {
      height: 25vh;
    }
  }
  &.large {
    &.ltr, &.rtl {
      width: 75vw;
    }
    &.btt, &.ttb {
      height: 75vh;
    }
  }


  /*--------------
       Close
  ---------------*/
  &>.sheet-close {
    cursor: pointer;
    position: absolute;
    z-index: 1;
    font-size: 14px;
    top: 20px;
    right: 14px;
    font-family: inherit;
    display: block;
    width: 20px;
    height: 20px;
    font-size: 24px;
    line-height: 18px;
    text-align: center;
    color: #000;

    &:hover {
        color: #333;
    }
  }
  /*--------------
       Header
  ---------------*/
  &>.sheet-header {
    box-sizing: border-box;
    margin: 0;
    width: 100%;
    padding: 1em 2em;
    font-size: 1.14285714em;
    line-height: 2em;
    font-weight: bold;
    border-bottom: 1px solid $lightgray;

  }
  /*--------------
       Content
  ---------------*/
  &>.sheet-content {
    width: 100%;
    position: absolute;
    padding: 2em;
    box-sizing: border-box;
    overflow: scroll;
    top: 4.5em;
    bottom: 0;
    left: 0;
  }

  &.visible {
    display: block;
    visibility: visible;
  }
}

/*--------------
     Dimmer
---------------*/
.dimmer {
  padding: 50px;
  opacity: 1;
  overflow: auto;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  right: 0;
  z-index:998;
  background-color: rgba(0, 0, 0, 0);
  animation: 0.3s dimmer-animate ease-out 1 forwards;
}

.hidden {
  .sheet {
    &.rtl {
      animation: 0.3s sheet-animate-reverse-rtl ease-in 1 forwards;
    }
    &.ltr {
      animation: 0.3s sheet-animate-reverse-ltr ease-in 1 forwards;
    }
    &.btt {
      animation: 0.3s sheet-animate-reverse-btt ease-in 1 forwards;
    }
    &.ttb {
      animation: 0.3s sheet-animate-reverse-ttb ease-in 1 forwards;
    }
  }
}
.hidden .dimmer {
  animation: 0.3s dimmer-animate-reverse ease-out 1 forwards;
}

@keyframes dimmer-animate {
  from {
    background-color: rgba(0, 0, 0, 0);
  }
  to {
    background-color: rgba(0, 0, 0, 0.65);
  }
}

@keyframes dimmer-animate-reverse {
  from {
    background-color: rgba(0, 0, 0, 0.65);
  }
  to {
    background-color: rgba(0, 0, 0, 0);
  }
}

@keyframes sheet-animate-reverse-rtl {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    right: -100%;
  }
 }
@keyframes sheet-animate-reverse-ltr {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    left: -100%;
  }
 }
@keyframes sheet-animate-reverse-btt {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    bottom: -100vh;
  }
 }
@keyframes sheet-animate-reverse-ttb {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    top: -100vh;
  }
 }
