/*
 * Adds sticky header, sticky first column, horizontal scroll wrapper,
 * and custom scrollbar (xbar) to .tr-scrolling-table.
 * Bootstrap handles all visual styling (colours, borders, padding).
 *
 * These styles work on top of the Trade Rumors Base theme for WordPress.
 */

.tr-scrolling-table {
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
}
.tr-scrolling-table::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* Table borders, currently disabled*/
/* Border-separate so borders stay with sticky cells */
/*
.tr-scrolling-table table {
  border-collapse: separate;
  border-spacing: 0;
  border: 0;
  margin: 0;
}
.tr-scrolling-table table th,
.tr-scrolling-table table td {
  border: none;
  border-bottom: 1px solid #dee2e6;
  border-right: 1px solid #dee2e6;
}
.tr-scrolling-table table thead tr:first-child th {
  border-top: 1px solid #dee2e6;
}
.tr-scrolling-table table th:first-child,
.tr-scrolling-table table td:first-child {
  border-left: 1px solid #dee2e6;
}*/

/* Sticky frozen columns (mark header cells with .tr-freeze-col) */
.tr-scrolling-table table th.tr-sticky-col,
.tr-scrolling-table table td.tr-sticky-col,
.tr-fixed-header th.tr-sticky-col {
  position: sticky;
  z-index: 4;
  background-color: inherit;
}
.tr-scrolling-table table thead th.tr-sticky-col,
.tr-fixed-header th.tr-sticky-col {
  z-index: 11;
}

/* ── Custom scrollbar (xbar) ── */
.tr-scrolling-table-scrollbar {
  position: sticky;
  bottom: 0;
  z-index: 50;
  padding: 3px 0 4px;
  background: linear-gradient(180deg, rgba(255,255,255,0.2), rgba(255,255,255,0.9));
  backdrop-filter: blur(2px);
  display: none;
}

.tr-scrolling-table-scrollbar-track {
  position: relative;
  height: 14px;
  border: 1px solid #4b5563;
  background: #2f343d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  cursor: pointer;
  user-select: none;
}

.tr-scrolling-table-scrollbar-thumb {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 120px;
  background: #6b7280;
  border: 1px solid #525a66;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  cursor: grab;
}

.tr-scrolling-table-scrollbar-thumb:active {
  cursor: grabbing;
  background: #818996;
}
