/* ── Broken Link Checker ─────────────────────────────────────────────────── */
.blc-section {
    --blc-accent: #6366F1;
    --blc-accent-rgb: 99, 102, 241;
    --blc-ok: #22c55e;
    --blc-redirect: #f59e0b;
    --blc-broken: #ef4444;
    --blc-timeout: #94a3b8;
    --blc-internal: #6366f1;
    --blc-external: #0ea5e9;
    --tool-accent: #6366F1;
    --tool-accent-rgb: 99, 102, 241;
}

.blc-card {
    padding: 1.5rem;
}

/* ── Hero CTA colour override ────────────────────────────────────────────── */
.tool-page .btn-primary {
    background: #6366F1;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.tool-page .btn-primary:hover {
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

/* ── Input row ───────────────────────────────────────────────────────────── */
.blc-input-row {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.blc-input {
    flex: 1;
    min-width: 200px;
    padding: 0.55rem 0.875rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    background: var(--input-bg, #fff);
    color: var(--text-primary, #1e293b);
    font-size: 16px;
    transition: border-color 0.15s;
}

.blc-input:focus {
    outline: none;
    border-color: var(--blc-accent);
    box-shadow: 0 0 0 3px rgba(var(--blc-accent-rgb), 0.12);
}

/* ── Clipboard chip ──────────────────────────────────────────────────────── */
.blc-clipboard-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary, #475569);
    margin-bottom: 0.5rem;
    width: fit-content;
}

.blc-clipboard-chip button {
    background: var(--blc-accent);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 0.2rem 0.6rem;
    font-size: 0.8125rem;
    cursor: pointer;
}

/* ── History strip ───────────────────────────────────────────────────────── */
.blc-history-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
    overflow-x: auto;
}

.blc-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    border: 1px solid var(--border-color, #e2e8f0);
    background: var(--bg-secondary, #f8fafc);
    color: var(--text-secondary, #475569);
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s;
}

.blc-chip:hover {
    border-color: var(--blc-accent);
}

.blc-chip-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #fff;
    background: var(--blc-broken);
    flex-shrink: 0;
}

.blc-chip-badge--zero {
    background: var(--blc-ok);
}

/* ── Error ───────────────────────────────────────────────────────────────── */
.blc-error-msg {
    color: var(--blc-broken);
    font-size: 0.875rem;
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* ── Progress ────────────────────────────────────────────────────────────── */
.blc-progress {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.blc-progress-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary, #475569);
}

.blc-spin {
    animation: blc-spin 0.8s linear infinite;
    display: inline-block;
    color: var(--blc-accent);
}

@keyframes blc-spin {
    to {
        transform: rotate(360deg);
    }
}

.blc-progress-track {
    height: 6px;
    background: var(--border-color, #e2e8f0);
    border-radius: 999px;
    overflow: hidden;
}

.blc-progress-fill {
    height: 100%;
    background: var(--blc-accent);
    border-radius: 999px;
    transition: width 0.3s ease;
}

/* ── Summary strip ───────────────────────────────────────────────────────── */
.blc-summary-strip {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.blc-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 56px;
}

.blc-stat-num {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary, #1e293b);
}

.blc-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary, #64748b);
    margin-top: 0.2rem;
}

.blc-stat--ok .blc-stat-num {
    color: var(--blc-ok);
}

.blc-stat--redirect .blc-stat-num {
    color: var(--blc-redirect);
}

.blc-stat--broken .blc-stat-num {
    color: var(--blc-broken);
}

.blc-stat--timeout .blc-stat-num {
    color: var(--blc-timeout);
}

/* ── Status breakdown ────────────────────────────────────────────────────── */
.blc-breakdown {
    font-size: 0.8125rem;
    color: var(--text-secondary, #64748b);
    margin-bottom: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.blc-breakdown-code {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--border-color, #e2e8f0);
    background: var(--bg-secondary, #f8fafc);
    font-size: 0.8125rem;
}

/* ── Controls row ────────────────────────────────────────────────────────── */
.blc-controls-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.blc-filter-tabs {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.blc-tab {
    padding: 0.35rem 0.875rem;
    border-radius: 999px;
    border: 1px solid var(--border-color, #e2e8f0);
    background: transparent;
    color: var(--text-secondary, #475569);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.blc-tab:hover {
    background: rgba(var(--blc-accent-rgb), 0.08);
    border-color: var(--blc-accent);
    color: var(--blc-accent);
}

.blc-tab--active {
    background: var(--blc-accent);
    border-color: var(--blc-accent);
    color: #fff !important;
}

.blc-tab--active:hover {
    background: var(--blc-accent);
    border-color: var(--blc-accent);
    color: #fff !important;
}

.blc-tab--danger.blc-tab--active {
    background: var(--blc-broken);
    border-color: var(--blc-broken);
    color: #fff !important;
}

.blc-tab--danger:not(.blc-tab--active):hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: var(--blc-broken);
    color: var(--blc-broken);
}

.blc-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.blc-select {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    background: var(--input-bg, #fff);
    color: var(--text-secondary, #475569);
    font-size: 0.8125rem;
    cursor: pointer;
}

.blc-export-btn {
    font-size: 0.8125rem;
    padding: 0.35rem 0.875rem;
}

/* ── Table ───────────────────────────────────────────────────────────────── */
.blc-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    margin-bottom: 1rem;
}

.blc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    min-width: 640px;
}

.blc-th {
    padding: 0.625rem 0.75rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    background: var(--bg-secondary, #f8fafc);
    white-space: nowrap;
}

.blc-th--num {
    width: 36px;
    text-align: center;
}

.blc-sortable {
    cursor: pointer;
    user-select: none;
}

.blc-sortable:hover {
    color: var(--blc-accent);
}

.blc-sort-icon {
    font-size: 0.7rem;
    opacity: 0.5;
    vertical-align: middle;
}

.blc-th--sorted .blc-sort-icon {
    opacity: 1;
    color: var(--blc-accent);
}

.blc-tr {
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    transition: background 0.1s;
    animation: blc-row-in 0.2s ease forwards;
}

.blc-tr:last-child {
    border-bottom: none;
}

.blc-tr:hover {
    background: var(--bg-secondary, #f8fafc);
}

@keyframes blc-row-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blc-td {
    padding: 0.5rem 0.75rem;
    color: var(--text-primary, #1e293b);
    vertical-align: middle;
}

.blc-td--num {
    text-align: center;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.75rem;
}

/* URL cell */
.blc-url-cell {
    max-width: 260px;
}

.blc-url-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--blc-external);
    text-decoration: none;
}

.blc-url-text:hover {
    text-decoration: underline;
}

.blc-url-text--internal {
    color: var(--blc-internal);
}

/* Text/Alt cell */
.blc-text-cell {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary, #64748b);
    font-style: italic;
    font-size: 0.75rem;
}

/* Type badge */
.blc-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    white-space: nowrap;
}

.blc-type--a {
    background: #6366f1;
}

.blc-type--img {
    background: #22c55e;
}

.blc-type--js {
    background: #f59e0b;
}

.blc-type--css {
    background: #0ea5e9;
}

.blc-type--other {
    background: #94a3b8;
}

/* Scope badge */
.blc-scope-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
}

.blc-scope--int {
    background: rgba(99, 102, 241, 0.1);
    color: var(--blc-internal);
}

.blc-scope--ext {
    background: rgba(14, 165, 233, 0.1);
    color: var(--blc-external);
}

/* Status badge */
.blc-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.blc-status--ok {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
}

.blc-status--redirect {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
}

.blc-status--broken {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.blc-status--timeout {
    background: rgba(148, 163, 184, 0.15);
    color: #64748b;
}

.blc-status--pending {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
}

/* Response time */
.blc-time--fast {
    color: #16a34a;
}

.blc-time--medium {
    color: #b45309;
}

.blc-time--slow {
    color: #dc2626;
}

.blc-time--na {
    color: #94a3b8;
}

/* Redirect cell */
.blc-redirect-url {
    max-width: 200px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--blc-redirect);
    font-size: 0.75rem;
}

/* ── Skeleton row ────────────────────────────────────────────────────────── */
.blc-skeleton {
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--border-color, #e2e8f0) 25%, var(--bg-secondary, #f1f5f9) 50%, var(--border-color, #e2e8f0) 75%);
    background-size: 200% 100%;
    animation: blc-shimmer 1.2s ease infinite;
    display: inline-block;
}

@keyframes blc-shimmer {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

.blc-tr--pending .blc-td {
    opacity: 0.6;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.blc-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2.5rem 1rem;
    color: var(--text-secondary, #64748b);
    font-size: 0.9375rem;
}

.blc-empty i {
    font-size: 2.5rem;
    color: var(--blc-ok);
}

/* ── Share row ───────────────────────────────────────────────────────────── */
.blc-share-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.5rem;
}

.blc-share-btn {
    font-size: 0.8125rem;
    padding: 0.35rem 0.875rem;
}

.blc-share-toast {
    font-size: 0.8125rem;
    color: var(--blc-ok);
    font-weight: 500;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .blc-input-row {
        flex-direction: column;
    }

    .blc-input {
        width: 100%;
    }

    .blc-controls-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .blc-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
    }

    .blc-summary-strip {
        gap: 0.5rem;
    }

    .blc-stat-num {
        font-size: 1.25rem;
    }
}