/**
 * Circloud GUI - Table Styles
 */

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 8px;
  font-size: 12px;
  background: var(--table-bg, white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1), 0 0 0 1px rgba(48, 54, 61, 0.5);
}

th {
  background: var(--table-header-bg, #f8f9fa);
  color: var(--table-header-color, #333);
  font-weight: 600;
  padding: 3px 6px;
  text-align: left;
  border-bottom: 1px solid var(--table-header-border, #e0e0e0);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
}

th:first-child {
  border-top-left-radius: 8px;
}

th:last-child {
  border-top-right-radius: 8px;
}

td {
  padding: 3px 6px;
  border-bottom: 1px solid var(--table-cell-border, #f0f0f0);
  color: var(--table-cell-color, #555);
  transition: all 0.15s ease;
  font-size: 11px;
}

tr:last-child td {
  border-bottom: none;
}

tr:last-child td:first-child {
  border-bottom-left-radius: 8px;
}

tr:last-child td:last-child {
  border-bottom-right-radius: 8px;
}

tbody tr {
  transition: all 0.15s ease;
}

tbody tr:hover {
  background: var(--table-row-hover-bg, #f8f9fa);
}

.pods th {
  font-size: 9px;
  padding: 4px 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pods td {
  font-size: 10px;
  padding: 4px 6px;
  line-height: 1.1;
  vertical-align: middle;
}

.id-with-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.id-with-copy .copy-btn {
  margin-left: 0;
  padding: 2px 4px;
}

/* Replica row styling */
tr.replica-row {
  background: var(--table-row-replica-bg, #f9f9f9);
}

tr.replica-row td {
  padding: 2px 6px;
  font-size: 10px;
  line-height: 1.1;
  vertical-align: middle;
}

tr.replica-row:hover {
  background: var(--table-row-hover-bg, #f0f0f0);
}

/* System pods table: keep rows compact and prevent multi-line wrapping */
table.pods.system-pods th,
table.pods.system-pods td {
  white-space: nowrap;
}

table.pods.system-pods td:nth-child(4) .pod-image {
  display: inline-block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
  vertical-align: middle;
}

table.pods td .pod-image {
  display: inline-block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

table.pods th:first-child,
table.pods td:first-child {
  min-width: 120px;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

table.pods th.pod-id,
table.pods td.pod-id {
  width: 34px;
  text-align: center;
}

table.pods td.pod-id .id-copy-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 4px;
}

table.pods td.pod-network {
  max-width: 110px;
  white-space: nowrap;
}

table.pods td.pod-network .net-metrics {
  display: inline-flex;
  gap: 6px;
  white-space: nowrap;
}

table.pods td.pod-network .net-value {
  min-width: 42px;
}

table.pods td.pod-flags {
  text-align: center;
  white-space: nowrap;
}

.pod-flags {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 40px;
}

.pod-flags-empty {
  color: var(--text-muted, #6d7696);
  font-size: 10px;
}

.pod-flag {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.15);
  text-decoration: none;
}

.pod-flag-p {
  color: #5ecbff;
  background: rgba(94, 203, 255, 0.18);
  border-color: rgba(94, 203, 255, 0.3);
}

.pod-flag-h {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.3);
}

.pod-flag-s {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.18);
  border-color: rgba(167, 139, 250, 0.3);
}

.pod-flag-t {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.32);
}

.pod-flag-t:hover {
  filter: brightness(1.08);
}

table.pods td.pod-mount code {
  display: inline-block;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
