// Text input groups
// -------------------------


@import "../bootstrap/input-groups.less";


.input-group-addon {
  padding: @input-addon-padding-base-vertical @input-addon-padding-base-horizontal;
  font-size: @input-addon-font-size-base;
  color: @input-color;
  background-color: @input-group-addon-bg;
  border: @input-group-addon-border;
  border-radius: @input-border-radius;

  // Sizing  
  &.input-sm {
    padding: @input-addon-padding-small-vertical @input-addon-padding-small-horizontal;
    font-size: @input-addon-font-size-small;
    border-radius: @input-border-radius-small;
  }
  &.input-lg {  
    padding: @input-addon-padding-large-vertical @input-addon-padding-large-horizontal;
    font-size: @input-addon-font-size-large;
    border-radius: @input-border-radius-large;
  }
}

.input-group-addon:first-child{
    border-left: @input-group-addon-border;
}
.input-group-addon:last-child{
    border-right: @input-group-addon-border;
}

// Button input groups
// -------------------------
.input-group-btn {
  .btn {
    min-width: 0 !important;
    padding-left: @input-btn-padding-base-horizontal; 
    padding-right: @input-btn-padding-base-horizontal;
    & + .dropdown-toggle {
        padding-left: 8px;
        padding-right: 8px;  
    }
  }
}

//
// RTL Input groups
// --------------------------------------------------
.rtl-body{


    // Base styles
    // -------------------------
    .input-group {
      .form-control {
        // IE9 fubars the placeholder attribute in text inputs and the arrows on
        // select elements in input groups. To fix it, we float the input. Details:
        // https://github.com/twbs/bootstrap/issues/11561#issuecomment-28936855
        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 {
      .border-left-radius(0);
    }

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

    .input-group-addon {
        &:first-child{
            border-left: 0px;
            border-right: @input-group-addon-border;
        }
    }
    .input-group{
        &.input-group-sm .form-control:first-child,
        &.input-group-sm .input-group-addon:first-child,
        &.input-group-sm .input-group-btn:first-child > .btn:first-child,
        &.input-group-sm .input-group-btn:first-child > .btn-group:first-child > .btn:first-child {
          .border-right-radius(@input-border-radius-small);
        }    
        &.input-group-lg .form-control:first-child,
        &.input-group-lg .input-group-addon:first-child,
        &.input-group-lg .input-group-btn:first-child > .btn:first-child,
        &.input-group-lg .input-group-btn:first-child > .btn-group:first-child > .btn:first-child {
          .border-right-radius(@input-border-radius-large);
        } 
    }

    .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:not(:first-child),
    .input-group-btn:first-child > .btn-group:not(:first-child) > .btn {
      .border-right-radius(0);   
    }

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

    .input-group-addon {
        &:last-child{
            border-left: @input-group-addon-border;
            border-right: 0px;
        }
    }
    .input-group{
        &.input-group-sm .form-control:last-child,
        &.input-group-sm .input-group-addon:last-child,
        &.input-group-sm .input-group-btn:last-child > .btn:last-child,
        &.input-group-sm .input-group-btn:last-child > .btn-group:last-child > .btn:last-child {
          .border-left-radius(@input-border-radius-small);
        }
        &.input-group-lg .form-control:last-child,
        &.input-group-lg .input-group-addon:last-child,
        &.input-group-lg .input-group-btn:last-child > .btn:last-child,
        &.input-group-lg .input-group-btn:last-child > .btn-group:last-child > .btn:last-child {
          .border-left-radius(@input-border-radius-large);
        } 
    }

    // 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;
        }
      }
    }


}