/*
  Fullscreen Modal (used on mobile)
*/
@media (max-width: 419px) {
  body {
    &.modal-showing {
      overflow: hidden;
    }
  }

  .Ted-modal-overlay {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 101;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    background-color: rgba(255, 255, 255, .9);

    animation: fadeIn 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  }

  .Ted-modal {
    animation: slideUp 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    animation-delay: 0.15s;
    animation-fill-mode: backwards;   margin: 0!important;
    left: 0!important;
    top: 0!important;
    bottom: 0;
    position: relative;
    // display: table-cell;
    // display: inline-block;
    // width: 100%;
  }
}

/*
  Center Modal
*/
@media (min-width: 420px) {
  .ember-modal-wrapper {
    // position: fixed;
  }

  body {
    &.modal-showing {
      overflow: hidden;
    }
  }

  .Ted-modal-overlay {
    z-index: 101;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background-color: rgba(255, 255, 255, .9);
    animation: fadeIn 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    overflow: scroll;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
  }

  .Ted-modal {
    box-shadow: 0 22px 77px rgba(0, 0, 0, 0.34), 0 11px 22px rgba(0, 0, 0, 0.38);
    animation: fadeUp 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    margin: 60px 0 !important;
    left: initial !important;
    top: initial !important;
    position: relative;
    flex: 0 1 auto;
    width: 400px;
  }
}

/*
  Animations
*/
@keyframes slideUp {
  0% {
    transform: translateY(100vh);
  }
  100% {
    transform: translateY(0);
  }
}
@keyframes fadeUp {
  0% {
    opacity: 0;
    transform: translateY(15px);
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateY(0);
  }
}
@keyframes fadeIn {
  0% {
    background-color: rgba(255, 255, 255, 0);
  }
  100% {
    background-color: rgba(255, 255, 255, .9);
  }
}



/*
  Original styles (reference)
*/
// .ember-modal-wrapper {
//   // height: 100%;
//   // width: 100%;
//   // position: fixed;
//   // top: 0;
//   // left: 0;
//   // z-index: 200;

//   @media (min-width: 420px) {
//     position: fixed;
//   }
// }

// .modal-showing #modal-overlays {
//   // background: white;
//   @media (max-width: 419px) {
//     // height: 100%;
//     // position: relative;
//   }
// }

// body {
//   &.modal-showing {
//     overflow: hidden;
//   }
// }

// .Ted-modal-overlay {
//   z-index: 101;

//   @media (max-width: 419px) {
//     // animation: slideUp 0.5s cubic-bezier(0.19, 1, 0.22, 1);
//     // animation-delay: 0.01s;
//     // animation-fill-mode: backwards;
//     overflow-y: scroll;
//     -webkit-overflow-scrolling: touch;
//     position: fixed;
//     top: 0;
//     bottom: 0;
//     left: 0;
//     right: 0;

//     background-color: rgba(255, 255, 255, .94);
//     animation: fadeIn 0.5s cubic-bezier(0.19, 1, 0.22, 1);
//     // position: relative;
//     display: table;
//     // height: 100%;
//     // width: 100%;
//     // background-color: rgba(255, 255, 255, .94);
//   }

//   @media (min-width: 420px) {
//     display: flex;
//     justify-content: center;
//     align-items: flex-start;
//     background-color: rgba(255, 255, 255, .94);
//     animation: fadeIn 0.5s cubic-bezier(0.19, 1, 0.22, 1);
//     overflow: scroll;
//     height: 100%;
//   }
// }

// .Ted-modal {
//   @media (max-width: 419px) {
//     // animation: slideUp 0.5s cubic-bezier(0.19, 1, 0.22, 1);
//     // animation-delay: 0.15s;
//     // animation-fill-mode: backwards;   margin: 0!important;
//     left: 0!important;
//     top: 0!important;
//     bottom: 0;
//     position: relative;
//     // overflow-y: scroll;
//     // -webkit-overflow-scrolling: touch;
//     display: table-cell;
//     // min-height: 100%;
//   }

//   @media (min-width: 420px) {
//     box-shadow: 0 22px 77px rgba(0, 0, 0, 0.34), 0 11px 22px rgba(0, 0, 0, 0.38);
//     animation: fadeUp 0.5s cubic-bezier(0.19, 1, 0.22, 1);
//     margin: 60px 0 !important;
//     left: initial !important;
//     top: initial !important;
//     position: relative;
//     flex: 0 1 auto;
//     width: 400px;
//   }
// }
// @keyframes slideUp {
//   0% {
//     transform: translateY(100vh);
//   }
//   100% {
//     transform: translateY(0);
//   }
// }
// @keyframes fadeUp {
//   0% {
//     opacity: 0;
//     transform: translateY(5vh);
//   }
//   50% {
//     opacity: 1;
//   }
//   100% {
//     transform: translateY(0);
//   }
// }
// @keyframes fadeIn {
//   0% {
//     opacity: 0;
//   }
//   100% {
//     opacity: 1;
//   }
// }
