// See height set globally, depended on by buttons


md-toast {
  display: flex;
  position:absolute;
  z-index: $z-index-toast;

  box-sizing: border-box;
  align-items: center;

  min-height: 48px;
  padding-left: 24px;
  padding-right: 24px;

  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
  border-radius: 2px;
  font-size: 14px;
  cursor: default;

  height:auto;
  max-height: 7*$toast-height;
  max-width: 100%;

  overflow:hidden;

  &.md-capsule {
    border-radius: 24px;
  }

  opacity: 1;
  transform: translate3d(0,0,0) rotateZ(0deg);
  transition: $swift-ease-out;

  &.ng-leave-active {
    transition: $swift-ease-in;
  }

  /* Transition differently when swiping */
  &.md-swipeleft,
  &.md-swiperight,
  &.md-swipeup,
  &.md-swipedown {
    transition: $swift-ease-out;
  }

  &.ng-enter {
    transform: translate3d(0, 100%, 0);
    &.md-top {
      transform: translate3d(0, -100%, 0);
    }
    opacity: 0;
    &.ng-enter-active {
      transform: translate3d(0, 0, 0);
      opacity: 1;
    }
  }
  &.ng-leave.ng-leave-active {
    opacity: 0;
    transform: translate3d(0, 100%, 0);
    &.md-top {
      transform: translate3d(0, -100%, 0);
    }
    &.md-swipeleft {
      transform: translate3d(-100%, 0%, 0);
    }
    &.md-swiperight {
      transform: translate3d(100%, 0%, 0);
    }
  }

  .md-action {
    line-height: 19px;
    margin-left: 24px;
    cursor: pointer;
    text-transform: uppercase;
    float: right;

    &.md-button {
      min-width: 0;
    }
  }
}

@media (max-width: $layout-breakpoint-sm) {
  md-toast {
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-radius: 0;
    bottom: 0;
    &.md-top {
      bottom: auto;
      top: 0;
    }
  }
}
@media (min-width: $layout-breakpoint-sm) {
  md-toast {
    min-width: 288px;
    &.md-bottom {
      bottom: $toast-margin;
    }
    &.md-left {
      left: $toast-margin;
    }
    &.md-right {
      right: $toast-margin;
    }
    &.md-top {
      top: $toast-margin;
    }

    /*
     * When the toast doesn't take up the whole screen,
     * make it rotate when the user swipes it away
     */
    &.ng-leave.ng-leave-active {
      &.md-swipeleft {
        transform: translate3d(-100%, 25%, 0) rotateZ(-15deg);
      }
      &.md-swiperight {
        transform: translate3d(100%, 25%, 0) rotateZ(15deg);
      }
      &.md-top {
        &.md-swipeleft {
          transform: translate3d(-100%, 0, 0) rotateZ(-15deg);
        }
        &.md-swiperight {
          transform: translate3d(100%, 0, 0) rotateZ(15deg);
        }
      }
    }
  }
}

@media (min-width: $layout-breakpoint-lg) {
  md-toast {
    max-width: $baseline-grid * 71;
  }
}



@media screen and (-ms-high-contrast: active) {
  md-toast {
    border: 1px solid #fff;
  }
}
