/* ============================================================
   Bulk HTTP Status Checker — Stylesheet v1.0.0
   ============================================================ */

/* ── Reset & base ─────────────────────────────────────────── */
.bhsc-wrap *,
.bhsc-wrap *::before,
.bhsc-wrap *::after {
	box-sizing: border-box;
}

.bhsc-wrap {
	--bhsc-primary:    #2563eb;
	--bhsc-primary-h:  #1d4ed8;
	--bhsc-secondary:  #0ea5e9;
	--bhsc-success:    #16a34a;
	--bhsc-warning:    #d97706;
	--bhsc-danger:     #dc2626;
	--bhsc-gray-50:    #f8fafc;
	--bhsc-gray-100:   #f1f5f9;
	--bhsc-gray-200:   #e2e8f0;
	--bhsc-gray-300:   #cbd5e1;
	--bhsc-gray-400:   #94a3b8;
	--bhsc-gray-500:   #64748b;
	--bhsc-gray-600:   #475569;
	--bhsc-gray-700:   #334155;
	--bhsc-gray-800:   #1e293b;
	--bhsc-gray-900:   #0f172a;
	--bhsc-radius:     10px;
	--bhsc-radius-sm:  6px;
	--bhsc-shadow:     0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
	--bhsc-shadow-md:  0 4px 6px -1px rgba(0,0,0,.10), 0 2px 4px -1px rgba(0,0,0,.06);

	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
	font-size: 14px;
	color: var(--bhsc-gray-800);
	line-height: 1.5;
	max-width: 1200px;
	margin: 0 auto;
}

/* ── Panels ───────────────────────────────────────────────── */
.bhsc-panel {
	background: #fff;
	border: 1px solid var(--bhsc-gray-200);
	border-radius: var(--bhsc-radius);
	padding: 24px;
	margin-bottom: 20px;
	box-shadow: var(--bhsc-shadow);
}

/* ── Input panel ──────────────────────────────────────────── */
.bhsc-title {
	font-size: 22px;
	font-weight: 700;
	color: var(--bhsc-gray-900);
	margin: 0 0 6px;
}

.bhsc-subtitle {
	color: var(--bhsc-gray-500);
	margin: 0 0 18px;
}

.bhsc-textarea {
	width: 100%;
	border: 1px solid var(--bhsc-gray-300);
	border-radius: var(--bhsc-radius-sm);
	padding: 12px 14px;
	font-size: 13px;
	font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
	color: var(--bhsc-gray-800);
	resize: vertical;
	transition: border-color .15s;
	background: var(--bhsc-gray-50);
}

.bhsc-textarea:focus {
	outline: none;
	border-color: var(--bhsc-primary);
	background: #fff;
	box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.bhsc-input-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin: 8px 0 16px;
	font-size: 12px;
}

.bhsc-url-count { color: var(--bhsc-primary); font-weight: 600; }
.bhsc-max-note  { color: var(--bhsc-gray-400); }

/* ── Buttons ──────────────────────────────────────────────── */
.bhsc-actions { display: flex; gap: 10px; align-items: center; }

.bhsc-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: none;
	border-radius: var(--bhsc-radius-sm);
	padding: 9px 18px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s, opacity .15s, transform .1s;
	text-decoration: none;
}

.bhsc-btn:active { transform: scale(.98); }

.bhsc-btn-primary {
	background: var(--bhsc-primary);
	color: #fff;
}
.bhsc-btn-primary:hover { background: var(--bhsc-primary-h); }
.bhsc-btn-primary:disabled { opacity: .55; cursor: not-allowed; }

.bhsc-btn-secondary {
	background: var(--bhsc-gray-100);
	color: var(--bhsc-gray-700);
	border: 1px solid var(--bhsc-gray-200);
}
.bhsc-btn-secondary:hover { background: var(--bhsc-gray-200); }

.bhsc-btn-ghost {
	background: transparent;
	color: var(--bhsc-gray-500);
	border: 1px solid var(--bhsc-gray-200);
}
.bhsc-btn-ghost:hover { background: var(--bhsc-gray-100); }

/* ── Progress ─────────────────────────────────────────────── */
.bhsc-progress-header {
	display: flex;
	justify-content: space-between;
	margin-bottom: 10px;
	font-weight: 600;
	color: var(--bhsc-gray-700);
}

.bhsc-progress-bar-track {
	height: 10px;
	background: var(--bhsc-gray-100);
	border-radius: 99px;
	overflow: hidden;
}

.bhsc-progress-bar-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--bhsc-primary), var(--bhsc-secondary));
	border-radius: 99px;
	transition: width .3s ease;
}

/* ── Summary ──────────────────────────────────────────────── */
.bhsc-section-title {
	font-size: 15px;
	font-weight: 700;
	color: var(--bhsc-gray-700);
	margin: 0 0 14px;
}

.bhsc-summary-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.bhsc-summary-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: var(--bhsc-gray-50);
	border: 1px solid var(--bhsc-gray-200);
	border-radius: var(--bhsc-radius-sm);
	padding: 14px 22px;
	min-width: 90px;
	text-align: center;
}

.bhsc-summary-card .sc-count {
	font-size: 26px;
	font-weight: 800;
	line-height: 1;
	margin-bottom: 4px;
}

.bhsc-summary-card .sc-label {
	font-size: 11px;
	font-weight: 600;
	color: var(--bhsc-gray-500);
	text-transform: uppercase;
	letter-spacing: .04em;
}

.bhsc-summary-card.sc-total  .sc-count { color: var(--bhsc-gray-700); }
.bhsc-summary-card.sc-2xx    .sc-count { color: var(--bhsc-success); }
.bhsc-summary-card.sc-3xx    .sc-count { color: var(--bhsc-warning); }
.bhsc-summary-card.sc-4xx    .sc-count { color: var(--bhsc-danger); }
.bhsc-summary-card.sc-5xx    .sc-count { color: #9333ea; }
.bhsc-summary-card.sc-errors .sc-count { color: var(--bhsc-gray-400); }
.bhsc-summary-card.sc-other  .sc-count { color: var(--bhsc-secondary); }

/* ── Toolbar ──────────────────────────────────────────────── */
.bhsc-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
	flex-wrap: wrap;
	gap: 10px;
}

/* Toggle switch */
.bhsc-toggle-label {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	font-weight: 600;
	color: var(--bhsc-gray-700);
	user-select: none;
}

.bhsc-toggle-label input[type="checkbox"] { display: none; }

.bhsc-toggle-track {
	position: relative;
	width: 40px;
	height: 22px;
	background: var(--bhsc-gray-300);
	border-radius: 99px;
	transition: background .2s;
	flex-shrink: 0;
}

.bhsc-toggle-label input:checked + .bhsc-toggle-track {
	background: var(--bhsc-primary);
}

.bhsc-toggle-thumb {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 16px;
	height: 16px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0,0,0,.2);
	transition: transform .2s;
}

.bhsc-toggle-label input:checked + .bhsc-toggle-track .bhsc-toggle-thumb {
	transform: translateX(18px);
}

/* ── Table ────────────────────────────────────────────────── */
.bhsc-table-wrap {
	overflow-x: auto;
	border-radius: var(--bhsc-radius);
	border: 1px solid var(--bhsc-gray-200);
	box-shadow: var(--bhsc-shadow);
	background: #fff;
}

.bhsc-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.bhsc-table thead tr {
	background: var(--bhsc-gray-50);
	border-bottom: 2px solid var(--bhsc-gray-200);
}

.bhsc-table th {
	padding: 11px 14px;
	text-align: left;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--bhsc-gray-500);
	white-space: nowrap;
}

.bhsc-table td {
	padding: 11px 14px;
	vertical-align: top;
	border-bottom: 1px solid var(--bhsc-gray-100);
	word-break: break-all;
}

.bhsc-table tbody tr:last-child td { border-bottom: none; }

.bhsc-table tbody tr:hover { background: var(--bhsc-gray-50); }

.bhsc-col-num    { width: 44px; color: var(--bhsc-gray-400); font-variant-numeric: tabular-nums; }
.bhsc-col-url    { min-width: 200px; }
.bhsc-col-final  { min-width: 200px; }
.bhsc-col-status { width: 100px; }
.bhsc-col-hops   { min-width: 260px; }

/* ── Status badges ────────────────────────────────────────── */
.bhsc-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 9px;
	border-radius: 99px;
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
}

.bhsc-badge-2xx   { background: #dcfce7; color: #15803d; }
.bhsc-badge-3xx   { background: #fef9c3; color: #a16207; }
.bhsc-badge-4xx   { background: #fee2e2; color: #b91c1c; }
.bhsc-badge-5xx   { background: #f3e8ff; color: #7c3aed; }
.bhsc-badge-error { background: var(--bhsc-gray-100); color: var(--bhsc-gray-500); }

/* ── Hop chain ────────────────────────────────────────────── */
.bhsc-hop-chain {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.bhsc-hop {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	font-size: 12px;
	line-height: 1.4;
}

.bhsc-hop-num {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	background: var(--bhsc-gray-200);
	color: var(--bhsc-gray-600);
	border-radius: 50%;
	font-size: 10px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: 1px;
}

.bhsc-hop-url  { color: var(--bhsc-gray-600); flex: 1; }
.bhsc-hop-arrow { color: var(--bhsc-gray-400); font-size: 10px; }

/* ── URL link ─────────────────────────────────────────────── */
.bhsc-url-link {
	color: var(--bhsc-primary);
	text-decoration: none;
	word-break: break-all;
}
.bhsc-url-link:hover { text-decoration: underline; }

.bhsc-same-url { color: var(--bhsc-gray-400); font-style: italic; font-size: 12px; }

/* ── Pagination ───────────────────────────────────────────── */
.bhsc-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 6px;
	margin-top: 20px;
	flex-wrap: wrap;
}

.bhsc-page-btn {
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	border: 1px solid var(--bhsc-gray-200);
	background: #fff;
	border-radius: var(--bhsc-radius-sm);
	font-size: 13px;
	font-weight: 600;
	color: var(--bhsc-gray-700);
	cursor: pointer;
	transition: background .15s, border-color .15s, color .15s;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.bhsc-page-btn:hover:not(:disabled) {
	background: var(--bhsc-gray-100);
	border-color: var(--bhsc-gray-300);
}

.bhsc-page-btn.active {
	background: var(--bhsc-primary);
	border-color: var(--bhsc-primary);
	color: #fff;
}

.bhsc-page-btn:disabled {
	opacity: .4;
	cursor: not-allowed;
}

.bhsc-page-info {
	font-size: 13px;
	color: var(--bhsc-gray-500);
	padding: 0 6px;
}

/* ── Toast ────────────────────────────────────────────────── */
.bhsc-toast {
	position: fixed;
	bottom: 28px;
	right: 28px;
	background: var(--bhsc-gray-800);
	color: #fff;
	padding: 12px 20px;
	border-radius: var(--bhsc-radius-sm);
	font-size: 13px;
	font-weight: 600;
	box-shadow: var(--bhsc-shadow-md);
	z-index: 9999;
	animation: bhsc-fade-in .2s ease;
}

@keyframes bhsc-fade-in {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
	.bhsc-panel    { padding: 16px; }
	.bhsc-toolbar  { flex-direction: column; align-items: flex-start; }
	.bhsc-hops-col { display: none; }
	.bhsc-col-url, .bhsc-col-final { min-width: 130px; }
}
