//
// Modals
// --------------------------------------------------

// .modal-open      - body class for killing the scroll
// .modal           - container to scroll within
// .modal-dialog    - positioning shell for the actual modal
// .modal-content   - actual modal w/ bg and corners and shit

// Kill the scroll on the body
.modal-open {
  overflow: hidden;
}

// Container that the modal scrolls within
.modal {
  display: none;
  overflow: auto;
  overflow-y: scroll;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: @zindex-modal;
  -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 modal, animate it to slide down
  &.fade .modal-dialog {
    .translate(0, -25%);
    .transition-transform(~"0.3s ease-out");
  }
  &.in .modal-dialog { .translate(0, 0)}
}

// Shell div to position the modal with bottom padding
.modal-dialog {
  position: relative;
  width: auto;
  margin: 10px;
}

// Actual modal
.modal-content {
  position: relative;
  color: @modal-text-color;
  background-color: @modal-content-bg;
  // border: 1px solid @modal-content-fallback-border-color; //old browsers fallback (ie8 etc)
  //Modal outline shadow
  -moz-box-shadow:    0px 0px 2px 0px rgba(red(@genesys-grey1), green(@genesys-grey1), blue(@genesys-grey1), 0.24);
  -webkit-box-shadow: 0px 0px 2px 0px rgba(red(@genesys-grey1), green(@genesys-grey1), blue(@genesys-grey1), 0.24);
  box-shadow:         0px 0px 2px 0px rgba(red(@genesys-grey1), green(@genesys-grey1), blue(@genesys-grey1), 0.24);
  border-radius: @border-radius-base;
  // .box-shadow(0 3px 9px rgba(0,0,0,.5));
  background-clip: padding-box;
  // Remove focus outline from opened modal
  outline: none;
  padding-left: @modal-side-inner-padding;
  padding-right: @modal-side-inner-padding;
  padding-top: @modal-side-inner-padding;
  padding-bottom: @modal-bottom-inner-padding;
}

.modal-content > div {
  padding-right: @modal-inner-padding;
  padding-left: @modal-inner-padding;
}

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

// Modal header
// Top section of the modal w/ title and dismiss
.modal-header {
  // padding: @modal-title-padding;
  // border-bottom: 1px solid @modal-header-border-color;
  min-height: (@modal-title-padding + @modal-title-line-height);
  margin-bottom: 12px; //Space between title and body
}

// Top right close icon x
.modal-dialog-close {
  position: absolute;
  font-size: 13px;
  top: 8px;
  right: 8px;
  margin-top: 8px;
  margin-right: 8px;
  opacity: 1;//override original close opacity
  text-align: center;
  vertical-align: middle;
}

.modal-dialog-close:hover {
  opacity: 1; //Override .close change
}

.header-message-container {
  height: 40px;
}

.header-message-container > * {
  float: left;
}

.header-message-container > span {
  margin-top: -7px; //Add Offset so it aligns perfectly
  padding-right: 16px;
  font-size: 28.3px;
}

// Title text within header
.modal-title {
  margin: 0;
  line-height: @modal-title-line-height;
}

// Modal body
// Where all modal content resides (sibling of .modal-header and .modal-footer)
.modal-body {
  position: relative;
}

// Footer (for actions)
.modal-footer {
  margin-top: 24px;
  // padding: (@modal-inner-padding - 1) @modal-inner-padding @modal-inner-padding;
  text-align: center; // right align buttons
  // border-top: 1px solid @modal-footer-border-color;
  &:extend(.clearfix all); // clear it in case folks use .pull-* classes on buttons

  .btn {
    float: left;
  }
  // Properly space out buttons
  .btn + .btn {
    float: right;
  }
  // but override that for button groups
  .btn-group .btn + .btn {
    margin-left: -1px;
  }
  // and override it for block buttons as well
  .btn-block + .btn-block {
    margin-left: 0;
  }
}

// New theme / design
.modal-content-new {
  position: relative;
  color: @modal-text-color;
  background-color: @modal-content-bg;
  // border: 1px solid @modal-content-fallback-border-color; //old browsers fallback (ie8 etc)
  //Modal outline shadow
  -moz-box-shadow:    0px 0px 2px 0px rgba(red(@genesys-grey1), green(@genesys-grey1), blue(@genesys-grey1), 0.24);
  -webkit-box-shadow: 0px 0px 2px 0px rgba(red(@genesys-grey1), green(@genesys-grey1), blue(@genesys-grey1), 0.24);
  box-shadow:         0px 0px 2px 0px rgba(red(@genesys-grey1), green(@genesys-grey1), blue(@genesys-grey1), 0.24);
  border-radius: @border-radius-base;
  // .box-shadow(0 3px 9px rgba(0,0,0,.5));
  background-clip: padding-box;
  // Remove focus outline from opened modal
  outline: none;
  padding-left: @modal-side-inner-padding;
  padding-right: @modal-side-inner-padding;
  padding-top: @modal-side-inner-padding;
  padding-bottom: @modal-bottom-inner-padding-new;

  > div {
    padding-right: @modal-inner-padding-new;
    padding-left: @modal-inner-padding-new;
  }

  .modal-header {
    margin-left:  -@modal-side-inner-padding; // used to 'remove' the padding from modal-content
    margin-right:  -@modal-side-inner-padding;
    margin-top: -@modal-side-inner-padding;
    min-height: (@modal-title-padding + @modal-title-line-height);
    margin-bottom: 25px; //Space between title and body
    background-color: black;
    color: white;
    padding-top: @modal-header-top-bottom-padding;
    padding-bottom: @modal-header-top-bottom-padding;
    padding-left: @modal-header-side-padding;
    padding-right: @modal-header-side-padding;
  }

  .modal-dialog-close {
    color:white;
    right: 20px;
    font-size: 20px;
    display:inline-block;
    line-height:normal;
    float:none;
    text-shadow:none;
    position: absolute;
    opacity: 1;//override original close opacity
    text-align: center;
    vertical-align: middle;
    top: auto;
  }

  .modal-title {
    margin: 0;
    line-height: @modal-title-line-height;
  }
}

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

  // Modal sizes
  .modal-sm { width: @modal-sm; }
}

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