//
// Toasts
// --------------------------------------------------

// .toast           - container to scroll within
// .toast-dialog    - positioning shell for the actual toast
// .toast-content   - actual toast w/ bg and corners and shit

// Container that the toast scrolls within
.toast {
  display: none;
  overflow: hidden;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: $zindex-toast;
  -webkit-overflow-scrolling: touch;

  // Prevent Chrome on Windows from adding a focus outline. For details, see
  // https://github.com/twbs/bootstrap/pull/10951.
  outline: 0;

  // When fading in the toast, animate it to slide up
  &.fade .toast-dialog {
    @include translate(0, 25%);
    @include transition-transform(0.3s ease-out);
  }
  &.in .toast-dialog { @include translate(0, 0) }
}
.toast-open .toast {
  overflow-x: hidden;
  overflow-y: hidden;
}

// Shell div to position the toast with bottom padding
.toast-dialog {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;  
  width: auto;
  margin: 10px;
}

// Actual toast
.toast-content {
  position: relative;
  color: #fff;
  background-color: $toast-content-bg;
  border: 1px solid $toast-content-fallback-border-color; //old browsers fallback (ie8 etc)
  border: 1px solid $toast-content-border-color;
  border-radius: $toast-border-radius-base;
  @include box-shadow(0 3px 9px rgba(0,0,0,.5));
  background-clip: padding-box;
  text-align: center;
  // Remove focus outline from opened toast
  outline: 0;
}

// Toast background
.toast-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: $zindex-toast-background;
  background-color: $toast-backdrop-bg;
  // Fade for backdrop
  &.fade { @include opacity(0); }
  &.in { @include opacity($toast-backdrop-opacity); }
}

// Toast body
// Where all toast content resides (sibling of .toast-header and .toast-footer)
.toast-body {
  position: relative;
  padding: $toast-inner-padding;
}

// Measure scrollbar width for padding body during toast show/hide
.toast-scrollbar-measure {
  position: absolute;
  top: -9999px;
  width: 50px;
  height: 50px;
  overflow: scroll;
}

// Scale up the toast
@media (min-width: $screen-sm-min) {
  // Automatically set toast's width for larger viewports
  .toast-dialog {
    width: $toast-md;
    margin: 30px auto;
  }
  .toast-content {
    @include box-shadow(0 5px 15px rgba(0,0,0,.5));
  }

  // Toast sizes
  .toast-sm { width: $toast-sm; }
}

@media (min-width: $screen-md-min) {
  .toast-lg { width: $toast-lg; }
}

// Styles for the toast
.toast-round {
  .toast-content {
    border-radius: $toast-border-radius-round-base;
  }  
}
.toast-square {
  .toast-content {
    border-radius: 0;
  }   
}
.toast-default {
  .toast-content {
    border-radius: $toast-border-radius-base;
  }   
}
