/** 
 * 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 */
    margin-left: 95px;

    &.ccm-search-fields-none {
      margin-left: 0px;
      border-bottom: 1px solid #efefef;
      margin-bottom: 20px;
      div.ccm-search-main-lookup-field {
        border-left: 0px;
        margin-left: 95px;
      }
    }

    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;
      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: #666;
      position: absolute;
      top: 0px;
      left: 0px;
    }

    select {
      width: 300px;
    }

    div.ccm-search-main-lookup-field {
      position: relative;
      border-left: 1px solid #efefef;

      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: 10px;
      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-search-fields-row {

  min-height: 34px;

  position: relative;
  margin-bottom: 10px;
  div.form-group {

    label.control-label {
      color: #999;
      top: 5px;
      left: 0px;
      position: absolute;
      font-size: @font-size-base !important;
      font-weight: normal;
    }

    &.form-group-full {
      width: 100%;
      padding-right: 20px;
    }
  }

  div.ccm-search-field-content {
    border-left: 1px solid #efefef;
    margin-left: 244px;
    padding-left: 10px;
    div.ccm-search-main-lookup-field {
      border-left: 0px;
    }

    .select2-select {
      width: 100%;
    }
  }

}

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

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

      &: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;
    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;
      }
    }

  }
}

table.ccm-search-results-table {
  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-xs-max) {

  .ccm-ui {
    form.ccm-search-fields {
      ul.ccm-search-form-advanced {
        top: 0;
        width: 130px;
      }

      div.ccm-search-fields-row {
        div.ccm-search-field-content {
          margin-left: 100px;
        }
        select.ccm-search-choose-field, select.ccm-search-bulk-action {
          width: 100px;
        }
      }
    }
  }

}