/**
 * Playlist Health Lab — premium layout helpers
 * tools/m3u-stream-lab.php
 */

.sl-hero-note {
  font-size: 13px;
  color: var(--text-secondary, #64748b);
  line-height: 1.55;
  margin-top: 8px;
}

.sl-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.sl-modal-backdrop[hidden] {
  display: none !important;
}

.sl-modal {
  width: min(520px, 100%);
  background: var(--card-bg, #fff);
  color: var(--text-primary, #0f172a);
  border-radius: 16px;
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.25);
  padding: 22px 22px 18px;
  max-height: min(90vh, 640px);
  overflow-y: auto;
}

.sl-modal h3 {
  margin: 0 0 12px;
  font-size: 1.15rem;
  font-weight: 700;
}

.sl-quote-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin: 14px 0;
  font-size: 13px;
}

.sl-quote-grid dt {
  color: var(--text-muted, #64748b);
  margin: 0;
  font-weight: 500;
}

.sl-quote-grid dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.sl-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

.sl-results-panel {
  margin-top: 18px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 16px;
  background: var(--surface-elevated, #f8fafc);
  padding: 16px 16px 14px;
}

.sl-results-panel[hidden] {
  display: none !important;
}

.sl-health-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.sl-health-score {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.sl-health-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sl-health-badge.excellent {
  background: #dcfce7;
  color: #166534;
}

.sl-health-badge.good {
  background: #dbeafe;
  color: #1e40af;
}

.sl-health-badge.cleanup {
  background: #fef3c7;
  color: #92400e;
}

.sl-health-badge.bad {
  background: #fee2e2;
  color: #991b1b;
}

.sl-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 10px;
}

.sl-tab {
  border: 1px solid var(--border, #e2e8f0);
  background: var(--surface, #fff);
  color: var(--text-secondary, #475569);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.sl-tab.is-active {
  background: var(--primary, #6366f1);
  color: #fff;
  border-color: transparent;
}

.sl-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.sl-toolbar input,
.sl-toolbar select {
  min-width: 160px;
  flex: 1 1 160px;
}

.sl-table-wrap {
  overflow: auto;
  max-height: min(52vh, 520px);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  background: var(--surface, #fff);
}

.sl-results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.sl-results-table th,
.sl-results-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  text-align: left;
  vertical-align: top;
}

.sl-results-table th {
  position: sticky;
  top: 0;
  background: #f1f5f9;
  z-index: 1;
  font-weight: 700;
}

.sl-results-table .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  word-break: break-all;
  max-width: 280px;
}

.sl-st-working {
  color: #047857;
  font-weight: 700;
}

.sl-st-slow {
  color: #b45309;
  font-weight: 700;
}

.sl-st-dead {
  color: #b91c1c;
  font-weight: 700;
}

.sl-st-blocked,
.sl-st-account_issue {
  color: #6d28d9;
  font-weight: 700;
}

.sl-st-timeout {
  color: #c2410c;
  font-weight: 700;
}

.sl-st-ip_restricted {
  color: #be185d;
  font-weight: 700;
}

.sl-st-server_error {
  color: #dc2626;
  font-weight: 700;
}

.sl-st-unknown {
  color: #64748b;
  font-weight: 600;
}

.sl-download-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.sl-download-bar .btn {
  font-size: 12px;
}

.sl-progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px 10px;
  margin-top: 10px;
  font-size: 12px;
}

.sl-progress-grid span {
  display: block;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
}

@media (max-width: 640px) {
  .sl-quote-grid {
    grid-template-columns: 1fr;
  }
  .sl-quote-grid dd {
    text-align: left;
  }
}
