/* ==========================================================================
   Interaction Landing Page – header + structure picker table
   ========================================================================== */

.interaction-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 4px;
  padding-right: 10%;
}

.interaction-header h2 {
  margin: 0 0 0 5%;
}

.interaction-header-buttons {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 12px;
}

.interaction-header-buttons .btn {
  font-size: 24px;
}

/* --- Inactive (no row selected) button state + hover tooltip -------------
   Dimming via a translucent ::before wash rather than `opacity` on the
   button itself — `opacity` would also cap the ::after tooltip below,
   which is a descendant of this same element and needs to stay fully
   readable on hover regardless of the button's own dimmed state. */
.interaction-header-buttons .btn.btn-inactive {
  cursor: not-allowed;
  position: relative;
}

.interaction-header-buttons .btn.btn-inactive::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.45);
  border-radius: inherit;
  pointer-events: none;
}

.interaction-header-buttons .btn.btn-inactive::after {
  content: attr(data-inactive-tooltip);
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: #333;
  color: #fff;
  font-size: 13px;
  font-weight: normal;
  line-height: 1.3;
  padding: 6px 10px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
  pointer-events: none;
  z-index: 20;
}

.interaction-header-buttons .btn.btn-inactive:hover::after {
  opacity: 1;
  visibility: visible;
}

/* --- Selection styling -------------------------------------------------- */
:root {
  --sel-bg: var(--bs-primary-bg-subtle, #e7f1ff);
}

#InteractionPickerTable tbody tr {
  cursor: pointer;
}

#InteractionPickerTable tbody tr.row-selected td {
  background-color: var(--sel-bg) !important;
}

/* --- Super-header group dividers, running through the whole table --------
   DataTables (scrollX) renders the visible titles/filter header rows as an
   id-less clone inside .dt-scroll-head, while #InteractionPickerTable itself
   stays on the original (mostly invisible) table in .dt-scroll-body — so the
   thead rules below must NOT be id-scoped, or they miss the clone the user
   actually sees. This file is only loaded on this page (one table), so the
   plain `table thead` selector is safe, matching structure_browser_modern.css's
   own convention for the same reason. */
table thead tr:nth-child(3) th:nth-child(6),
table thead tr:nth-child(4) th:nth-child(6),
#InteractionPickerTable tbody td:nth-child(6),
table thead tr:nth-child(3) th:nth-child(9),
table thead tr:nth-child(4) th:nth-child(9),
#InteractionPickerTable tbody td:nth-child(9),
table thead tr:nth-child(3) th:nth-child(12),
table thead tr:nth-child(4) th:nth-child(12),
#InteractionPickerTable tbody td:nth-child(12),
table thead tr:nth-child(3) th:nth-child(17),
table thead tr:nth-child(4) th:nth-child(17),
#InteractionPickerTable tbody td:nth-child(17),
table thead tr:nth-child(3) th:nth-child(19),
table thead tr:nth-child(4) th:nth-child(19),
#InteractionPickerTable tbody td:nth-child(19) {
  border-left: 1px solid #ccc;
}

/* --- Sticky first columns (select, GPCRdb, UniProt, Gene, Protein) ------- */
#InteractionPickerTable tbody td:nth-child(1) {
  position: sticky; left: 0;
  width: 45px; min-width: 45px; max-width: 45px;
  z-index: 5; background: #fff;
}

#InteractionPickerTable tbody td:nth-child(2) {
  position: sticky; left: 45px;
  width: 70px; min-width: 70px; max-width: 70px;
  z-index: 5; background: #fff;
}

#InteractionPickerTable tbody td:nth-child(3) {
  position: sticky; left: 115px;
  width: 100px; min-width: 100px; max-width: 100px;
  z-index: 5; background: #fff;
}

#InteractionPickerTable tbody td:nth-child(4) {
  position: sticky; left: 215px;
  width: 100px; min-width: 100px; max-width: 100px;
  z-index: 5; background: #fff;
}

#InteractionPickerTable tbody td:nth-child(5) {
  position: sticky; left: 315px;
  width: 100px; min-width: 100px; max-width: 100px;
  z-index: 5; background: #fff;
}

/* Persistent divider at the right edge of the sticky Receptor region,
   matching structure_browser_modern.css's own fix for the same boundary:
   a plain border-right on a table cell can get lost to border-collapse
   resolution against the neighboring column's own border, so instead draw
   it as an absolutely-positioned overlay anchored to the (already sticky/
   relative-positioned) cell itself. */
table thead tr:nth-child(2) th:nth-child(1)::after,
table thead tr:nth-child(3) th:nth-child(5)::after,
table thead tr:nth-child(4) th:nth-child(5)::after,
#InteractionPickerTable tbody td:nth-child(5)::after {
  content: "";
  position: absolute; top: 0; right: 0; width: 1px; height: 100%;
  background-color: #ccc; pointer-events: none;
}
