/**
 * CMB2 Customized SCSS
 *
 * @description Here we customize the look-and-feel of CMB2 to suit GMB
 * @package     Give
 * @subpackage  SCSS/Admin
 * @copyright   Copyright (c) 2015, WordImpress
 * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
*/

/*------------------------------------------
 CMB2 Interface
--------------------------------------------*/
.cmb-field-list {
  @include clearfix;
}

.cmb2-id-gmb-places-search-multicheckbox {
  ul {
    overflow: hidden;
  }
  li {
    float: left;
    width: 33%;
  }
  .cmb2-metabox-description {
    margin-top: 10px;
    margin-right: 2px;
  }
}

//Hide/Show some borders
#cmb2-metabox-google_maps_search_options .cmb2-id-gmb-show-places {
  border-bottom: none;
  margin-bottom: 0;
}

#post-body-content #cmb2-metabox-google_maps_search_options .cmb2-id-gmb-search-radius, #post-body .cmb2-id-gmb-places-search {
  border-top: 1px solid #e9e9e9;
}

//Repeaters General
#post-body .cmb2-metabox.cmb-field-list > .cmb-repeat-group-wrap {
  padding: 0;
}

/*-------------------------------------
Autocomplete Metabox
---------------------------------------*/
#cmb2-metabox-google_maps_markers {
  .search-autocomplete {
    width: 78%;
    margin-right: 10px;
  }
  .autocomplete-wrap {
    p {
      font-style: italic;
      margin: 5px 0;
      color: #aaaaaa;
    }
  }

  a.drop-marker {
    font-style: normal;
    .dashicons {
      font-size: 14px;
      margin: 4px 0 0;
      width: 16px;
    }
  }
}

/*-------------------------------------
Map Markers
---------------------------------------*/
#google_maps_markers {

  .cmb-add-row {
    display: none;
  }

}

#poststuff .postbox-container {
  .cmb-repeatable-group:not(:last-of-type) {
    border-bottom: 1px solid #e9e9e9;
    padding: 0 0 15px;
  }
  .cmb-repeat-group-wrap .cmb-row:not(:last-of-type) {
    margin-bottom: 10px;
  }
}

#gmb_markers_group_repeat.cmb-remove-field-row {
  margin-bottom: 15px;
}

/*-------------------------------------
Sidebar
---------------------------------------*/
#poststuff .inner-sidebar, #poststuff #side-sortables {

  .inside {
    margin-top: 0;
    padding-top: 12px;
  }

  .cmb-row {
    margin: 0 0 15px;
    padding: 0;

    &:not(:last-of-type) {
      border-bottom: 0;
    }

    &:last-child, &:last-of-type {
      margin-bottom: 5px;
    }
  }

  .cmb-th {
    background: transparent;
    padding: 0;
    position: relative;

    label {
      border: none;
      &:after {
        display: none;
      }
    }

  }

  .cmb-td {
    //repeater
    &.cmb-nested {
      padding-left: 12px;
      padding-right: 12px;
    }
  }

  /*-------------------------------------
  Sidebar Fields
  ---------------------------------------*/
  select {
    width: 100%;
  }
  .lat-lng-wrap {
    margin-top: 0;
  }
  .lat-lng-wrap.lng-wrap {
    margin-bottom: 0;
  }

  .cmb2-metabox-description, p.cmb2-metabox-description {
    @include field-description;
  }

  /*-------------------------------------
  Sidebar Repeater Field Groups
  ---------------------------------------*/
  h2.cmb-group-name {
    @include modal-label;
  }

  .cmb-repeatable-group {

    .cmb-repeatable-grouping {
      margin: 0 0 8px;
      border: none;
      border-radius: 5px;
      overflow: hidden;

      .cmb-group-title {
        margin: 0;
        padding: 8px 8px 8px 30px;
        cursor: pointer;
        background: $orange;
        border: none;
        color: #FFF;
        font-weight: bold;
      }
      .cmbhandle {
        color: #FFF;
      }
      .cmbhandle {
        right: 0;
        top: 0;
      }

      > .cmb-remove-group-row {
        top: 6px;
        color: #FFF;
      }

    }

    .cmb-field-list {
      border-left: 1px solid #EEE;
      border-right: 1px solid #EEE;
    }

    .cmb-remove-row {
      margin: 0;
      padding: 0;
    }

    .cmb-add-row {
      margin: 15px 0 10px;
    }

  }

  .drop-marker {
    margin-bottom: 15px;
  }

}

//Non-magnific Builder Repeater styles
#postbox-container-2 #cmb2-metabox-google_maps_markers {

  .toggle-repeater-groups {
    float: right;
  }

  .cmb-repeat-group-wrap {
    padding: 0;
  }

  .cmb-group-description .cmb-th {
    padding-right: 0;
  }

}

p.cmb2-metabox-description {
  font-weight: normal;
}

a.wp-color-result {
  height: 24px;
}

/*-------------------------------------
CMB2 within Magnific
---------------------------------------*/
div.white-popup {
  .cmb-th {
    width: 100%;
    padding: 0;
    label {
      @include modal-label;
    }
  }
  .cmb-td {
    width: 100%;
    padding: 15px 0;
  }
}