/* Tenderduty Modern Theme - Final Polish */

:root {
  /* Color Palette */
  --bg-primary: #0a0e17;
  --bg-secondary: #0f1520;
  --bg-tertiary: #141c2b;
  --glass-bg: rgba(20, 35, 65, 0.4);
  --glass-border: rgba(59, 130, 246, 0.15);
  --glass-border-hover: rgba(59, 130, 246, 0.3);

  /* Accent Colors */
  --accent-primary: #3b82f6;
  --accent-secondary: #60a5fa;
  --accent-light: #93c5fd;
  --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;

  /* Text Colors */
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  /* Transitions */
  --transition-normal: 0.2s ease;
}

/* Base Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  line-height: 1.5;
}

/* Glassmorphism Card */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  transition: border-color var(--transition-normal);
}

.glass-card:hover {
  border-color: var(--glass-border-hover);
}

/* Main Container */
.td-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.td-header {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  margin-bottom: 24px;
}

.td-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-secondary);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Tab Navigation */
.td-tabs {
  display: flex;
  gap: 8px;
  padding: 6px;
  background: var(--glass-bg);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  border: 1px solid var(--glass-border);
  width: fit-content;
}

.td-tab {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.td-tab:hover {
  color: var(--text-primary);
  background: rgba(59, 130, 246, 0.1);
}

.td-tab.active {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.td-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.td-tab:not(.active) .td-tab-badge {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-secondary);
}

/* Grid Canvas Container */
.td-grid-container {
  padding: 24px;
  margin-bottom: 24px;
  overflow-x: auto;
}

.td-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
}

.td-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.td-legend-color {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

/* Chain Table - Strict Alignment */
.td-table-container {
  overflow: hidden;
  margin-bottom: 24px;
}

.td-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.td-table th {
  text-align: left;
  padding: 20px 24px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: rgba(10, 14, 23, 0.8);
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
}

.td-table td {
  padding: 20px 24px;
  border-bottom: 1px solid var(--glass-border);
  vertical-align: middle;
  background: transparent;
  transition: background 0.2s ease;
  height: 80px;
  /* Force consistent row height */
}

.td-table tr:hover td {
  background: rgba(59, 130, 246, 0.03);
}

.td-table tr:last-child td {
  border-bottom: none;
}

/* Table Columns Widths */
.col-alert {
  width: 50px;
  text-align: center;
}

.col-chain {
  width: 25%;
}

.col-height {
  width: 15%;
}

.col-moniker {
  width: 20%;
}

.col-status {
  width: 10%;
  text-align: center;
}

.col-uptime {
  width: 15%;
}

.col-nodes {
  width: 15%;
  text-align: right;
}

/* Status Badges */
.td-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.td-badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.td-badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.td-badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.td-badge-info {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-primary);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Column Content Styling */
.td-chain-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
}

.td-chain-id {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-family: 'JetBrains Mono', monospace;
}

.td-moniker {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: var(--text-secondary);
}

.td-height {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  /* Brighter */
}

.td-height.updating {
  color: var(--accent-primary);
  text-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
  transition: all 0.2s ease;
}

.td-nodes {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  font-family: 'JetBrains Mono', monospace;
}

.td-node-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}

.td-node-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.3;
}

.td-node-dot.active {
  background: var(--accent-success);
  opacity: 1;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.td-node-dot.down {
  background: var(--accent-danger);
  opacity: 1;
}

.td-uptime {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.td-uptime-percent {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.td-uptime-ratio {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

/* Footer */
.td-footer {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
  font-size: 0.8rem;
  opacity: 0.6;
}

.td-footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

/* Mobile Responsive */
@media (max-width: 900px) {

  .td-table th,
  .td-table td {
    padding: 12px 16px;
    height: auto;
  }

  .col-uptime,
  .col-nodes {
    display: none;
  }
}

@media (max-width: 600px) {
  .td-header {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .td-tabs {
    width: 100%;
    flex-wrap: wrap;
  }

  .td-tab {
    flex: 1;
    justify-content: center;
  }

  .col-height,
  .col-status {
    display: none;
  }

  .td-table th {
    font-size: 0.65rem;
  }

  .td-chain-name {
    font-size: 0.9rem;
  }

  .td-container {
    padding: 10px;
  }

  .td-table-container {
    overflow-x: auto;
  }

  .td-table {
    min-width: 100%;
  }

  /* Hide grid explicitly */
  .td-grid-container {
    display: none;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}