/*!
 * Bootstrap v3.3.7 (http://getbootstrap.com)
 * Copyright 2011-2016 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 */

//
// Load core variables and mixins
// --------------------------------------------------

@import "variables";
@import "mixins";


//
// Buttons
// --------------------------------------------------

// Common styles
.#{$class-prefix}-btn-default,
.#{$class-prefix}-btn-primary,
.#{$class-prefix}-btn-success,
.#{$class-prefix}-btn-info,
.#{$class-prefix}-btn-warning,
.#{$class-prefix}-btn-danger {
  text-shadow: 0 -1px 0 rgba(0,0,0,.2);
  $shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 1px rgba(0,0,0,.075);
  @include box-shadow($shadow);

  // Reset the shadow
  &:active,
  &.#{$class-prefix}-active {
    @include box-shadow(inset 0 3px 5px rgba(0,0,0,.125));
  }

  &.#{$class-prefix}-disabled,
  &[disabled],
  .#{$class-prefix}-html-fieldset[disabled] & {
    @include box-shadow(none);
  }

  .#{$class-prefix}-badge {
    text-shadow: none;
  }
}

// Mixin for generating new styles
@mixin btn-styles($btn-color: #555) {
  @include gradient-vertical($start-color: $btn-color, $end-color: darken($btn-color, 12%));
  @include reset-filter; // Disable gradients for IE9 because filter bleeds through rounded corners; see https://github.com/twbs/bootstrap/issues/10620
  background-repeat: repeat-x;
  border-color: darken($btn-color, 14%);

  &:hover,
  &:focus  {
    background-color: darken($btn-color, 12%);
    background-position: 0 -15px;
  }

  &:active,
  &.#{$class-prefix}-active {
    background-color: darken($btn-color, 12%);
    border-color: darken($btn-color, 14%);
  }

  &.#{$class-prefix}-disabled,
  &[disabled],
  .#{$class-prefix}-html-fieldset[disabled] & {
    &,
    &:hover,
    &:focus,
    &.#{$class-prefix}-focus,
    &:active,
    &.#{$class-prefix}-active {
      background-color: darken($btn-color, 12%);
      background-image: none;
    }
  }
}

// Common styles
.#{$class-prefix}-btn {
  // Remove the gradient for the pressed/active state
  &:active,
  &.#{$class-prefix}-active {
    background-image: none;
  }
}

// Apply the mixin to the buttons
.#{$class-prefix}-btn-default { @include btn-styles($btn-default-bg); text-shadow: 0 1px 0 #fff; border-color: #ccc; }
.#{$class-prefix}-btn-primary { @include btn-styles($btn-primary-bg); }
.#{$class-prefix}-btn-success { @include btn-styles($btn-success-bg); }
.#{$class-prefix}-btn-info    { @include btn-styles($btn-info-bg); }
.#{$class-prefix}-btn-warning { @include btn-styles($btn-warning-bg); }
.#{$class-prefix}-btn-danger  { @include btn-styles($btn-danger-bg); }


//
// Images
// --------------------------------------------------

.#{$class-prefix}-thumbnail,
.#{$class-prefix}-img-thumbnail {
  @include box-shadow(0 1px 2px rgba(0,0,0,.075));
}


//
// Dropdowns
// --------------------------------------------------

.#{$class-prefix}-dropdown-menu > .#{$class-prefix}-html-li > .#{$class-prefix}-html-a:hover,
.#{$class-prefix}-dropdown-menu > .#{$class-prefix}-html-li > .#{$class-prefix}-html-a:focus {
  @include gradient-vertical($start-color: $dropdown-link-hover-bg, $end-color: darken($dropdown-link-hover-bg, 5%));
  background-color: darken($dropdown-link-hover-bg, 5%);
}
.#{$class-prefix}-dropdown-menu > .#{$class-prefix}-active > .#{$class-prefix}-html-a,
.#{$class-prefix}-dropdown-menu > .#{$class-prefix}-active > .#{$class-prefix}-html-a:hover,
.#{$class-prefix}-dropdown-menu > .#{$class-prefix}-active > .#{$class-prefix}-html-a:focus {
  @include gradient-vertical($start-color: $dropdown-link-active-bg, $end-color: darken($dropdown-link-active-bg, 5%));
  background-color: darken($dropdown-link-active-bg, 5%);
}


//
// Navbar
// --------------------------------------------------

// Default navbar
.#{$class-prefix}-navbar-default {
  @include gradient-vertical($start-color: lighten($navbar-default-bg, 10%), $end-color: $navbar-default-bg);
  @include reset-filter; // Remove gradient in IE<10 to fix bug where dropdowns don't get triggered
  border-radius: $navbar-border-radius;
  $shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 5px rgba(0,0,0,.075);
  @include box-shadow($shadow);

  .#{$class-prefix}-navbar-nav > .#{$class-prefix}-open > .#{$class-prefix}-html-a,
  .#{$class-prefix}-navbar-nav > .#{$class-prefix}-active > .#{$class-prefix}-html-a {
    @include gradient-vertical($start-color: darken($navbar-default-link-active-bg, 5%), $end-color: darken($navbar-default-link-active-bg, 2%));
    @include box-shadow(inset 0 3px 9px rgba(0,0,0,.075));
  }
}
.#{$class-prefix}-navbar-brand,
.#{$class-prefix}-navbar-nav > .#{$class-prefix}-html-li > .#{$class-prefix}-html-a {
  text-shadow: 0 1px 0 rgba(255,255,255,.25);
}

// Inverted navbar
.#{$class-prefix}-navbar-inverse {
  @include gradient-vertical($start-color: lighten($navbar-inverse-bg, 10%), $end-color: $navbar-inverse-bg);
  @include reset-filter; // Remove gradient in IE<10 to fix bug where dropdowns don't get triggered; see https://github.com/twbs/bootstrap/issues/10257
  border-radius: $navbar-border-radius;
  .#{$class-prefix}-navbar-nav > .#{$class-prefix}-open > .#{$class-prefix}-html-a,
  .#{$class-prefix}-navbar-nav > .#{$class-prefix}-active > .#{$class-prefix}-html-a {
    @include gradient-vertical($start-color: $navbar-inverse-link-active-bg, $end-color: lighten($navbar-inverse-link-active-bg, 2.5%));
    @include box-shadow(inset 0 3px 9px rgba(0,0,0,.25));
  }

  .#{$class-prefix}-navbar-brand,
  .#{$class-prefix}-navbar-nav > .#{$class-prefix}-html-li > .#{$class-prefix}-html-a {
    text-shadow: 0 -1px 0 rgba(0,0,0,.25);
  }
}

// Undo rounded corners in static and fixed navbars
.#{$class-prefix}-navbar-static-top,
.#{$class-prefix}-navbar-fixed-top,
.#{$class-prefix}-navbar-fixed-bottom {
  border-radius: 0;
}

// Fix active state of dropdown items in collapsed mode
@media (max-width: $grid-float-breakpoint-max) {
  .#{$class-prefix}-navbar .#{$class-prefix}-navbar-nav .#{$class-prefix}-open .#{$class-prefix}-dropdown-menu > .#{$class-prefix}-active > .#{$class-prefix}-html-a {
    &,
    &:hover,
    &:focus {
      color: #fff;
      @include gradient-vertical($start-color: $dropdown-link-active-bg, $end-color: darken($dropdown-link-active-bg, 5%));
    }
  }
}


//
// Alerts
// --------------------------------------------------

// Common styles
.#{$class-prefix}-alert {
  text-shadow: 0 1px 0 rgba(255,255,255,.2);
  $shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 1px 2px rgba(0,0,0,.05);
  @include box-shadow($shadow);
}

// Mixin for generating new styles
@mixin alert-styles($color) {
  @include gradient-vertical($start-color: $color, $end-color: darken($color, 7.5%));
  border-color: darken($color, 15%);
}

// Apply the mixin to the alerts
.#{$class-prefix}-alert-success    { @include alert-styles($alert-success-bg); }
.#{$class-prefix}-alert-info       { @include alert-styles($alert-info-bg); }
.#{$class-prefix}-alert-warning    { @include alert-styles($alert-warning-bg); }
.#{$class-prefix}-alert-danger     { @include alert-styles($alert-danger-bg); }


//
// Progress bars
// --------------------------------------------------

// Give the progress background some depth
.#{$class-prefix}-progress {
  @include gradient-vertical($start-color: darken($progress-bg, 4%), $end-color: $progress-bg)
}

// Mixin for generating new styles
@mixin progress-bar-styles($color) {
  @include gradient-vertical($start-color: $color, $end-color: darken($color, 10%));
}

// Apply the mixin to the progress bars
.#{$class-prefix}-progress-bar            { @include progress-bar-styles($progress-bar-bg); }
.#{$class-prefix}-progress-bar-success    { @include progress-bar-styles($progress-bar-success-bg); }
.#{$class-prefix}-progress-bar-info       { @include progress-bar-styles($progress-bar-info-bg); }
.#{$class-prefix}-progress-bar-warning    { @include progress-bar-styles($progress-bar-warning-bg); }
.#{$class-prefix}-progress-bar-danger     { @include progress-bar-styles($progress-bar-danger-bg); }

// Reset the striped class because our mixins don't do multiple gradients and
// the above custom styles override the new `.progress-bar-striped` in v3.2.0.
.#{$class-prefix}-progress-bar-striped {
  @include gradient-striped;
}


//
// List groups
// --------------------------------------------------

.#{$class-prefix}-list-group {
  border-radius: $border-radius-base;
  @include box-shadow(0 1px 2px rgba(0,0,0,.075));
}
.#{$class-prefix}-list-group-item.#{$class-prefix}-active,
.#{$class-prefix}-list-group-item.#{$class-prefix}-active:hover,
.#{$class-prefix}-list-group-item.#{$class-prefix}-active:focus {
  text-shadow: 0 -1px 0 darken($list-group-active-bg, 10%);
  @include gradient-vertical($start-color: $list-group-active-bg, $end-color: darken($list-group-active-bg, 7.5%));
  border-color: darken($list-group-active-border, 7.5%);

  .#{$class-prefix}-badge {
    text-shadow: none;
  }
}


//
// Panels
// --------------------------------------------------

// Common styles
.#{$class-prefix}-panel {
  @include box-shadow(0 1px 2px rgba(0,0,0,.05));
}

// Mixin for generating new styles
@mixin panel-heading-styles($color) {
  @include gradient-vertical($start-color: $color, $end-color: darken($color, 5%));
}

// Apply the mixin to the panel headings only
.#{$class-prefix}-panel-default > .#{$class-prefix}-panel-heading   { @include panel-heading-styles($panel-default-heading-bg); }
.#{$class-prefix}-panel-primary > .#{$class-prefix}-panel-heading   { @include panel-heading-styles($panel-primary-heading-bg); }
.#{$class-prefix}-panel-success > .#{$class-prefix}-panel-heading   { @include panel-heading-styles($panel-success-heading-bg); }
.#{$class-prefix}-panel-info > .#{$class-prefix}-panel-heading      { @include panel-heading-styles($panel-info-heading-bg); }
.#{$class-prefix}-panel-warning > .#{$class-prefix}-panel-heading   { @include panel-heading-styles($panel-warning-heading-bg); }
.#{$class-prefix}-panel-danger > .#{$class-prefix}-panel-heading    { @include panel-heading-styles($panel-danger-heading-bg); }


//
// Wells
// --------------------------------------------------

.#{$class-prefix}-well {
  @include gradient-vertical($start-color: darken($well-bg, 5%), $end-color: $well-bg);
  border-color: darken($well-bg, 10%);
  $shadow: inset 0 1px 3px rgba(0,0,0,.05), 0 1px 0 rgba(255,255,255,.1);
  @include box-shadow($shadow);
}
