/* ── Traffic Injector – page-specific styles ── */

/* Tab switcher */
.ti-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.ti-tab-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #adb5bd;
  border-radius: 0.5rem;
  padding: 0.55rem 1.4rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.ti-tab-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.ti-tab-btn.active {
  background: #0d6efd;
  color: #fff;
  border-color: #0d6efd;
}

/* Tab panels */
.ti-tab-panel { display: none; }
.ti-tab-panel.active { display: block; }

/* Form card */
.ti-form-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* PRD guard */
.ti-prd-guard {
  background: rgba(220, 53, 69, 0.08);
  border: 1px solid rgba(220, 53, 69, 0.38);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
}

/* Conditional fields */
.ti-field-cond { display: none; }
.ti-field-cond.visible { display: block; }

/* Run button */
.ti-run-btn {
  min-width: 180px;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.7rem 2rem;
  border-radius: 0.5rem;
}

/* Summary pills */
.ti-summary-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ti-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 2rem;
  padding: 0.3rem 0.9rem;
  font-size: 0.82rem;
  white-space: nowrap;
}

.ti-stat-pill .ti-pill-label { color: #adb5bd; }
.ti-stat-pill .ti-pill-value { font-weight: 700; color: #fff; }
.ti-stat-pill.danger .ti-pill-value { color: #dc3545; }
.ti-stat-pill.success .ti-pill-value { color: #198754; }
.ti-stat-pill.info .ti-pill-value { color: #0dcaf0; }

/* Endpoint stats table */
.ti-stats-table { font-size: 0.84rem; width: 100%; }

.ti-stats-table thead th {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #adb5bd;
  white-space: nowrap;
  padding: 0.5rem 0.75rem;
}

.ti-stats-table tbody td {
  padding: 0.5rem 0.75rem;
  vertical-align: middle;
}

.ti-stats-table .td-endpoint {
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  color: #e0e0e0;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ti-stats-table .td-fail { color: #dc3545; font-weight: 600; }
.ti-stats-table .td-ok { color: #198754; }

/* Phase builder */
.ti-phase-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ti-phase-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  padding: 1rem;
}

.ti-phase-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.ti-phase-badge {
  background: #495057;
  color: #fff;
  border-radius: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  white-space: nowrap;
}

.ti-phase-remove-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid rgba(220, 53, 69, 0.5);
  color: #dc3545;
  border-radius: 0.375rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s;
}

.ti-phase-remove-btn:hover {
  background: rgba(220, 53, 69, 0.15);
}

/* Per-phase result card */
.ti-phase-result {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  padding: 1rem;
}

/* Config banner */
.ti-config-banner {
  background: rgba(255, 193, 7, 0.08);
  border: 1px solid rgba(255, 193, 7, 0.4);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

/* Health badge */
#tiHealthBadge {
  font-size: 0.72rem;
  cursor: default;
  transition: background-color 0.3s;
}
