/*
 * Various fixes for shoreditch so we can put them all in one place
 *
 * Please update this as / when needed
 *
 * Currently compatible with shoreditch version: beta4 (where the menu's are fixed)
 *
 */

/*
 * Case Dashboard.
 */ 

#crm-container div.crm-case-dashboard-buttons {
  height: 110px;
}

/* Adding .report td to fix .report display */
#crm-container .crm-case-caseStatus .label,
#crm-container .report td {
  display: table-cell;
}


/*
 * Contextual menus.
 */

#crm-container table.crm-ajax-table span.btn-slide.crm-hover-button {
  padding-right: 1 !important;
  display: inline;
}

.page-civicrm-group #DataTables_Table_0 .crm-group-group_links .btn-slide.crm-hover-button, /* Groups page */
#crm-container table.crm-ajax-table span.btn-slide::after { /* Other Pages */
  position: inherit;
  display: inline;
}

/* Right hand col context menus for /civicrm/admin/contribute. */
.crm-container span.btn-slide {
  display: inline;
}

/*
 * White on white buttons and the button themeing.
 */

.crm-container .crm-i-button {
  background: #4d4d69;
  /* background: #707170 url(/sites/all/modules/civicrm/i/crm-button-bg.gif) repeat-x top left; */
  padding: 5px 16px !important;
}
.crm-container .crm-form-block .crm-submit-buttons .crm-i-button:hover, 
.crm-container .crm-form-block .crm-submit-buttons .crm-i-button:hover,
.crm-container .crm-form-block .crm-submit-buttons .crm-i-button:focus, 
.crm-container .crm-form-block .crm-submit-buttons .crm-i-button:focus {
  background: #3e3e54;
}
.crm-container .crm-form-block .crm-submit-buttons .crm-i-button input {
  color:#fff !important;
}

/* right hand col context menus for /civicrm/admin/contribute */
.crm-container #configure_contribution_page span.btn-slide {
  display: inline;
}


.crm-container .crm-form-block .crm-submit-buttons .crm-i {
  display: block;
  top: 0;
}

#crm-container.crm-container .crm-button {
  background: #4d4d69;
  padding: 0.5em 0.75em;
}
.crm-container #crm-main-content-wrapper .crm-button input, 
#crm-container #crm-main-content-wrapper .crm-button input {
  padding-left:5px !important;
}
.crm-container #crm-main-content-wrapper .crm-i-button input, 
#crm-container #crm-main-content-wrapper .crm-i-button input {
  padding-left:18px !important;
}
#crm-container.crm-container .crm-button:hover,
#crm-container.crm-container .crm-button:focus {
  background: #3e3e54;
}
/* #crm-container.crm-container .crm-button input {
  padding-left: 0.5em;
} */


/*
 * Other Advanced search page buton issues.
 */

/* Bottom search button issues on hover. */
#crm-container.crm-container .crm-search-form-block span.crm-button.crm-i-button {
  line-height: 1.7em;
  /* background-color: #fff; */
  padding-left: 0.5em;
}

/* Float the "reset form" button to the right at the bottom for good measure. */
#crm-container.crm-container .crm-search-form-block table.form-layout #resetAdvancedSearch {
  float: right;
}

/* 
 * Custom case fields tidy up
 */

/* Add visual space between rows for clarity */
table.crm-info-panel {
  margin-bottom: 0.5em;
}

/* Bringing two cells into line then adding visual formatting */
.crm-container table.crm-info-panel td {
  display: table-cell;
}

.crm-container table.crm-info-panel td.label {
  padding: 0.5em;
}

.crm-info-panel td.html-adjust {
  text-align: right;
}

/* 
 * Fixes white on white quick search - text-style remains the same as per other menu items 
 */
 
.ui-autocomplete .ui-menu-item .ui-menu-item-wrapper {
  color: #333 !important;
}

/* 
 * Overextending pop up - height calculation tweak to make max dialog slightly shorter, was 100vh 
 */
 
.crm-container.ui-dialog .ui-dialog-content {
  max-height: -moz-calc(87vh - 280px) !important;
  max-height: -webkit-calc(87vh - 280px) !important;
  max-height: calc(87vh - 280px) !important;
  height: auto !important;
}

.crm-container .CRM_Contribute_Form_SearchContribution .btn-slide {
  padding-right: 15px !important;
  text-indent: initial;
  width: auto;
}

crm-container .crm-section .label, 
.crm-container-snippet .crm-section .label {
  color: #000;
}



/**
 * Fixing relationship table being too wide
 * - https://dev-e.healthwatchcrm.co.uk/civicrm/contact/view?reset=1&cid=1 (Relationships tab in left column)
 */

/* .dataTables_wrapper {
  width: 100%;
} */
.dataTables_wrapper .crm-ajax-table {
  max-width: 100%;
}
/* .crm-container label, .crm-container tr, .crm-container div.crm-clear {
  font-size: 12px !important;
} */

table.crm-contact-relationship-selector-current tr td,
table.crm-contact-relationship-selector-past tr td {
  font-size: 12px;
  /* padding-left:8px;
  padding-right:8px; */
}

/* .dataTables_wrapper {
  overflow-x: auto;
} */

/* first table */
.crm-container .dataTables_wrapper>table.crm-contact-relationship-selector-current thead th,
.crm-container .dataTables_wrapper>table.crm-contact-relationship-selector-current tbody td,
/* Second table */
.crm-container .dataTables_wrapper>table.crm-contact-relationship-selector-past thead th,
.crm-container .dataTables_wrapper>table.crm-contact-relationship-selector-past tbody td {
    padding: 15px 8px
}
/* first table */
.crm-container .dataTables_wrapper>table.crm-contact-relationship-selector-current thead th:first-child:not(.hiddenElement),
.crm-container .dataTables_wrapper>table.crm-contact-relationship-selector-current tbody td:first-child:not(.hiddenElement),
/* Second table */
.crm-container .dataTables_wrapper>table.crm-contact-relationship-selector-past thead th:first-child:not(.hiddenElement),
.crm-container .dataTables_wrapper>table.crm-contact-relationship-selector-past tbody td:first-child:not(.hiddenElement) {
    padding-left: 15px
}
/* first table */
.crm-container .dataTables_wrapper>table.crm-contact-relationship-selector-current thead th:last-child:not(.hiddenElement),
.crm-container .dataTables_wrapper>table.crm-contact-relationship-selector-current tbody td:last-child:not(.hiddenElement),
/* Second table */
.crm-container .dataTables_wrapper>table.crm-contact-relationship-selector-past thead th:last-child:not(.hiddenElement),
.crm-container .dataTables_wrapper>table.crm-contact-relationship-selector-past tbody td:last-child:not(.hiddenElement) {
    padding-right: 15px
}
/* first table */
.crm-container .dataTables_wrapper>table.crm-contact-relationship-selector-current thead .sorting::after,
.crm-container .dataTables_wrapper>table.crm-contact-relationship-selector-current thead .sorting_asc::after,
.crm-container .dataTables_wrapper>table.crm-contact-relationship-selector-current thead .sorting_desc::after,
.crm-container .dataTables_wrapper>table.crm-contact-relationship-selector-current thead .sorting_disabled::after,
/* Second table */
.crm-container .dataTables_wrapper>table.crm-contact-relationship-selector-past thead .sorting::after,
.crm-container .dataTables_wrapper>table.crm-contact-relationship-selector-past thead .sorting_asc::after,
.crm-container .dataTables_wrapper>table.crm-contact-relationship-selector-past thead .sorting_desc::after,
.crm-container .dataTables_wrapper>table.crm-contact-relationship-selector-past thead .sorting_disabled::after {
    padding-left: 8px;
}

.crm-container .dataTables_wrapper>table.crm-contact-relationship-selector-current .crm-icon,
.crm-container .dataTables_wrapper>table.crm-contact-relationship-selector-past .crm-icon {
  background-image: url('../images/item_sprites.png');
  margin: 2px 4px 0 0;
  text-indent: -10000px;
}


/** Fixing show number of entris on various tables ***/
#crm-container select.crm-form-select, #crm-container select[aria-controls] {
  padding: 4px 35px 4px 10px;
}


/*
 * Fixing buttons
*/

.crm-container a.button, .crm-container a.button:link, .crm-container a.button:visited, .crm-container .ui-dialog-buttonset .ui-button, .crm-container .crm-button {
  background: #696969;
  border: 1px solid #3e3e3e;
  margin: 10px;
}