//
// Navs
// --------------------------------------------------


// BASE CLASS
// ----------

.nav {
  margin-left: 0;
  margin-bottom: @baseLineHeight;
  list-style: none;
}

// Make links block level
// .nav > li > a {
.nav li a /* fix for IE6 */ {
  display: block;
  *zoom:1;
}
.nav * li a /* fix for IE6 */ {
  display: inline;
}
.nav li * a /* fix for IE6 */ {
  display: inline;
}
// .nav > li > a:hover {
.nav li a:hover /* fix for IE6 */ {
  text-decoration: none;
  background-color: @grayLighter;
}
.nav * li a:hover /* fix for IE6 */ {
  text-decoration: inherit;
  background-color: inherit;
}
.nav li * a:hover /* fix for IE6 */ {
  text-decoration: inherit;
  background-color: inherit;
}

// Redeclare pull classes because of specifity
.nav > .pull-right {
  float: right;
}

// Nav headers (for dropdowns and lists)
.nav-header {
  display: block;
  *zoom:1;
  padding: 3px 15px;
  font-size: 11px;
  font-weight: bold;
  line-height: @baseLineHeight;
  color: @grayLight;
  text-shadow: 0 1px 0 rgba(255,255,255,.5);
  text-transform: uppercase;
}
// Space them out when they follow another list item (link)
// .nav li + .nav-header {
.nav .nav-header /* fix for IE6 */ {
  margin-top: 9px;
}



// NAV LIST
// --------

.nav-list {
  padding-left: 15px;
  padding-right: 15px;
  margin-bottom: 0;
}
// .nav-list > li > a,
.nav-list li a, /* fix for IE6 */
.nav-list .nav-header {
  margin-left:  -15px;
  margin-right: -15px;
  text-shadow: 0 1px 0 rgba(255,255,255,.5);
}
// .nav-list > li > a {
.nav-list li a /* fix for IE6 */ {
  padding: 3px 15px;
}
.nav-list * li a /* fix for IE6 */ {
  margin-left:  0;
  margin-right: 0;
  text-shadow: none;
  padding:0;
}
.nav-list li * a /* fix for IE6 */ {
  margin-left:  0;
  margin-right: 0;
  text-shadow: none;
  padding:0;
}
// .nav-list > .active > a,
// .nav-list > .active > a:hover {
.nav-list .active a,
.nav-list .active a:hover /* fix for IE6 */ {
  color: @white;
  text-shadow: 0 -1px 0 rgba(0,0,0,.2);
  background-color: @linkColor;
}
.nav-list * .active a,
.nav-list * .active a:hover /* fix for IE6 */ {
  color: inherit;
  text-shadow: none;
  background-color: inherit;
}
.nav-list .active * a,
.nav-list .active * a:hover /* fix for IE6 */ {
  color: inherit;
  text-shadow: none;
  background-color: inherit;
}
.nav-list [class^="icon-"],
.nav-list [class*=" icon-"] {
  margin-right: 2px;
}
// Dividers (basically an hr) within the dropdown
.nav-list .divider {
  .nav-divider();
}



// TABS AND PILLS
// -------------

// Common styles
.nav-tabs,
.nav-pills {
  .clearfix();
}
// .nav-tabs > li,
// .nav-pills > li {
.nav-tabs li,
.nav-pills li {
  float: left;
}
.nav-tabs * li,
.nav-pills * li {
  float: none;
}
// .nav-tabs > li > a,
// .nav-pills > li > a {
.nav-tabs li a,
.nav-pills li a {
  padding-right: 12px;
  padding-left: 12px;
  margin-right: 2px;
  line-height: 14px; // keeps the overall height an even number
}
.nav-tabs * li a,
.nav-pills * li a {
  padding:0;
  margin:0;
  line-height:auto;
}

// TABS
// ----

// Give the tabs something to sit on
.nav-tabs {
  border-bottom: 1px solid #ddd;
}
// Make the list-items overlay the bottom border
// .nav-tabs > li {
.nav-tabs li {
  margin-bottom: -1px;

  *zoom:1;
  *background-color: @white;
  // *background-color: @transparentIE6;
  // *filter:chroma(color=@transparentIE6);
}
.nav-tabs * li {
  zoom:normal;
}
// Actual tabs (as links)
// .nav-tabs > li > a {
.nav-tabs li a {
  padding-top: 8px;
  padding-bottom: 8px;
  line-height: @baseLineHeight;
  border: 1px solid transparent;

  *display: inline;
  *zoom:1;
  *border: 1px solid @transparentIE6;
  *background-color: @transparentIE6;
  *filter:chroma(color=@transparentIE6);

  .border-radius(4px 4px 0 0);
  &:hover {
    border-color: @grayLighter @grayLighter #ddd;
  }
}
.nav-tabs * li a {
  padding:0;
  line-height: auto;
  border: none;
  zoom:normal;
  border:none;
  background-color:inherit;
  filter:none;
}
// Active state, and it's :hover to override normal :hover
// .nav-tabs > .active > a,
// .nav-tabs > .active > a:hover {
.nav-tabs .active a,
.nav-tabs .active a:hover {
  color: @gray;
  background-color: @bodyBackground;
  border: 1px solid #ddd;
  *border: 1px solid #999;
  border-bottom-color: transparent;
  cursor: default;
}
.nav-tabs * .active a,
.nav-tabs * .active a:hover {
  color:inherit;
  background-color:inherit;
  border:none;
}


// PILLS
// -----

.nav-pills li {
  *zoom:1;
  *background-color: @white;
  // *background-color: @transparentIE6;
  // *filter:chroma(color=@transparentIE6);
}
.nav-pills * li {
  zoom:normal;
  background-color: inherit;
}

// Links rendered as pills
// .nav-pills > li > a {
.nav-pills li a {
  padding-top: 8px;
  padding-bottom: 8px;
  margin-top: 2px;
  margin-bottom: 2px;
  .border-radius(5px);

  *display: inline;
  *zoom:1;
}

.nav-pills * li a {
  padding:0;
  margin:0;
  .border-radius(none);
  zoom:normal;
}

// Active state
// .nav-pills > .active > a,
// .nav-pills > .active > a:hover {
.nav-pills .active a,
.nav-pills .active a:hover {
  color: @white;
  background-color: @linkColor;
}
.nav-pills * .active a,
.nav-pills * .active a:hover {
  color:inherit;
  background-color:inherit;
}


// STACKED NAV
// -----------

// Stacked tabs and pills
.nav-stacked > li {
  float: none;
}
.nav-stacked > li > a {
  margin-right: 0; // no need for the gap between nav items
}

// Tabs
.nav-tabs.nav-stacked {
  border-bottom: 0;
}
.nav-tabs.nav-stacked > li > a {
  border: 1px solid #ddd;
  .border-radius(0);
}
.nav-tabs.nav-stacked > li:first-child > a {
  .border-top-radius(4px);
}
.nav-tabs.nav-stacked > li:last-child > a {
  .border-bottom-radius(4px);
}
.nav-tabs.nav-stacked > li > a:hover {
  border-color: #ddd;
  z-index: 2;
}

// Pills
.nav-pills.nav-stacked > li > a {
  margin-bottom: 3px;
}
.nav-pills.nav-stacked > li:last-child > a {
  margin-bottom: 1px; // decrease margin to match sizing of stacked tabs
}



// DROPDOWNS
// ---------

.nav-tabs .dropdown-menu {
  .border-radius(0 0 6px 6px); // remove the top rounded corners here since there is a hard edge above the menu

  // Dividers (basically an hr) within the dropdown
  .divider {
    .nav-divider(@dropdownDividerTop, @dropdownDividerBottom);
  }

  // Links within the dropdown menu
  li a {
    display: block;

    /* fix for IE6 BFC */
    *zoom:1;

    padding: 3px 20px;
    clear: both;
    font-weight: normal;
    line-height: @baseLineHeight;
    color: @dropdownLinkColor;
    white-space: nowrap;
  }

  li a:hover,
  li a:focus,
  .dropdown-submenu:hover a,
  .dropdown-submenu-hover a /* fix for IE6 li:hover */ {
    text-decoration: none;
    color: @dropdownLinkColorHover;
    #gradient > .vertical(@dropdownLinkBackgroundHover, darken(@dropdownLinkBackgroundHover, 5%));
  }
  /* fix for IE6 li:hover */
  .dropdown-submenu-hover * a {
    *color: inherit;
    *background-color: @transparentIE6;
    *filter: none;
    *filter:chroma(color=@transparentIE6);
    *background-image: none;
  }
}
.nav-pills .dropdown-menu {
  .border-radius(6px); // make rounded corners match the pills

  // Dividers (basically an hr) within the dropdown
  .divider {
    .nav-divider(@dropdownDividerTop, @dropdownDividerBottom);
  }

  // Links within the dropdown menu
  li a {
    display: block;

    /* fix for IE6 BFC */
    *zoom:1;

    padding: 3px 20px;
    clear: both;
    font-weight: normal;
    line-height: @baseLineHeight;
    color: @dropdownLinkColor;
    white-space: nowrap;
  }

  li a:hover,
  li a:focus,
  .dropdown-submenu:hover a,
  .dropdown-submenu-hover a /* fix for IE6 li:hover */ {
    text-decoration: none;
    color: @dropdownLinkColorHover;
    #gradient > .vertical(@dropdownLinkBackgroundHover, darken(@dropdownLinkBackgroundHover, 5%));
  }
  /* fix for IE6 li:hover */
  .dropdown-submenu-hover * a {
    *color: inherit;
    *background-color: @transparentIE6;
    *filter: none;
    *filter:chroma(color=@transparentIE6);
    *background-image: none;
  }
}

// Default dropdown links
// -------------------------
.nav-tabs .dropdown-toggle {
  *padding-top:10px;
  *padding-bottom:12px;
}
.nav-pills .dropdown-toggle {
  *padding-top:8px;
  *padding-bottom:6px;
  *margin-bottom: 3px;
}
// Make carets use linkColor to start
.nav .dropdown-toggle .caret {
  border-top-color: @linkColor;
  border-bottom-color: @linkColor;
  margin-top: 6px;

  .arrow-down(8px, 4px, @linkColor);
  // *padding: 5px 0 5px;
}
.nav .dropdown-toggle:hover .caret {
  border-top-color: @linkColorHover;
  border-bottom-color: @linkColorHover;
}
/* move down carets for tabs */
.nav-tabs .dropdown-toggle .caret {
  margin-top: 8px;
}

// Active dropdown links
// -------------------------
.nav .active .dropdown-toggle .caret {
  border-top-color: #fff;
  border-bottom-color: #fff;
}
.nav-tabs .active .dropdown-toggle .caret {
  border-top-color: @gray;
  border-bottom-color: @gray;
}

// Active:hover dropdown links
// -------------------------
// .nav > .dropdown.active > a:hover {
.nav .dropdown.active a:hover {
  cursor: pointer;
}

// Open dropdowns
// -------------------------
.nav-tabs .open .dropdown-toggle,
.nav-pills .open .dropdown-toggle,
// .nav > li.dropdown.open.active > a:hover {
.nav li.dropdown-open.active a:hover {
  color: @white;
  background-color: @grayLight;
  border-color: @grayLight;
}
// .nav li.dropdown.open .caret,
// .nav li.dropdown.open.active .caret,
// .nav li.dropdown.open a:hover .caret {
.nav li.dropdown-open .caret,
.nav li.dropdown-open.active .caret,
.nav li.dropdown-open a:hover .caret {
  border-top-color: @white;
  border-bottom-color: @white;
  .opacity(100);

  .arrow-down(8px, 4px, @white);
}

// Dropdowns in stacked tabs
.tabs-stacked .open > a:hover {
  border-color: @grayLight;
}



// TABBABLE
// --------


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

// Clear any floats
.tabbable {
  .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 {
.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 {
.tab-content .tab-pane,
.pill-content .pill-pane {
  display: none;

  *zoom:1;
  *background-color: @white;
  // *background-color: @transparentIE6;
  // *filter:chroma(color=@transparentIE6);

}
// .tab-content > .active,
// .pill-content > .active {
.tab-content .active,
.pill-content .active {
  display: block;
}
.tab-content * .active,
.pill-content * .active {
  // display: inline;
}


// BOTTOM
// ------

// .tabs-below > .nav-tabs {
.tabs-below .nav-tabs {
  border-top: 1px solid #ddd;
}
.tabs-below * .nav-tabs {
  border-top: none;
}
// .tabs-below > .nav-tabs > li {
.tabs-below .nav-tabs li {
  margin-top: -1px;
  margin-bottom: 0;
}
.tabs-below * .nav-tabs li {
  margin-top: 0;
  margin-bottom: -1px;
}
// .tabs-below > .nav-tabs > li > a {
.tabs-below .nav-tabs li a {
  .border-radius(0 0 4px 4px);
  &:hover {
    border-bottom-color: #fff;
    border-top-color: #ddd;
  }
}
.tabs-below * .nav-tabs li a {
  .border-radius(none);
  &:hover {
    border-bottom-color: inherit;
    border-top-color: inherit;
  }
}
// .tabs-below > .nav-tabs > .active > a,
// .tabs-below > .nav-tabs > .active > a:hover {
.tabs-below .nav-tabs .active a,
.tabs-below .nav-tabs .active a:hover {
  border-color: transparent #999 #999 #999;
}
.tabs-below * .nav-tabs .active a,
.tabs-below * .nav-tabs .active a:hover {
  border-color: inherit;
}

// 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(4px 0 0 4px);
}
.tabs-left > .nav-tabs > li > a:hover {
  border-color: @grayLighter #ddd @grayLighter @grayLighter;
}
.tabs-left > .nav-tabs .active > a,
.tabs-left > .nav-tabs .active > a:hover {
  border-color: #ddd transparent #ddd #ddd;
  *border-right-color: @white;
}

// 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 4px 4px 0);
}
.tabs-right > .nav-tabs > li > a:hover {
  border-color: @grayLighter @grayLighter @grayLighter #ddd;
}
.tabs-right > .nav-tabs .active > a,
.tabs-right > .nav-tabs .active > a:hover {
  border-color: #ddd #ddd #ddd transparent;
  *border-left-color: @white;
}



// DISABLED STATES
// ---------------

// Gray out text
// .nav > .disabled > a {
.nav .disabled a {
  color: @grayLight;
}
.nav * .disabled a {
  color: inherit;
}
// Nuke hover effects
// .nav > .disabled > a:hover {
.nav .disabled a:hover {
  text-decoration: none;
  background-color: transparent;
  cursor: default;
}
.nav * .disabled a:hover {
  text-decoration: underline;
  background-color: inherit;
  cursor: default;
}
