// base styles for every modal popup used in Discourse

.modal-open #main {overflow:hidden;}

.modal-middle-container {
  margin-top: 10%;
  max-width: 100%;
  margin-bottom: 30px; // For iOS Safari issues
}

// Hardcode to be the same as before for now. I would recommend not using bootbox, or finding a way so the html structure can be the same
.bootbox.modal {
  position: fixed;
  top: 10%;
  z-index: 1050;
  overflow: auto;
  width: 100%;
  height: auto;
  background-color: $secondary;
  border: 1px solid rgba(0, 0, 0, 0.3);

  @include border-radius-all (6px);
  box-shadow: 0 3px 7px rgba(0,0,0, 0.3);
  background-clip: padding-box;
}

.modal.fade {
  transition: opacity .3s linear, top .3s ease-out;
  top: -25%;
}
.modal.fade.in {
  top: 50%;
}
.modal-body {
  overflow-y: auto;
  max-height: 400px;
  padding: 10px 0 10px 10px;
  width: 95%;
}

// an ember metamorph is inserted between btn's sometimes, breaking this rule, but only on mobile for some reason:
// .modal-footer .btn + .btn {
.modal-footer .btn {
  margin-right: 5px;
  margin-bottom: 5px;
}
.modal-footer .btn-group .btn + .btn {
  margin-left: -1px;
}

.modal-footer span.hint { display: none; }

.modal-header {
  // we need tighter spacing on mobile for header
  // this clearfix under the modal title h3 pushes it way down
  .clearfix {
    display:none;
  }
  h3 {
    font-size: 1.286em;
    padding-left: 15px;
    margin-bottom: 5px;
  }
}
.close {
  float: right;
  font-size: 1.714em;
  padding: 10px 15px 5px 5px;
  margin: -15px 0 0 0;
  color: $primary;
}

#move-selected {
  p {
    margin-top: 0;
  }

  input[type=radio] {
    margin-right: 10px;
  }

  button {
    margin-top: 10px;
    display: block;
    width: 300px;
  }

  form {
    margin-top: 20px;
    input[type=text] {
      width: 500px;
    }
  }
}

.flag-modal {
  max-height: 450px;
}

.custom-message-length {
  margin: -10px 0 10px 20px;
  color: dark-light-choose(scale-color($primary, $lightness: 30%), scale-color($secondary, $lightness: 70%));
  font-size: 85%;
}

.flag-message {
  margin-left: 20px;
  width: 95% !important;
}

.edit-category-modal {
  .modal-body {
    position: relative;
    height: 350px;
  }
  &.small .modal-body {
    height: 310px;
  }
  .secure-category-options {
    margin: 10px 0 0 16px;
    .badge-list {
      margin: 10px 0;
      li {
        margin: 0 4px 8px 0;
        a {
          color: #888;
          cursor: pointer;
        }
      }
    }
  }
}

.tabbed-modal {
  .modal-body {
    position: relative;
    height: 350px;
  }
}


.modal-tab {
  position: absolute;
}

/* fixes for the new account confirm dialog on mobile */

.modal-inner-container {
  margin-bottom: 20px;
}

.alert {
  padding: 5px;
  &.alert-success {
    background-color:  scale-color($success, $lightness: 90%);
    color: $success;
  }
}

.delete-flag-modal, .agree-flag-modal {
  .modal-inner-container {
    width: 300px;
  }
  .btn {
    float: none !important;
  }
}

#search-help {
  max-width: 300px;
}

#search-help h2 {
  margin: 0;
  font-size: 0.857em;
}

#search-help p {
 margin: 5px;
}
