//
// Input groups
// --------------------------------------------------

// Base styles
// -------------------------
.input-group {
  .form-control {
    float: right;
  }
}

// Reset rounded corners
.input-group .form-control:first-child,
.input-group-addon:first-child,
.input-group-btn:first-child > .btn,
.input-group-btn:first-child > .btn-group > .btn,
.input-group-btn:first-child > .dropdown-toggle,
.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),
.input-group-btn:last-child > .btn-group:not(:last-child) > .btn {
  @include border-right-radius($border-radius);
  @include border-left-radius(0);
}
.input-group-addon:first-child {
  border-left: 0px;
  border-right-style: solid;
  border-right-width: 1px;
}

.input-group .form-control:last-child,
.input-group-addon:last-child,
.input-group-btn:last-child > .btn,
.input-group-btn:last-child > .btn-group > .btn,
.input-group-btn:last-child > .dropdown-toggle,
.input-group-btn:first-child > .btn-group:not(:first-child) > .btn {
  @include border-left-radius($border-radius);
  @include border-right-radius(0);
}
.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),
.input-group-btn:first-child > .btn:not(:first-child){
  @include border-right-radius(0);
}

.input-group-addon:last-child {
  border-left-style: solid;
  border-left-width: 1px;
  border-right: 0px;
}

// Button input groups
// -------------------------
.input-group-btn {

  // Negative margin for spacing, position for bringing hovered/focused/actived
  // element above the siblings.
  > .btn {
    + .btn {
      margin-right: -1px;
      margin-left: auto;
    }
  }

  // Negative margin to only have a 1px border between the two
  &:first-child {
    > .btn,
    > .btn-group {
      margin-left: -1px;
      margin-right: auto;
    }
  }
  &:last-child {
    > .btn,
    > .btn-group {
      margin-right: -1px;
      margin-left: auto;
    }
  }
}
