.appmanager-sidebar {
  // hack from http://stackoverflow.com/questions/266015/css-floats-how-do-i-keep-them-on-one-line
  min-width: @app-manager-sidebar-width;
  width: auto !important;
  width: @app-manager-sidebar-width;
  max-width: @app-manager-sidebar-width;
  float: left;
}

nav.appmanager-content {
  margin-bottom: 20px;
}

@z-index-trash: 20;

@appnav-width: @app-manager-sidebar-width;
@appnav-trash-width: 32px;
@appnav-item-height: 30px;
@appnav-secondary-width: 35px;

.appnav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-size: 12px;
  .appnav-menu {
    min-height: @appnav-item-height/2;
  }
}

.appnav-menu > li > .appnav-item a {
  float: left;
  box-sizing: border-box;
  line-height: @appnav-item-height;
  padding-right: @appnav-trash-width;
  color: @cc-text;
  .transition(all .5s);
  text-decoration: none !important;
}

.appnav-primary-icon {
  font-size: 1.7rem;
  color: lighten(@cc-text, 20);
}

.appnav-menu .appnav-primary-icon {
  top: 6px;
  position: absolute;
  margin-right: 5px;
}

.appnav-primary-icon-lg {
  font-size: 2rem;
}

.appnav-menu .appnav-primary-icon-lg  {
  top: 3px;
}

.appnav-menu > li > .appnav-item a.appnav-delete {
  width: @appnav-trash-width;
  .transition(all .2s);
  position: relative;
  z-index: @z-index-trash;

  i {
    display: block;
    text-align: center;
    cursor: pointer;
    width: @appnav-trash-width;
    height: @appnav-item-height;
    vertical-align: top;
    line-height: @appnav-item-height;
    .transition(margin .5s);
    position: relative;
    margin-left: -50px;
  }

  &:hover, &:focus {
    color: @cc-att-neg-mid;
  }
}

@drag-icon-right: 10px;

.appnav-menu > li > .appnav-item a.appnav-title {
  width: @appnav-width - @appnav-trash-width;
  position: relative;

  > span {
    position: relative;
    line-height: 14px;
    display: inline-block;
    margin-left: 22px;
    padding: 8px 0;
  }

  > .appnav-drag-icon {
    position: absolute;
    top: 0;
    right: @drag-icon-right;
    text-align: center;
    width: @appnav-trash-width;
    min-height: @appnav-item-height;
    height: 100%;
    line-height: @appnav-item-height;
    opacity: 0;
    .transition(all 1s);
    &:hover {
      color: @cc-dark-cool-accent-mid;
      cursor: move;
      background-color: darken(@cc-bg, 10);
    }
  }
  &:hover {
    > .appnav-drag-icon {
      opacity: 100;
    }
  }
}

.appnav-menu > li > .appnav-item a.appnav-title-secondary {
  width: @appnav-width - @appnav-trash-width - @appnav-secondary-width;
}

.appnav-menu > li > .appnav-item a.appnav-secondary {
  width: @appnav-secondary-width;
  &.appnav-settings {
    .transition(all .2s);
  }

  &:hover, &:focus {
    color: @cc-brand-mid;
  }
}

.appnav-menu > li > .appnav-item a.appnav-add {
  width: @appnav-width;
  padding-left: @appnav-trash-width;
  > [class*='fa-'] {
    .transition(all .2s);
    margin-right: 8px;
    margin-left: 5px;
    position: relative;
  }
  &:hover, &:focus {
    text-decoration: none;

    > [class*='fa-'] {
      color: @call-to-action-mid;
    }
  }
}

.appnav-show-on-hover {
  opacity: 0;
}

.appnav-menu > li > .appnav-item {
  box-sizing: content-box;
  width: @appnav-width;
  .clearfix();
  overflow: hidden;

  &:hover, &:focus {
    background-color: rgba(255,255,255,0.6);

    a {
      text-decoration: none;
      outline: none;
      &.appnav-delete {
        i {
          margin-left: 0;
        }
      }
    }
    .appnav-show-on-hover {
      opacity: 100;
    }
  }
  &.settings-view .appnav-secondary {
    color: @cc-brand-mid;
  }
  &.settings-view .appnav-secondary .appnav-show-on-hover {
    opacity: 100;
  }
}

@nesting-indent: 10px;
@t-shaped-line: '\f00a';
@l-shaped-line: '\f00b';

.appnav-menu-nested {
  > li > .appnav-item > a.appnav-title {
    border-left: 1px solid lighten(@cc-text, 60);
  }

  > li:last-child > .appnav-item > a.appnav-title {
    border: none;
    padding-left: 11px;

    &:before {
      content: @l-shaped-line;
      left: -14px;
      margin-right: 1px;
    }
  }
  > .appnav-primary-icon {
    margin-left: 2px;
  }
}

.appnav-menu-nested > li, .child-modules > li.module  {
  > .appnav-item > a.appnav-title {
    padding-left: @nesting-indent;
    position: relative;

    &:before {
      font-family: "WorkflowFontRegular";
      position: absolute;
      content: @t-shaped-line;
      left: -15px;
      top: -5px;
      font-size: 4.6rem;
      color: lighten(@cc-text, 60);
    }
  }
}

.child-modules > li.module {
  // Child module
  > .appnav-item > a.appnav-title {
    &:before {
      content: @l-shaped-line;
    }
  }
  // Form in child module
  > .appnav-menu-nested > li > .appnav-item {
    > a.appnav-title {
      margin-left: @nesting-indent;
      margin-right: -@nesting-indent;
      width: @appnav-width - @appnav-trash-width - @appnav-secondary-width - @nesting-indent;
      > .appnav-drag-icon {
        right: @drag-icon-right;
      }
    }
    > .appnav-settings {
      margin-left: @nesting-indent;
    }
  }
}

.edit-module-li {
  .transition(background-color 1s);
}

.appnav-highlight .appnav-item {
  background-color: darken(@cc-bg, 10);
}

.appnav-name-wrapper {
  background-color: @cc-brand-mid;
  position: relative;
  .transition(background-color 1s);

  &:hover, &.active {
     background-color: darken(@cc-brand-mid, 10);
  }

  a, a:link, a:visited, a:hover, a:focus {
    color: white;
    text-decoration: none;
  }
}

.appnav-name {
  padding: 0;
  margin: 0;
  margin-right: 51px;
  font-size: @font-size-base*1.2;
  a {
    padding: 15px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 220px;
  }
}

.appnav-name-publish {
  padding: 5px 15px;
  text-transform: uppercase;
  color: white;
  font-size: 10px;
  line-height: 15px;
  background-color: @cc-dark-cool-accent-mid;
  display: block;
  font-weight: bold;
  position: relative;
  &:after {
    content: '';
	position: absolute;
	top: 0;
	left: 25px;
	width: 0;
	height: 0;
	border: 10px solid transparent;
	border-bottom-color: @cc-dark-cool-accent-mid;
	border-top: 0;
	margin-left: -10px;
	margin-top: -10px;
  }
}

.appnav-name-linked {
  padding: 5px 15px;
  text-transform: uppercase;
  color: white;
  font-size: 10px;
  line-height: 15px;
  background-color: @call-to-action-mid;
  display: block;
  font-weight: bold;
  position: relative;
}

.appnav-name-settings {
  float: right;
  width: 51px;

  a {
    padding-left: 16px;
    padding-top: 14px;
    padding-bottom: 13px;
    display: block;
    .transition(all 1s);
    &:hover, &:focus, &.active {
      text-shadow: 0 0 10px white, 0 0 20px white, 0 0 30px white;
    }
  }
}

.appnav-language-select {
  padding: 5px 15px 4px;
  font-size: 11px;
  background-color: @cc-brand-mid;
  color: white;
  label {
    font-weight: 400;
    line-height: 13px;
    padding-top: 1px;
    display: inline-block;
  }
  select {
    width: 42px;
    height: 16px;
    display: inline;
    float: right;
    background-color: darken(@cc-brand-mid, 5);
    border: none;
    color: white;
    margin-top: 2px;
    padding: 0;
  }
}

.appnav-menu .btn-langcode-preprocessed {
  background-color: darken(@cc-bg, 10);
  border: none;
  color: lighten(@cc-text, 10);
  vertical-align: top;
  font-size: 9px;
  margin-top: -1px;
  margin-right: 1px;
  padding-bottom: 3px;
  line-height: 10px;
}

.appnav-section-name {
  background-color: @cc-brand-low;
  color: white;
  padding: 10px 15px;
  margin: 0;
  font-size: 1.2rem;
  text-transform: uppercase;
}

.appnav-link-full {
  width: 100%;
  position: relative;
  span {
    display: block;
    line-height: 14px;
    padding: 8px 0;
    margin-left: 22px;
  }
  .appnav-primary-icon {
    margin-top: 2px;
  }
  .appnav-primary-icon-lg {
    margin-top: 4px;
  }
}

.appnav-menu .nav-divider {
  margin: 0;
}

.appsummary-sidebar {
  padding-bottom: 50px;
}

.appnav-toggle-label {
  background-color: darken(@cc-bg, 10);
  padding: 5px 15px 0 15px;
  font-weight: 600;
  font-size: 10px;
}

.appnav-menu > li > .appnav-item.active {
  background-color: @cc-brand-low;
  .appnav-title {
    border-color: darken(@cc-bg, 2);
    word-break: break-word;
  }
  a {
    color: white;

    > .appnav-drag-icon {
      &:hover {
        color: white;
        cursor: move;
        background-color: @cc-text;
      }
    }
    &:before {
      color: darken(@cc-bg, 2);
    }
  }
  .appnav-primary-icon {
    color: white;
  }
  .appnav-delete:hover {
    color: @cc-att-neg-hi;
  }
  .appnav-secondary {
    color: @cc-brand-hi;

    &:hover, &:focus {
      text-shadow: 0 0 10px #000;
    }
    &.appnav-settings {
      color: @cc-brand-hi;
      &:hover, &:focus {
        color: darken(@cc-brand-hi, 20);
        text-shadow: 0 0 10px #0000;
      }
    }
  }
} 
