/**
 * CiviBanking + CiviSEPA CSS fixes for CiviCRM 6.x Riverlea theme.
 *
 * Riverlea sets .crm-container a.button to display:flex, which breaks
 * button layouts in CiviBanking and CiviSEPA extensions.
 */

/* === CiviBanking: Review page === */

/* Navigation button toolbar */
#btx ~ .clearfix {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  padding: 8px 0;
  clear: both;
}

#btx ~ .clearfix a.button {
  display: inline-flex;
  padding: 6px 14px;
  font-size: 13px;
}

/* Riverlea renders the old icon divs at 0x0 */
#btx ~ .clearfix a.button div.icon {
  display: none;
}

/* Float containment */
#btx {
  overflow: hidden;
}

table.suggestions {
  clear: both;
}

/* Suggestion area buttons */
table.suggestions a.button {
  display: inline-flex !important;
  padding: 4px 12px;
  font-size: 13px;
}

/* Each group on its own line, items inline within */
table.suggestions form > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 4px 0;
}

td.prob {
  vertical-align: top;
  white-space: nowrap;
}

/* === CiviBanking: Configure page (JSON editor) === */

.jsoneditor button {
  display: block !important;
  width: 26px !important;
  height: 26px !important;
  padding: 0 !important;
  margin: 2px !important;
  border: 1px solid transparent !important;
  border-radius: 2px !important;
  background-color: transparent !important;
  background-image: url("/ext/org.project60.banking/packages/jsoneditor/img/jsoneditor-icons.svg") !important;
}

.jsoneditor-menu > button,
.jsoneditor-menu > div.jsoneditor-modes > button {
  background-color: transparent !important;
}

.jsoneditor-menu > button:hover,
.jsoneditor-menu > div.jsoneditor-modes > button:hover {
  background-color: rgba(255, 255, 255, 0.2) !important;
}

.jsoneditor-menu > button.jsoneditor-expand-all {
  background-position: 0 -120px !important;
}

.jsoneditor-menu > button.jsoneditor-collapse-all {
  background-position: 0 -96px !important;
}

.jsoneditor-menu > div.jsoneditor-modes > button {
  background-image: none !important;
  width: auto !important;
  padding-left: 6px !important;
  padding-right: 6px !important;
}

.jsoneditor-tree button.jsoneditor-collapsed {
  background-position: 0 -48px !important;
}

.jsoneditor-tree button.jsoneditor-expanded {
  background-position: 0 -72px !important;
}

.jsoneditor-tree button.jsoneditor-invisible {
  background-image: none !important;
  background-color: transparent !important;
}

.jsoneditor-search button.jsoneditor-refresh,
.jsoneditor-search button.jsoneditor-next,
.jsoneditor-search button.jsoneditor-previous {
  display: inline-block !important;
}

.jsoneditor-search button.jsoneditor-next {
  background-position: -24px -48px !important;
}

.jsoneditor-search button.jsoneditor-previous {
  background-position: -24px -72px !important;
}

.jsoneditor-search button.jsoneditor-refresh {
  background-position: -24px -24px !important;
}

/* === Global: override Riverlea's flex button styling === */

/* Riverlea (_fixes.css) sets .crm-container a.button to display:flex !important.
   We override globally to inline-flex so buttons sit side by side. */
.crm-container a.button,
.crm-container a.button:link,
.crm-container a.button:visited {
  display: inline-flex !important;
}
