/* GovGreed Clean Table Design — Phase 26 (Perplexity-inspired) */

.clean-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  background: var(--surface, #0d1520);
  border: 1px solid var(--border, #1e3352);
  border-radius: 12px;
  overflow: hidden;
}

.clean-table thead th {
  background: var(--surface2, #121e2d);
  border-bottom: 2px solid var(--border, #1e3352);
  padding: 12px 16px;
  text-align: left;
  color: var(--dim, #6a8499);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
  font-family: inherit;
  position: sticky;
  top: 0;
  z-index: 2;
}

.clean-table thead th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}
.clean-table thead th.sortable:hover {
  color: var(--text, #c8d8e8);
}
.clean-table thead th.sort-active {
  color: var(--green, #00d672);
}

.clean-table tbody tr {
  transition: background 0.12s;
}
.clean-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.clean-table tbody td {
  padding: 14px 16px;
  vertical-align: middle;
  border-bottom: 1px solid rgba(30, 51, 82, 0.4);
  color: var(--text, #c8d8e8);
  font-size: 13px;
}
.clean-table tbody tr:last-child td {
  border-bottom: none;
}

/* ── Clickable rows ── */
.clean-table tbody tr.clickable {
  cursor: pointer;
}
.clean-table tbody tr.clickable:hover {
  background: rgba(0, 214, 114, 0.03);
}

/* ── Ticker cell with logo ── */
.ct-ticker-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ct-ticker-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface2, #121e2d);
  flex-shrink: 0;
}
.ct-ticker-logo-fallback {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  color: #fff;
}
.ct-ticker-name {
  font-weight: 600;
  color: var(--bright, #eef4fa);
  font-size: 13px;
  line-height: 1.2;
}
.ct-ticker-sub {
  font-size: 10px;
  color: var(--dim, #6a8499);
  letter-spacing: 0.3px;
}

/* ── Politician cell with photo ── */
.ct-politician-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ct-politician-photo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface2, #121e2d);
  flex-shrink: 0;
  border: 1px solid var(--border, #1e3352);
}
.ct-politician-initials {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--dim, #6a8499);
  background: var(--surface2, #121e2d);
  flex-shrink: 0;
}
.ct-politician-name {
  font-weight: 600;
  color: var(--bright, #eef4fa);
  font-size: 13px;
}
.ct-politician-meta {
  font-size: 10px;
  color: var(--dim, #6a8499);
}

/* ── Party badges ── */
.ct-party {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
  vertical-align: middle;
}
.ct-party-D {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
}
.ct-party-R {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}
.ct-party-I {
  background: rgba(168, 85, 247, 0.15);
  color: #a78bfa;
}

/* ── Type badges (Buy/Sell) ── */
.ct-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.ct-type-buy {
  background: rgba(0, 214, 114, 0.1);
  color: var(--green, #00d672);
  border: 1px solid rgba(0, 214, 114, 0.2);
}
.ct-type-sell {
  background: rgba(255, 51, 102, 0.1);
  color: var(--red, #ff3366);
  border: 1px solid rgba(255, 51, 102, 0.2);
}
.ct-type-exercise {
  background: rgba(168, 85, 247, 0.1);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.2);
}

/* ── Value formatting ── */
.ct-val-pos { color: var(--green, #00d672); font-weight: 600; }
.ct-val-neg { color: var(--red, #ff3366); font-weight: 600; }
.ct-val-dim { color: var(--dim, #6a8499); }
.ct-val-mono { font-family: var(--font-mono, 'Geist Mono', monospace); }

/* ── Filed After column ── */
.ct-filed-after {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
}
.ct-filed-fast { color: var(--green, #00d672); font-weight: 600; }
.ct-filed-slow { color: var(--red, #ff3366); }
.ct-filed-normal { color: var(--dim, #6a8499); }

/* ── Amount range ── */
.ct-amount {
  font-size: 12px;
  color: var(--text, #c8d8e8);
  white-space: nowrap;
}

/* ── Politician avatar (compact) ── */
.ct-pol-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--surface2, #121e2d);
  color: var(--dim, #6a8499);
  border: 1px solid var(--border, #1e3352);
}
.ct-pol-avatar.ct-party-D { border-color: rgba(96, 165, 250, 0.4); color: #60a5fa; }
.ct-pol-avatar.ct-party-R { border-color: rgba(248, 113, 113, 0.4); color: #f87171; }
.ct-pol-avatar.ct-party-I { border-color: rgba(168, 85, 247, 0.4); color: #a78bfa; }

.ct-pol-name {
  font-weight: 600;
  color: var(--bright, #eef4fa);
  font-size: 13px;
  line-height: 1.2;
}
.ct-pol-meta {
  font-size: 10px;
  color: var(--dim, #6a8499);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 1px;
}

/* ── Party badge (inline) ── */
.ct-party-badge {
  display: inline-block;
  padding: 0 5px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.ct-party-badge.ct-party-D { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }
.ct-party-badge.ct-party-R { background: rgba(248, 113, 113, 0.15); color: #f87171; }
.ct-party-badge.ct-party-I { background: rgba(168, 85, 247, 0.15); color: #a78bfa; }

/* ── Clickable rows ── */
.ct-clickable-row {
  cursor: pointer;
  transition: background 0.12s;
}
.ct-clickable-row:hover {
  background: rgba(0, 214, 114, 0.03);
}

/* ── Empty state ── */
.clean-table-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--dim, #6a8499);
  font-size: 13px;
}
.clean-table-empty-icon {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* ── Loading skeleton for tables ── */
.ct-skeleton td {
  padding: 14px 16px;
}
.ct-skeleton-bar {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #1e3352 25%, #253d58 50%, #1e3352 75%);
  background-size: 200% 100%;
  animation: ct-shimmer 1.5s infinite linear;
}
@keyframes ct-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .clean-table thead th,
  .clean-table tbody td {
    padding: 10px 12px;
    font-size: 12px;
  }
  .ct-politician-photo,
  .ct-politician-initials {
    width: 30px;
    height: 30px;
  }
}
