/** 
 * Search Fields, including action select menu, keyword search bar, advanced search
 */

.ccm-ui {
  form.ccm-search-fields {
    position: relative;
    padding-top: 10px;
    padding-bottom: 0px; /* the ccm-search-fields-row has a margin on the bottom */

    select.ccm-search-bulk-action, select.ccm-search-choose-field {
      border: 0px;
      box-shadow: none !important;
      -webkit-appearance: none;
      padding: 0px;
      margin: 0px;
      color: #999;
      height: auto;
      width: 200px;
      height: 34px;
      vertical-align: top;
      display: inline-block;
      outline: none !important;
      .border-radius(0px);
      padding-right: 15px;
      background: transparent url(../images/icons/arrow_down.png) no-repeat center right;
    }

    div.form-group {
      margin-right: 40px;
    }

    select.ccm-search-choose-field {
      color: #999;
      margin-right: 40px;
    }

    select {
      width: 300px;
    }

    div.ccm-search-main-lookup-field {
      position: relative;

      i {
        position: absolute;
        top: 10px;
        left: 5px;
      }

      input {
        border: 0px;
        color: #3784d6;
        font-weight: 200;
        font-size: @font-size-large;
        outline: none !important;
        padding: 0px;
        .border-radius(0px);
        .box-shadow(none);
        margin-left: 30px;
        width: 240px;
      }
    }

    ul.ccm-search-form-advanced {
      a {
        color: #afafaf;
      }

      li {
        margin-left: 20px;
      }

      position: absolute;
      right: 20px;
      top: 10px;
      font-size: @font-size-small;
    }

    button.ccm-search-field-hidden-submit {
      border: 0 none;
      height: 0;
      width: 0;
      padding: 0;
      margin: 0;
      overflow: hidden;
    }
  }

}

div.ccm-dashboard-content-full {
  form.ccm-search-fields {
      &.ccm-search-fields-none {
      margin-left: 0px;
      margin-top: 10px;
      border-bottom: 1px solid #efefef;
      margin-bottom: 20px;
      padding-bottom: 10px;
      div.ccm-search-main-lookup-field {
        margin-left: 97px;
      }
      ul.ccm-search-form-advanced {
        top: 20px;
      }
    }
  }
}

div.ccm-search-fields-submit {
  padding-bottom: 10px;
  .clearfix();

  button.pull-right {
    margin-right: 20px;
  }
}

form.ccm-search-fields-none {
  div.ccm-search-fields-row {
    padding-left: 0px;
  }
}

div.ccm-search-fields-row {

  min-height: 34px;

  margin-bottom: 10px;
  padding: 0px 0px 10px 0px;
  @media (min-width: @screen-sm-min) {
    padding-left: 97px;
  }
  border-bottom: 1px solid #efefef;

  position: relative;

  div.form-group {

    label.control-label {
      width: 200px;
      color: #999;
      line-height: 34px;
      vertical-align: top;
      margin-right: 40px;
      margin-bottom: 0px;
      font-size: @font-size-base !important;
      font-weight: normal;
    }

    margin-bottom: 0px;

  }

  div.ccm-search-field-content {
    padding-left: 10px;
    display: inline-block;
    div.ccm-search-main-lookup-field {
      border-left: 0px;
    }

  }

}

/**
 * Advanced Search
 */
div.ccm-search-fields-advanced {
  div.ccm-search-fields-row {

    a.ccm-search-remove-field {
      color: #aaa;
      position: absolute;
      right: 20px;
      top: 8px;

      &:hover {
        color: #666;
        text-decoration: none;
      }
    }
  }
}

/** 
 * Search results
 */

table.ccm-search-results-table {

  width: 100%;

  span.ccm-search-results-checkbox {
    display: block;
    padding-top: 0px;
    padding-bottom: 0px;
    @media (min-width: @screen-sm-min) {
      margin-left: 75px;
    }
  }

  thead {

    th {
      input[type=checkbox], input[type=radio] {
        border: 1px solid #ccc;
        color: #ccc;
        vertical-align: middle;
      }

      background-color: #006699;
      color: #93bfd5;
      font-weight: 300;

      &.ccm-results-list-active-sort-desc a,
      &.ccm-results-list-active-sort-asc a {
        color: #eaeaea;
        background: #00496e;
        white-space: nowrap;
              &:after {
          vertical-align: middle;
          content: "";
                  width: 0;
                  height: 0;
          display: inline-block;
          margin-left: 10px;
        }
      }

      &.ccm-results-list-active-sort-desc a:after {
                border-width: 4 px 4 px 0 px 4 px;
                border-style: solid;
        border-color: #e2e2e4 transparent transparent transparent;
      }

      &.ccm-results-list-active-sort-asc a:after {
                border-width: 0 px 4 px 4 px 4 px;
                border-style: solid;
        border-color: transparent transparent #e2e2e4 transparent;
      }

      a {
        color: #93bfd5;
        display: block;
        .transition(all 0.2s cubic-bezier(0.190, 1.000, 0.220, 1.000));

        &:hover {
          text-decoration: none;
          background-color: #00517a;
          color: #eaeaea;
        }
      }

      a, span {
        padding: 10px 20px 10px 20px;
        display: block;
        /* not sure why this was here, it was causing columns to not go the whole width in the sort row
          display: inline-block;
          */
      }

      span.ccm-search-results-checkbox, &.ccm-file-manager-search-results-star span {
        padding-left: 40px;
      }
    }
  }

  tbody {

    td.ccm-file-manager-search-results-star a {
      padding: 10px 20px 10px 20px;
    }

    td {

      span.ccm-search-results-checkbox {
        padding: 10px 20px 10px 20px;
      }

      .transition(all 0.2s cubic-bezier(0.190, 1.000, 0.220, 1.000));

      input[type=checkbox], input[type=radio] {
        border: 1px solid #c0c0c0;
        background-color: #f8f8f8;
        color: #00689c;
        position: relative;
        z-index: @index-level-search-results-checkboxes;
      }
      padding: 20px;

      color: #999;
      background-color: #fff;

      &.ccm-search-results-name {
        width: 300px;
      }

    }

    tr.ccm-menu-item-hover, tr.ccm-menu-item-active {
      td {
        background-color: #B8E4F8 !important;
        color: #000;
      }
    }

    tr:nth-child(even) {

      td {
        background-color: #eeeeee
      }
    }

    tr.ccm-search-select-hover {
      td {
        cursor: pointer;
        background-color: #B8E4F8 !important;
        color: #000;
      }
    }

  }
}

div.ccm-search-results-none {
  font-size: @font-size-large;
  margin-top: 60px;
  text-align: center;
}

div.ccm-search-results-pagination {
  margin-top: 20px;
  text-align: center;
}

// Responsive - Adjust for medium & smaller screens
@media (max-width: @screen-md-max) {

  .ccm-ui table.ccm-search-results-table {

    thead tr th, tbody tr td {
      padding-left: 2px;
      padding-right: 2px;
      span, a {
        padding-left: 8px;
        padding-right: 8px;
      }
    }
  }
}

@media (max-width: @screen-md-max) {

  .ccm-ui {
    form.ccm-search-fields {

      select.ccm-search-bulk-action, select.ccm-search-choose-field {
        width: 120px;
      }
    }

    div.ccm-search-fields-row {
      div.form-group {
        label.control-label {
          width: 120px;
        }
      }
    }

  }

}

@media (max-width: @screen-xs-max) {

  .ccm-ui {
    form.ccm-search-fields {
      ul.ccm-search-form-advanced {
        position: relative;
        li {
          margin-bottom: 20px;
          &.ccm-file-manager-upload {
            font-size: 16px;
          }
        }
      }

      div.ccm-search-fields-row {
        div.ccm-search-field-content {
          padding-left: 0px;
        }
      }
    }
  }

    form.ccm-search-fields {

      select.ccm-search-bulk-action, select.ccm-search-choose-field {
        display: block;
      }
    }

    div.ccm-search-fields-row {
      div.form-group {
        label.control-label {
          display: block;
        }
      }
    }
}