/* PulseChain Explorer — Table Styles */

/* I1485: alias .table-responsive to .data-table-wrapper so both patterns
   get horizontal scroll on narrow viewports. csv-export.html uses the
   bootstrap-style name; rest of the app uses .data-table-wrapper. */
.data-table-wrapper,
.table-responsive {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table thead th {
  padding: 10px 12px;
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}

/* Specificity bump: `.data-table thead th` (0,0,1,2) was overriding the
   `.text-right` utility class (0,0,1,0) so headers like
   `<th class="text-right">TVL</th>` stayed left-aligned even though the
   matching `<td class="text-right">` body cells were right-aligned —
   visible misalignment between header and column values. Match the
   selector specificity of the base `thead th` rule so the utility wins. */
.data-table thead th.text-right { text-align: right; }
.data-table thead th.text-center { text-align: center; }

.data-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.1s;
}

.data-table tbody tr:hover { background: var(--bg-card-hover); }

.data-table tbody td {
  padding: 10px 12px;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table .hash-link {
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.data-table .addr-cell {
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.direction-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
}

/* I1814 slice 5: migrated to theme-adaptive --*-bg / --* tokens (light theme
   correctly desaturates from 0.15 alpha → 0.08 alpha; dark theme renders
   bit-identical). Tokens defined in style.css :root + [data-theme="dark"]. */
.direction-arrow.arrow-in { background: var(--success-bg); color: var(--success); }
.direction-arrow.arrow-out { background: var(--warning-bg); color: var(--warning); }
.direction-arrow.arrow-self { background: var(--info-bg); color: var(--info); }

.from-to { display: flex; align-items: center; gap: 4px; font-size: 0.82rem; }

.data-table tbody td.from-to-stacked {
  white-space: normal;
  line-height: 1.2;
  font-size: 0.78rem;
  padding-top: 4px;
  padding-bottom: 4px;
}

.data-table tbody td.from-to-stacked div {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table tbody td.from-to-stacked .to-arrow {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.65rem;
}

/* I1814 slice 5: migrated to --success-bg / --error-bg theme-adaptive tokens. */
.status-icon.success { background: var(--success-bg); color: var(--success); }
.status-icon.failed { background: var(--error-bg); color: var(--error); }

.data-table .value-cell {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-align: right;
}

.data-table .fee-cell { color: var(--text-muted); font-size: 0.8rem; }

.token-col { display: flex; align-items: center; gap: 8px; }

.token-icon-sm {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.data-table.compact thead th { padding: 8px 10px; font-size: 0.72rem; }
.data-table.compact tbody tr { height: 36px; }
.data-table.compact tbody td { padding: 5px 10px; font-size: 0.82rem; vertical-align: middle; }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 12px;
}

.pagination-info { font-size: 0.85rem; color: var(--text-muted); }

.pagination-controls { display: flex; gap: 4px; }

.pagination-controls button,
.pagination-controls a {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

.pagination-controls button:hover:not(:disabled),
.pagination-controls a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.pagination-controls button:disabled { opacity: 0.4; cursor: not-allowed; }

.pagination-controls button.active,
.pagination-controls a.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 600;
}

/* Simple Prev/Page-N/Next pagination — used on infinite-feed pages where
   total page count is unknown (validators, tokentxns, txs, blocks, etc.). */
.pagination-simple {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
}
.pagination-simple button {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
}
.pagination-simple button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.pagination-simple button:disabled { opacity: 0.5; cursor: not-allowed; }
.pagination-simple .page-indicator { color: var(--text-muted); }

.holder-bar { display: flex; align-items: center; gap: 8px; }

.holder-bar-track {
  flex: 0 0 80px;
  height: 4px;
  background: var(--bg-input);
  border-radius: 2px;
  overflow: hidden;
}

.holder-bar-fill { height: 100%; background: var(--accent); border-radius: 2px; }
.holder-bar-text { font-size: 0.8rem; color: var(--text-muted); min-width: 40px; }

@media (max-width: 768px) {
  .data-table { font-size: 0.8rem; }
  .data-table thead th, .data-table tbody td { padding: 8px 6px; }
  .pagination { flex-direction: column; align-items: stretch; text-align: center; }
  /* I410: Responsive holder bar on mobile */
  .holder-bar-track { flex: 0 0 60px; }
  .holder-bar { gap: 4px; }
}
