/* sne.space — Native Modern Catalog Table Stylesheet */

.catalog-table-wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* Control Card & Filters */
.catalog-controls-card {
  background: var(--surface-card, #0d1424);
  border: 1px solid var(--border-subtle, #1e293b);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.controls-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  opacity: 0.6;
  pointer-events: none;
}

.catalog-search-input {
  width: 100%;
  padding: 0.65rem 2.2rem 0.65rem 2.4rem;
  background: rgba(7, 10, 18, 0.85);
  border: 1px solid var(--border-bright, #334155);
  border-radius: 8px;
  color: #f8fafc;
  font-size: 0.92rem;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.catalog-search-input:focus {
  outline: none;
  border-color: var(--accent-cyan, #38bdf8);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
  background: rgba(11, 17, 32, 0.95);
}

.search-clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 4px;
}

.search-clear-btn:hover {
  color: #fff;
}

.export-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
}

.btn-export {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

.btn-export:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  text-decoration: none;
}

/* Filter Pills */
.filter-pills-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.type-filter-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.filter-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
}

.filter-chip.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.5);
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.chip-count {
  font-size: 0.68rem;
  opacity: 0.8;
  font-weight: 400;
}

.toggle-filter-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: #cbd5e1;
  cursor: pointer;
  user-select: none;
}

.toggle-pill input[type="checkbox"] {
  accent-color: #38bdf8;
  cursor: pointer;
}

/* Table Container & Base */
.table-responsive-box {
  background: var(--surface-card, #0d1424);
  border: 1px solid var(--border-subtle, #1e293b);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.45);
}

.table-loading-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #38bdf8, #818cf8, #38bdf8);
  background-size: 200% 100%;
  animation: loadingGradient 1.2s infinite linear;
  z-index: 10;
}

@keyframes loadingGradient {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.native-transient-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.native-transient-table thead th {
  background: #080c16;
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle, #1e293b);
  white-space: nowrap;
  user-select: none;
}

.native-transient-table thead th.th-sortable {
  cursor: pointer;
  transition: color 0.15s ease;
}

.native-transient-table thead th.th-sortable:hover {
  color: #fff;
  background: #0d1527;
}

.native-transient-table thead th.th-sortable.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.05);
}

.sort-indicator {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.72rem;
  opacity: 0.7;
}

.native-transient-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background-color 0.15s ease;
}

.native-transient-table tbody tr:hover {
  background-color: rgba(56, 189, 248, 0.04);
}

.native-transient-table tbody td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  color: #e2e8f0;
}

/* Cell Formatting */
.cell-name .name-link {
  font-weight: 700;
  font-size: 0.92rem;
  color: #38bdf8;
  text-decoration: none;
  letter-spacing: -0.01em;
  display: inline-block;
}

.cell-name .name-link:hover {
  text-decoration: underline;
  color: #7dd3fc;
}

.type-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-ia {
  background: rgba(168, 85, 247, 0.16);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.badge-ii {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-ibc {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-slsn {
  background: rgba(236, 72, 153, 0.16);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.35);
}

.badge-tde {
  background: rgba(6, 182, 212, 0.16);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.35);
}

.badge-other, .badge-unknown {
  background: rgba(100, 116, 139, 0.16);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

.cell-date {
  white-space: nowrap;
}

.val-date {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.83rem;
  color: #cbd5e1;
}

.sub-age {
  display: block;
  font-size: 0.7rem;
  color: #7dd3fc;
  font-weight: 600;
}

.cell-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  color: #cbd5e1;
  white-space: nowrap;
}

.cell-coords {
  white-space: nowrap;
}

.coord-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.15s ease;
}

.coord-tag:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

.coord-tag.copied {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
}

.cell-host {
  color: #cbd5e1;
  font-size: 0.82rem;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 2px 7px;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s ease;
}

.pill-spec {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.pill-spec:hover {
  background: rgba(245, 158, 11, 0.25);
  color: #fde68a;
  text-decoration: none;
}

.pill-phot {
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.pill-phot:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #bae6fd;
  text-decoration: none;
}

.pill-dim {
  color: #64748b;
  font-size: 0.8rem;
}

.cell-actions {
  white-space: nowrap;
  display: flex;
  gap: 0.35rem;
}

.btn-action {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.btn-pro {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

.btn-pro:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  text-decoration: none;
}

.btn-story {
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.2);
  color: #c084fc;
}

.btn-story:hover {
  background: rgba(168, 85, 247, 0.2);
  color: #e9d5ff;
  text-decoration: none;
}

/* Pagination Bar */
.catalog-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0.25rem 0;
  flex-wrap: wrap;
  gap: 1rem;
}

.pagination-info {
  font-size: 0.85rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pagination-info span {
  color: #f1f5f9;
  font-weight: 600;
}

.telemetry-badge {
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.per-page-selector {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: #94a3b8;
}

.per-page-selector select {
  background: #070a12;
  border: 1px solid var(--border-bright, #334155);
  color: #f1f5f9;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 0.82rem;
  cursor: pointer;
}

.page-nav-btns {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.page-btn {
  background: #080d1a;
  border: 1px solid var(--border-subtle, #1e293b);
  color: #cbd5e1;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.page-btn:hover:not(:disabled) {
  background: #1e293b;
  border-color: #334155;
  color: #fff;
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-indicator {
  font-size: 0.82rem;
  color: #94a3b8;
  padding: 0 0.4rem;
}

@media (max-width: 900px) {
  .table-responsive-box {
    overflow-x: auto;
  }
  .controls-top-row, .filter-pills-row, .catalog-pagination-bar {
    flex-direction: column;
    align-items: stretch;
  }
}
