// Modal

//
// Variables
//

@import "../variables";


//
// Base styles
//

joomla-modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1050;
  box-sizing: inherit;
  display: none;
  max-width: 500px;
  margin: 10px auto;
  overflow: hidden;
  border-radius: 5px;
  outline: 0;

  &.jviewport-width10 {
    width: 10vw;
    margin-left: -5vw;
  }
  &.jviewport-width20 {
    width: 20vw;
    margin-left: -10vw;
  }
  &.jviewport-width30 {
    width: 30vw;
    margin-left: -15vw;
  }
  &.jviewport-width40 {
    width: 40vw;
    margin-left: -20vw;
  }
  &.jviewport-width50 {
    width: 50vw;
    margin-left: -25vw;
  }
  &.jviewport-width60 {
    width: 60vw;
    margin-left: -30vw;
  }
  &.jviewport-width70 {
    width: 70vw;
    margin-left: -35vw;
  }
  &.jviewport-width80 {
    width: 80vw;
    margin-left: -40vw;
  }
  &.jviewport-width90 {
    width: 90vw;
    margin-left: -45vw;
  }
  &.jviewport-width100 {
    width: 100vw;
    margin-left: -50vw;
  }

  &.show {
    display: block;
  }

  .joomla-modal-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, .2);
    border-radius: .3rem;
    outline: 0;

    &.fade {
      opacity: 0;
      transition: opacity .15s linear;
    }

    &.fade.show {
      opacity: 1;
    }

    header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 15px;
      border-bottom: 1px solid #e9ecef;

      button {
        float: right;
        padding: 0;
        font-size: 1.5rem;
        font-weight: 700;
        line-height: 1;
        color: #000;
        text-shadow: 0 1px 0 #fff;
        cursor: pointer;
        background: 0 0;
        border: 0;
        opacity: .5;
        appearance: none;
      }

      h5 {
        margin-bottom: 0;
        font-size: 1.25rem;
        line-height: 1.5;
      }
    }

    section {
      position: relative;
      flex: 1 1 auto;
      padding: 15px;

      &.jviewport-height10 {
        height: 10vh;
      }
      &.jviewport-height20 {
        height: 20vh;
      }
      &.jviewport-height30 {
        height: 30vh;
      }
      &.jviewport-height40 {
        height: 40vh;
      }
      &.jviewport-height50 {
        height: 50vh;
      }
      &.jviewport-height60 {
        height: 60vh;
      }
      &.jviewport-height70 {
        height: 70vh;
      }
      &.jviewport-height80 {
        height: 80vh;
      }
      &.jviewport-height90 {
        height: 90vh;
      }
      &.jviewport-height100 {
        height: 100vh;
      }
    }

    section[class^="jviewport-height"],
    section[class*="jviewport-height"] {
      max-height: none;
    }

    footer {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      padding: 15px;
      border-top: 1px solid #e9ecef;

      .btn {
        margin-left: 10px;
      }
    }
  }
}

.modal-backdrop.show {
  opacity: .5;
}
.modal-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1040;
  background-color: #000;
}
