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

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

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

// Make links block level
.neos-nav > li > a {
  display: block;
}
.neos-nav > li > a:hover,
.neos-nav > li > a:focus {
  text-decoration: none;
  background-color: $grayLighter;
}

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

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

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

.neos-nav-list {
  padding-left: 15px;
  padding-right: 15px;
  margin-bottom: 0;
}
.neos-nav-list > li > a,
.neos-nav-list .neos-nav-header {
  margin-left: -15px;
  margin-right: -15px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
.neos-nav-list > li > a {
  padding: 3px 15px;
}
.neos-nav-list > .neos-active > a,
.neos-nav-list > .neos-active > a:hover,
.neos-nav-list > .neos-active > a:focus {
  color: $white;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
  background-color: $linkColor;
}
.neos-nav-list [class^="fa-"],
.neos-nav-list [class*=" fa-"] {
  margin-right: 2px;
}
// Dividers (basically an hr) within the dropdown
.neos-nav-list .neos-divider {
  @include nav-divider();
}

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

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

// TABS
// ----

// Give the tabs something to sit on
.neos-nav-tabs {
  border-bottom: 1px solid #ddd;
}
// Make the list-items overlay the bottom border
.neos-nav-tabs > li {
  margin-bottom: -1px;
}
// Actual tabs (as links)
.neos-nav-tabs > li > a {
  padding-top: 8px;
  padding-bottom: 8px;
  line-height: $baseLineHeight;
  border: 1px solid transparent;
  border-radius: 4px 4px 0 0;
  &:hover,
  &:focus {
    border-color: $grayLighter $grayLighter #ddd;
  }
}
// Active state, and it's :hover/:focus to override normal :hover/:focus
.neos-nav-tabs > .neos-active > a,
.neos-nav-tabs > .neos-active > a:hover,
.neos-nav-tabs > .neos-active > a:focus {
  color: $gray;
  background-color: $bodyBackground;
  border: 1px solid #ddd;
  border-bottom-color: transparent;
  cursor: default;
}

// PILLS
// -----

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

// Active state
.neos-nav-pills > .neos-active > a,
.neos-nav-pills > .neos-active > a:hover,
.neos-nav-pills > .neos-active > a:focus {
  color: $white;
  background-color: $linkColor;
}

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

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

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

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

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

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

// Default dropdown links
// -------------------------
// Make carets use linkColor to start
.neos-nav .neos-dropdown-toggle .neos-caret {
  border-top-color: $linkColor;
  border-bottom-color: $linkColor;
  margin-top: 6px;
}
.neos-nav .neos-dropdown-toggle:hover .neos-caret,
.neos-nav .neos-dropdown-toggle:focus .neos-caret {
  border-top-color: $linkColorHover;
  border-bottom-color: $linkColorHover;
}
/* move down carets for tabs */
.neos-nav-tabs .neos-dropdown-toggle .neos-caret {
  margin-top: 8px;
}

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

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

// Open dropdowns
// -------------------------
.neos-nav-tabs .neos-open .neos-dropdown-toggle,
.neos-nav-pills .neos-open .neos-dropdown-toggle,
.neos-nav > li.neos-dropdown.neos-open.neos-active > a:hover,
.neos-nav > li.neos-dropdown.neos-open.neos-active > a:focus {
  color: $white;
  background-color: $grayLight;
  border-color: $grayLight;
}
.neos-nav li.neos-dropdown.neos-open .neos-caret,
.neos-nav li.neos-dropdown.neos-open.neos-active .neos-caret,
.neos-nav li.neos-dropdown.neos-open a:hover .neos-caret,
.neos-nav li.neos-dropdown.neos-open a:focus .neos-caret {
  border-top-color: $white;
  border-bottom-color: $white;
  opacity: 1;
}

// Dropdowns in stacked tabs
.neos-tabs-stacked .neos-open > a:hover,
.neos-tabs-stacked .neos-open > a:focus {
  border-color: $grayLight;
}

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

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

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

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

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

// BOTTOM
// ------

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

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

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

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

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

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

// Gray out text
.neos-nav > .neos-disabled > a {
  color: $grayLight;
}
// Nuke hover/focus effects
.neos-nav > .neos-disabled > a:hover,
.neos-nav > .neos-disabled > a:focus {
  text-decoration: none;
  background-color: transparent;
  cursor: default;
}
