/***************************/
/*         Reset           */
/***************************/

a:focus{
  outline: none;
}

/***************************/
/*          Type           */
/***************************/

ul, ol {
  margin: 0;
}

hr {
  border-top: none;
}

blockquote{

  &.blockquote-sm{
    padding: 0 0 0 15px;
    font-size: $font-size-base;
  }
  p{
    font-size: inherit;
    margin-bottom: $line-height-computed / 2;
  }
}

h1 { font-size: $font-size-base * 2.75; } // ~38px
h2 { font-size: $font-size-base * 2.25; } // ~32px
h3 { font-size: $font-size-base * 1.75; } // ~24px
h4 { font-size: $font-size-base * 1.25; } // ~18px
h5 { font-size: $font-size-base; }
h6 { font-size: $font-size-base * 0.85; } // ~12px

h1 small { font-size: $font-size-base * 1.75; } // ~24px
h2 small { font-size: $font-size-base * 1.25; } // ~18px
h3 small { font-size: $font-size-base; }
h4 small { font-size: $font-size-base; }

.text-primary        { color: $brand-primary; }
.text-warning        { color: $brand-warning; }
.text-danger         { color: $brand-danger; }
.text-success        { color: $brand-success; }
.text-info           { color: $brand-info; }

@media (min-width: 768px) {
  .lead {
    font-size: 16px;
  }
}

/***************************/
/*         Code            */
/***************************/

code,
pre {
  border-radius: $border-radius-base;
}

/***************************/
/*         Forms           */
/***************************/

label,
input,
button,
select,
textarea {
  font-weight: $font-weight-base;
}

legend small{
  color: $text-muted;
  font-size: $font-size-larger;
}

.form-control{
  @include transition(border linear .2s, box-shadow linear .2s);

  &[type=search], &.search{
    padding-left: 26px;
  }
}

select:focus,
input[type="file"]:focus,
input[type="radio"]:focus,
input[type="checkbox"]:focus {
  outline: none;
}

.input-group-btn > .btn{
  z-index: 2;
}

/*adding .btn-group here because selectpicker's select become .btn-group
  need some more vertical space*/
.btn-group,
input,
select,
textarea,
.uneditable-input,
.input-prepend,
.input-append {
  + .help-block {
    margin-top: $line-height-computed / 4;
  }
}

.help-block {
  margin-top: 0;
  font-size: $font-size-small - 1;
  color: $text-muted;
}

.search-query, .navbar-form .search-query{
  border-radius: $border-radius-base;
  line-height: $line-height-computed;
}

.form-horizontal{
  input,
  select,
  textarea,
  .uneditable-input,
  .input-prepend,
  .input-append {
    + .help-block {
      margin-top: $line-height-computed / 4;
    }
  }
}

.form-group{
  margin-bottom: $line-height-computed;
}

.form-horizontal.form-label-left {
  @media (min-width: $screen-sm-min) {
    .control-label {
      text-align: left;
    }
  }
}

/***************************/
/*      Input Groups       */
/***************************/
.input-group-addon {
  color: $text-muted;
}

/***************************/
/*        Tables        */
/***************************/

.table .table{
  background-color: $bg-addition;
}

.table-hover {
  tbody {
    td, th{
      @include transition(background-color .2s);
    }
  }
}

.table thead > tr > th{
  border-bottom: none;
  font-weight: 600;
  text-transform: uppercase;
  border-bottom-width: 1px;
}

.table td > .checkbox,
.table th > .checkbox{
  position: relative;
  left: 3px;
  margin-top: 0;
  margin-bottom: 0;
  padding-left: 0;
  > label:before,
  > label:after{
    margin-left: 0;
  }
}

.table > thead > tr > th{
  font-weight: $font-weight-semi-bold;
  text-transform: uppercase;
  border-bottom-width: 1px;
}

.table-lg {
  > thead,
  > tbody,
  > tfoot {
    > tr {
      > th,
      > td {
        padding: 10px;
      }
    }
  }
}

.table-sm {
  > thead,
  > tbody,
  > tfoot {
    > tr {
      > th,
      > td {
        padding: 6px;
      }
    }
  }
}


/***************************/
/*        Dropdowns        */
/***************************/

.dropdown-menu{
  border-radius: $border-radius-large;
}

.dropdown-menu > li > a {
  font-weight: $font-weight-base;
}

/***************************/
/*      Buttons            */
/***************************/

.btn:focus {
  outline: none;
}

.btn{
  color: $white;
  text-shadow: none;

  @include box-shadow(none);

  &:hover,
  &:focus {
    color: $white;
    @include box-shadow(inset 0 1px 5px rgba(0, 0, 0, 0.08));
  }

  &.active:hover{
    color: $white;
    @include box-shadow(inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05));
  }

  &.disabled,
  &[disabled] {
    color: $white;
  }

  .caret{
    border-top-color: #fff;
  }
}


/***************************/
/*      Button Groups      */
/***************************/

.btn-group > .btn + .btn {
  margin-left: 0;
}

.btn-group > .btn:hover,
.btn-group > .btn:focus,
.btn-group > .btn:active,
.btn-group > .btn.active {
  z-index: auto;
}

.btn-group > .btn + .dropdown-toggle {
  @include box-shadow(none);
}

.btn-toolbar {
  font-size: 0; // Hack to remove whitespace that results from using inline-block
  margin-top: $line-height-base / 2;
  margin-bottom: $line-height-base / 2;
  > .btn + .btn,
  > .btn-group + .btn,
  > .btn + .btn-group {
    margin-left: 5px;
  }
}

/***************************/
/*        TABBABLE         */
/***************************/
// copied from bs2


// COMMON STYLES
// -------------

// Clear any floats
.tabbable {
  @include clearfix();
}
.tab-content {
  overflow: auto; // prevent content from running below tabs
}

// Remove border on bottom, left, right
.tabs-below > .nav-tabs,
.tabs-right > .nav-tabs,
.tabs-left > .nav-tabs {
  border-bottom: 0;
}

// Show/hide tabbable areas
.tab-content > .tab-pane,
.pill-content > .pill-pane {
  display: none;
}
.tab-content > .active,
.pill-content > .active {
  display: block;
}


// BOTTOM
// ------

.tabs-below > .nav-tabs > li {
  margin-top: -1px;
  margin-bottom: 0;
}
.tabs-below > .nav-tabs > li > a {
  border-radius: 0 0 $border-radius-base $border-radius-base;
  &:hover,
  &:focus {
    border-bottom-color: transparent;
    border-top-color: #ddd;
  }
}
.tabs-below > .nav-tabs > .active > a,
.tabs-below > .nav-tabs > .active > a:hover,
.tabs-below > .nav-tabs > .active > a:focus {
  border-color: $nav-tabs-active-item-border;
  border-top-color: $nav-tabs-active-item-border-bottom;
}

// LEFT & RIGHT
// ------------

// Common styles
.tabs-left > .nav-tabs > li,
.tabs-right > .nav-tabs > li {
  float: none;
}
.tabs-left > .nav-tabs > li > a,
.tabs-right > .nav-tabs > li > a {
  min-width: 74px;
  margin-right: 0;
  margin-bottom: 3px;
}

// Tabs on the left
.tabs-left > .nav-tabs {
  float: left;
  margin-right: 19px;
  border-right: 1px solid #ddd;
}
.tabs-left > .nav-tabs > li > a {
  margin-right: -1px;
  border-radius: $border-radius-base 0 0 $border-radius-base;
}
.tabs-left > .nav-tabs > li > a:hover,
.tabs-left > .nav-tabs > li > a:focus {
  border-color: $gray-lighter #ddd $gray-lighter $gray-lighter;
}
.tabs-left > .nav-tabs .active > a,
.tabs-left > .nav-tabs .active > a:hover,
.tabs-left > .nav-tabs .active > a:focus {
  border-color: #ddd transparent #ddd #ddd;
}

// Tabs on the right
.tabs-right > .nav-tabs {
  float: right;
  margin-left: 19px;
  border-left: 1px solid #ddd;
}
.tabs-right > .nav-tabs > li > a {
  margin-left: -1px;
  border-radius: 0 $border-radius-base $border-radius-base 0;
}
.tabs-right > .nav-tabs > li > a:hover,
.tabs-right > .nav-tabs > li > a:focus {
  border-color: $gray-lighter $gray-lighter $gray-lighter #ddd;
}
.tabs-right > .nav-tabs .active > a,
.tabs-right > .nav-tabs .active > a:hover,
.tabs-right > .nav-tabs .active > a:focus {
  border-color: #ddd #ddd #ddd transparent;
}

/***************************/
/*          Navs           */
/***************************/

.nav {
  margin-bottom: 0;

  .open > a {
    &,
    &:hover,
    &:focus {
      background-color: $nav-link-hover-bg;
      border-color: transparent;
    }
  }
}

.nav > li > a{
  @include transition(background-color .2s);
}

.nav > li > a:hover,
.nav > li > a:focus,
.nav .open > a,
.nav .open > a:hover,
.nav .open > a:focus{
  background-color: rgba($widget-bg-common, .25);
}

.nav-tabs > li > a {
  border-radius: $border-radius-base $border-radius-base 0 0;
  color: $nav-tabs-link-color;
  padding-top: 8px;
  padding-bottom: 8px;
  &:hover,
  &:focus {
    border-color: transparent;
  }
}

.nav-tabs > .active{
  margin-bottom: $nav-tabs-active-item-margin;
}

.nav-tabs{
  border-bottom: $nav-tabs-border;
}

.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
  color: $widget-color;
  background-color: $nav-tabs-tab-content-bg;
  border-color: $nav-tabs-active-item-border;
  border-bottom-color: $nav-tabs-active-item-border-bottom;
}

.nav-tabs .dropdown-menu {
  border-radius: 0 0 $border-radius-base $border-radius-base; // remove the top rounded corners here since there is a hard edge above the menu
}
.nav-pills .dropdown-menu {
  border-radius: $border-radius-base; // make rounded corners match the pills
}
.tabs-below > .nav-tabs {
  border-top: $nav-tabs-border;
}

.tabs-below > .nav-tabs > li > a {
  border-radius: 0 0 $border-radius-base $border-radius-base;
}

.tabs-left > .nav-tabs {
  margin-right: 0;
  border-right: $nav-tabs-border;
}

.tabs-left > .nav-tabs > li > a {
  border-radius: $border-radius-base 0 0 $border-radius-base;
}

.tabs-right > .nav-tabs {
  margin-left: 0;
  border-left: $nav-tabs-border;
}
.tabs-right > .nav-tabs > li > a {
  border-radius: 0 $border-radius-base $border-radius-base 0;
}

.tabs-below > .nav-tabs > li {
  margin-top: $nav-tabs-active-item-margin;
}

.tabs-below > .nav-tabs > li > a {
  &:hover,
  &:focus {
    border-top-color: transparent;
  }
}
.tabs-below > .nav-tabs > .active > a,
.tabs-below > .nav-tabs > .active > a:hover,
.tabs-below > .nav-tabs > .active > a:focus {
//  border-color: transparent;
}

.tabs-left > .nav-tabs > li > a {
  margin-right: 0;
}
.tabs-left > .nav-tabs > li > a:hover,
.tabs-left > .nav-tabs > li > a:focus {
  border-color: transparent;
}
.tabs-left > .nav-tabs .active > a,
.tabs-left > .nav-tabs .active > a:hover,
.tabs-left > .nav-tabs .active > a:focus {
  border-color: $nav-tabs-active-item-border;
  border-right-color: $nav-tabs-active-item-border-bottom;
}

.tabs-left > .nav-tabs .active{
  margin-right: $nav-tabs-active-item-margin;
}

.tabs-right > .nav-tabs .active{
  margin-left: $nav-tabs-active-item-margin;
}

.tabs-right > .nav-tabs > li > a {
  margin-left: 0;
}
.tabs-right > .nav-tabs > li > a:hover,
.tabs-right > .nav-tabs > li > a:focus {
  border-color: transparent;
}
.tabs-right > .nav-tabs .active > a,
.tabs-right > .nav-tabs .active > a:hover,
.tabs-right > .nav-tabs .active > a:focus {
  border-color: $nav-tabs-active-item-border;
  border-left-color: $nav-tabs-active-item-border-bottom;
}

.nav-pills > li > a {
  margin-top: 2px;
  margin-bottom: 2px;
  border-radius: $border-radius-base;
  background: $bg-addition;
}

// Active state
.nav-pills > li.active > a,
.nav-pills > li.active > a:hover,
.nav-pills > li.active > a:focus {
  color: $widget-header-color;
  background: none;
}

.nav-justified > li {
  padding: 0 1.28%;
}

/***************************/
/*         Navbars         */
/***************************/

.navbar{
  margin: 0;

  .btn-navbar {
    border: none;
    @include box-shadow(none);
  }
}

// Active nav items
.navbar .nav > .active > a,
.navbar .nav > .active > a:hover,
.navbar .nav > .active > a:focus {
  background: none;
  @include box-shadow(none);
}

.navbar-nav {
  margin: ($navbar-padding-vertical / 2) -$navbar-padding-horizontal;

  > li > a {
    padding-top:    10px;
    padding-bottom: 10px;
    line-height: $line-height-computed;
  }

  @media (max-width: $screen-xs-max) {
  // Dropdowns get custom display when collapsed
    .open .dropdown-menu {
      position: absolute;
      float: left;
      margin: 2px 0 0;
      background-color: $popover-bg;
      border: 0;
      box-shadow: none;
    }
  }
}

/***************************/
/*       Breadcrumbs       */
/***************************/

.breadcrumb{
  a{
    color: $breadcrumb-color;
    text-decoration: none;
    &:hover{
      color: $breadcrumb-active-color;
    }
  }

  .content > &{
    padding-left: 0;
    padding-right: 0;
    margin-top: 11px;
    margin-bottom: 9px;
  }
}

/***************************/
/*        Pagination       */
/***************************/
.pagination{
  font-weight: $font-weight-normal;

  > li {
    display: inline; // Remove list-style and block-level defaults
    > a,
    > span{
      border-radius: $border-radius-base;
      margin: 0 2px;
    }
  }
}

/***************************/
/*         Modals          */
/***************************/

.modal {
  color: $gray-dark;
  border-radius: $border-radius-base;

  h1,h2,h3,h4,h5,h6{
    color: $gray-dark;
  }
}

.modal-footer{
  background-color: #f5f5f5;
}

/***************************/
/*        Tooltips         */
/***************************/

.tooltip {
  font-size: $font-size-small;
}

.tooltip-inner {
  padding: 4px;
  white-space: nowrap;
}

/***************************/
/*        Popovers         */
/***************************/

.popover {
  color: $text-color;
  border-radius: $border-radius-base;
  h1,h2,h3,h4,h5,h6{
    color: $text-color;
  }
}

.popover-title {
  border-radius: $border-radius-base $border-radius-base 0 0;
}

/***************************/
/*       Thumbnails        */
/***************************/

.thumbnail {
  border: none;
  @include box-shadow(none);

  .widget &{
    border: $thumbnail-border;
  }
}

.thumbnail .caption {
  color: $widget-color;
}

/***************************/
/*    Labels and badges    */
/***************************/

.label,
.badge {
  display: inline-block;
  padding: 4px 8px;
  line-height: 14px; // ensure proper line-height if floated
  text-shadow: none;
  font-weight: $font-weight-semi-bold;
  font-size: $font-size-small - 1;
  margin: 0 0.61rem;
}

.badge{
  padding: 4px 8px;
}

.badge-default {
  @include label-variant($label-default-bg);
}

.badge-primary {
  @include label-variant($label-primary-bg);
}

.badge-success {
  @include label-variant($label-success-bg);
}

.badge-info {
  @include label-variant($label-info-bg);
}

.badge-warning {
  @include label-variant($label-warning-bg);
}

.badge-danger {
  @include label-variant($label-danger-bg);
}

.label-important{
  @extend .label-danger;
}

.label-inverse{
  @extend .label-default;
}

.icons-page .label.label-danger {
  display: inline!important;
}

/***************************/
/*        Jumbotron        */
/***************************/

.jumbotron{
  .widget > &{
    margin: (-$widget-padding-vertical) (-$widget-padding-horizontal);
  }

  h1, .h1{
    line-height: 1;
  }
}

/***************************/
/*          Alerts         */
/***************************/

.alert {
  text-shadow: none;
  font-weight: normal;
}

.close{
  @include transition(opacity .2s ease-out);
  text-shadow: none;
}

.alert-sm{
  padding: 10px 12px;
  font-size: $font-size-small;

  .close{
    font-size: 18px;
  }
}


/***************************/
/*        List Groups      */
/***************************/

.list-group{
  margin-bottom: 0;
  .widget > &{
    margin: (-$widget-padding-vertical) (-$widget-padding-horizontal);
  }
  .widget .body > &{
    margin: 0 (-$widget-padding-horizontal) (-$widget-padding-vertical);

    .list-group-item:first-child{
      border-top: 1px solid $bg-addition;
    }
  }
}

.list-group-item{
  border: none;
  @include transition(background-color .2s ease-out);
  color: $widget-color;

  .widget &{
    background: none;
    + .list-group-item{
      border-top: 1px solid $bg-addition;
    }
  }

  .list-group-outer &{
    + .list-group-item{
      margin-top: 10px;
    }
  }

  > .fa-chevron-right{
    margin-top: 3px;
    margin-left: 6px;
    color: darken($text-color, 5%);
  }
}
.list-group-item{

  .list-group-lg & {
    padding: 15px 15px;
  }

  .list-group:last-of-type &:last-child{
    border-bottom: 0;
  }
}


/***************************/
/*         Progress        */
/***************************/

.progress{
  background: rgba(black, .15);
}

.progress-sm{
  height: 10px;
  margin-bottom: $line-height-computed/2;
}

.progress-xs{
  height: 5px;
  margin-bottom: $line-height-computed/2;
}

/***************************/
/*          Panels         */
/***************************/

.panel-heading {
  padding: 0;

  > .accordion-toggle{
    display: block;
    padding: 8px 15px;
  }
}

.panel-group {
  .panel-heading {
    + .panel-collapse .panel-body {
      border-top: 1px solid $bg-addition;
    }
  }
  .panel-footer {
    + .panel-collapse .panel-body {
      border-bottom: 1px solid $bg-addition;
    }
  }
}

.panel{
  border: none;
  background-color: $widget-bg;
  @include box-shadow(none);

  .content &{
    color: $widget-color;
  }

  .panel-heading a{
    color: $widget-header-color;
    font-weight: $font-weight-base;

    &:focus{
      text-decoration: none;
    }
    &.collapsed{
      color: $text-muted;
    }

    &[data-toggle="collapse"]{
      &:before{
        display: inline-block;
        font-family: FontAwesome;
        content: "\f107";
        float: right;
        margin-right: -8px;
        position: relative;
        top: 1px;
        @include transition(transform .3s ease-in-out)
      }
      &.collapsed:before{
        transform: rotate(90deg);
      }
    }
  }
}

.panel-body{
  border-top-color: $bg-addition;
}

/***************************/
/*          Wells          */
/***************************/

.well{
  @include box-shadow(none);
}
