/* --- NETWORK LAYOUT --- */
.network-list-deck {
  grid-column: 1 / 2;
  /* Takes left side */
  min-height: 500px;
}

.stats-deck {
  grid-column: 2 / 3;
  /* Takes right side */
}

/* --- TOOLBAR --- */
.network-toolbar {
  display: flex;
  justify-content: space-between;
  padding: 15px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-wrapper {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid #333;
  padding: 5px 10px;
  border-radius: 4px;
}

.search-wrapper input {
  background: transparent;
  border: none;
  color: #fff;
  outline: none;
  font-family: monospace;
  margin-left: 5px;
}

.filter-group {
  display: flex;
  gap: 5px;
}

.filter-tag {
  background: transparent;
  border: 1px solid #444;
  color: #888;
  padding: 5px 10px;
  font-size: 10px;
  cursor: pointer;
  transition: 0.2s;
}

.filter-tag.active,
.filter-tag:hover {
  background: var(--neon-teal);
  color: #000;
  border-color: var(--neon-teal);
}

/* --- DATA GRID TABLE --- */
.no-padding {
  padding: 0;
}

.cyber-table-header {
  display: flex;
  padding: 10px 15px;
  font-size: 10px;
  color: #666;
  border-bottom: 1px solid #333;
  letter-spacing: 1px;
}

.cyber-table-body {
  height: 400px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.table-row {
  display: flex;
  padding: 12px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  align-items: center;
  font-size: 12px;
  transition: 0.2s;
}

.table-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Column Widths */
.col-node {
  flex: 2;
  color: #fff;
  font-family: 'Fira Mono', monospace;
}

.col-pair {
  flex: 1.5;
}

.col-pnl {
  flex: 1;
  text-align: right;
  padding-right: 15px;
}

.col-stat {
  flex: 1.5;
  display: flex;
  align-items: center;
  gap: 6px;
}

.col-act {
  flex: 0.5;
  text-align: right;
}

/* Status Dots */
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #555;
}

.status-dot.active {
  background: var(--neon-teal);
  box-shadow: 0 0 5px var(--neon-teal);
}

.status-dot.err {
  background: #ff4444;
}

.status-dot.idle {
  background: #f39c12;
}

.node-icon {
  color: var(--neon-teal);
  margin-right: 5px;
}

.text-dim {
  color: #666;
}

.text-neon {
  color: var(--neon-teal);
}

.text-err {
  color: #ff4444;
}

.text-blue {
  color: #00f3ff;
}

/* --- METRIC BOXES --- */
.metric-box {
  margin-bottom: 20px;
}

.metric-label {
  font-size: 10px;
  color: #666;
  letter-spacing: 1px;
  margin-bottom: 5px;
}

.metric-val {
  font-size: 20px;
  color: #fff;
  font-weight: bold;
}

.metric-bar {
  height: 4px;
  background: #222;
  margin-top: 5px;
  border-radius: 2px;
  overflow: hidden;
}

.metric-bar .fill {
  height: 100%;
  background: var(--neon-teal);
  box-shadow: 0 0 10px var(--neon-teal);
}

/* --- SERVER HEALTH VISUAL --- */
.server-visual {
  padding: 20px;
}

.server-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12px;
  color: #aaa;
}

.signal-bars {
  display: flex;
  gap: 3px;
}

.bar {
  width: 4px;
  height: 12px;
  background: #333;
}

.bar.full {
  background: var(--neon-teal);
}

.bar.half {
  background: #f39c12;
}

.icon-btn-sm {
  background: transparent;
  border: none;
  color: #666;
  cursor: pointer;
}

.icon-btn-sm:hover {
  color: #fff;
}

.loading-scan {
  padding: 40px;
  text-align: center;
  color: var(--neon-teal);
  font-size: 12px;
}

/* Mobile */
@media (max-width: 768px) {
  .network-list-deck {
    grid-column: 1 / -1;
    min-height: auto;
  }

  .stats-deck {
    grid-column: 1 / -1;
  }

  .table-row {
    font-size: 11px;
  }
}

/* --- MOBILE OPTIMIZATIONS --- */
@media (max-width: 768px) {

  /* 1. STACK THE MAIN GRID DECKS */
  .network-list-deck,
  .stats-deck {
    grid-column: 1 / -1;
    /* Full width */
    min-height: auto;
    margin-bottom: 20px;
    /* Add spacing between decks */
  }

  /* 2. FIX TOOLBAR (Stack Search & Filters) */
  .network-toolbar {
    flex-direction: column;
    /* Stack vertically */
    gap: 10px;
    align-items: stretch;
  }

  .search-wrapper {
    width: 100%;
    /* Full width search */
    box-sizing: border-box;
    /* Prevent padding overflow */
  }

  .filter-group {
    justify-content: flex-start;
    overflow-x: auto;
    /* Scroll horizontally if many tags */
    padding-bottom: 5px;
    /* Space for scrollbar */
  }

  /* 3. TRANSFORM TABLE INTO 'CARD' LIST */

  /* Hide the header row (labels don't match stacked layout) */
  .cyber-table-header {
    display: none;
  }

  /* Make row wrap content */
  .table-row {
    flex-wrap: wrap;
    padding: 15px;
    gap: 0;
    /* We handle spacing manually below */
    position: relative;
  }

  /* --- ROW LAYOUT: TOP LINE --- */

  /* Node Name: Top Left (Big) */
  .col-node {
    flex: 0 0 60%;
    /* Takes 60% width */
    font-size: 14px;
    margin-bottom: 4px;
    order: 1;
  }

  /* PnL: Top Right (Bold) */
  .col-pnl {
    flex: 0 0 40%;
    /* Takes 40% width */
    text-align: right;
    font-size: 13px;
    padding-right: 0;
    order: 2;
  }

  /* --- ROW LAYOUT: BOTTOM LINE --- */

  /* Pair: Bottom Left (Dimmed) */
  .col-pair {
    flex: 0 0 60%;
    font-size: 11px;
    color: #888;
    order: 3;
  }

  /* Status: Bottom Right */
  .col-stat {
    flex: 0 0 40%;
    justify-content: flex-end;
    /* Align dot to right */
    font-size: 11px;
    order: 4;
  }

  /* Actions: Hide or Absolute Position */
  .col-act {
    /* Option A: Hide to save space (assume row click works) */
    display: none;

    /* Option B: Floating Icon (uncomment to use) */
    /*
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    */
  }
}
