//************************************************************************//
// Nav overrides for CMS/search-style pages
//************************************************************************//
header.app {
  .nav-wrapper {
    padding: 15px 0;
  }

  .nav-item {
    a {
      border-radius: 2px;
      color: $nav-link-color;
      font-size: $base-font-size;
      font-weight: 500;
      text-decoration: none;

      &:hover {
        background: $nav-hover;
        color: #fff;
      }

      &:focus {
        outline: none;
      }

      &:hover, &:focus, &:link, &:visited {
        text-decoration: none;
      }
    }

    #dropdown-topics a {
      color: #fff;
    }
  }

  .nav-item {
    padding: 25px 0px;

    @include media($small-screen) {
      padding: 10px 0px;
    }
  }

  a {
    padding: 10px 20px;
  }

  @include media($tablet) {
    .nav-item {
      padding: 10px 0px;
    }
  }

  a#root {
    display: inline-block;
  }
  #root img {
    display: block;
  }
}

header.search-header {
  @include container;
  margin: 0 auto;

  @include media($small-screen) {
    margin: 0 $base-padding;
  }

  @include media($mobile) {
    margin: 0 10px;
  }
}

//************************************************************************//
// Form
//************************************************************************//
header.app {
  h2 {
    color: white;
    font-size: em(22, 15);
    font-weight: 800;
    margin: 0 0 0 (35px - 12px);

    @include media($mobile) {
      margin-left: 20px - 12px;
    }
  }

  .container {
    @extend %search-form;
    background: $header-background-1;
    clear: both;
    @include clearfix;
    padding: $form-bg-padding;

    &.header-bar {
      border-radius: 4px 4px 0 0;
      max-width: $max-width;
      margin: 0 auto;
    }
  }

  // Main Search input and buttons
  //************************************************************************//
  $input-height: 42px;
  .container .search-wrapper {
    position: relative;
    float: left;
    margin: 0;
    width: 100%;

    div.input {
      &:before {
        top: 11px;
      }

      input {
        font-size: $base-font-size + 1;
        height: $home-search-input-h;
        padding-right:($search-button-width + $search-button-width-adv + 20px);
        width: 100%;
      }
    }

    div.submit {
      width: $search-button-width + $search-button-width-adv;

      .search-dropdown {
        background: darken($search-button-bg, 5%);
        @include border-right-radius(2px);
        box-shadow: -1px 0 0 darken($search-button-bg, 8%);
        float: left;
        height: $input-height;
        width: $search-button-width-adv;

        a.dropdown-toggle {
          display: block;
          height: 100%;
          @include hide-text;
          position: relative;

          &:after {
            content: "";
            left: 7px;
            margin-top: -2px;
            position: absolute;
            top: 50%;
            @include triangle(8px, #fff, down);
          }
        }
      }

      button {
        border: 0;
        float: left;
        font-size: 16px;
        height: $input-height;
        width: $search-button-width;
      }
    }

    .search-exact-search {
      margin-top: 5px;
      font-size: 16px;
      text-align: left;
      display: flex;

      input {
        margin-right: 0.5em;
      }

      label {
        color: #fff;
        margin: 0;
        font-weight: 600;
      }
    }
  }
}

//************************************************************************//
// Advanced Search
//************************************************************************//
header.app .container.advanced-search {
  border-radius: 0;
  color: #fff;
  display: none;
  font-size: $base-font-size-small-1;
  margin: 0;
  text-align: left;
  padding: 12px $base-padding 24px $base-padding;

  @include media($mobile) {
    padding-left: 12px;
    padding-right: 12px;
  }

  h5 {
    font-size: $base-font-size-small-1;
    margin-bottom: 10px;
    font-weight: 700;

    span {
      font-weight: 500;
    }

    @include media($mobile) {
      font-size: $base-font-size-small-2;
    }
  }

  div.field-group {
    border-radius: 2px;
    box-shadow: 0 1px 0 hsla(0, 0%, 0%, 0.04);
    clear: left;
    @include clearfix;
    float: left;
    margin-bottom: 10px;
    position: relative;
  }

  div.remove-group {
    position: absolute;
    left: -24px;
    top: 7px;
    height: 16px;
    width: 16px;
    line-height: 1em;
    font-size: $base-font-size + 1;
    color: $base-border-color-2;
    cursor: pointer;
    @include icon(icon-cancel);
    @include transition(all 0.4s);
    @include transform-origin(center);

    &:hover {
      left: -25px;
      color: #FFD656;
      @include transform(rotate(360deg) scale(1.1));
    }

    @include media($mobile) {
      z-index: 1;
      left: auto;
      right: -24px;

      &:hover {
        left: auto;
      }
    }

  }

  div.field-group.hidden{
    display: none;
  }

  $input-height: 32px;
  $input-width: 280px;
  $select-width: 160px;
  div.select {
    @include clearfix;
    float: left;
    position: relative;

    &:after {
      content: "";
      font-weight: 600;
      margin-top: -2px;
      pointer-events: none;
      position: absolute;
      right: 12px;
      top: 50%;
      @include triangle(8px, $base-font-color-3, down);
    }

    select {
      @include appearance(none);
      @include linear-gradient-background(#FAFAFA, #E9E9E9);
      font-weight: 600;
      border: 0;
      border-right: 1px solid hsla(0, 0%, 0%, 0.2);
      border-radius: 2px 0 0 2px;
      font-size: $base-font-size-small-1 - 1;
      height: $input-height;
      margin-bottom: 0;
      padding: 5px 30px 5px 10px;
      width: $select-width;
      color: darken($base-font-color-2, 5%);

      @include media($mobile) {
        width: $select-width / 2;
      }
    }
  }

  input {
    border: 0;
    @include border-left-radius(0);
    font-size: $base-font-size-small-1;
    height: $input-height;
    margin: 0;
    padding: 5px 10px;
    width: $input-width;
    float: left;

    @include media($mobile) {
      width: 180px;
    }
  }

  input[type='checkbox'] {
    margin: ($input-height - 16px) / 2 .5em ;
    height: $input-height - 16px;
    width: auto;
  }

  a.add-group, label {
    color: #fff;
    display: inline-block;
    float: left;
    font-weight: 600;
    margin-left: 15px;
    margin-top: 5px;

    @include media($mobile) {
      clear: left;
      margin: 3px 0 8px 0;
    }
  }

  label {
    margin-left: 0;
  }

  div.resubmit {
    clear: both;

    @include media($mobile) {
      float: right;
      clear: none;
    }

    button {
      font-size: $base-font-size-small-2;
      font-weight: 600;
      display: block;
      padding: 0.65em 1.8em;
      border-radius: 2px;
      width: $select-width + $input-width;

      @include media($mobile) {
        width: 100%;
      }
    }
  }

  button {
    max-width: 100%;
  }
}
