/* ============================================
   Link deletion — group page select column, bulk bar, confirm modal
   (pairs with js/dashboard/link-deletion.js)
   ============================================ */

/* Select column */
.links-table .th-select,
.links-table .td-select {
    width: 40px;
    padding-right: 0;
    text-align: center;
    cursor: default;
}

.links-table .ld-check,
.links-table #links-select-all {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--neon-cyan);
    cursor: pointer;
    vertical-align: middle;
}

.links-table .ld-check:focus-visible,
.links-table #links-select-all:focus-visible {
    outline: 2px solid var(--neon-cyan);
    outline-offset: 2px;
}

.links-table tr:has(.ld-check:checked) td {
    background: rgba(0, 245, 212, 0.05);
}

/* Bulk action bar */
.ld-bar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--sev-crit-bg);
    border: 1px solid var(--sev-crit-border);
    clip-path: var(--clip-button);
}

.ld-bar[hidden] {
    display: none;
}

.ld-bar-count {
    margin-right: auto;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.ld-bar-count strong {
    color: var(--text-primary);
}

/* Confirm modal */
.ld-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.ld-overlay[hidden] {
    display: none;
}

.ld-modal {
    width: 100%;
    max-width: 440px;
    padding: var(--space-6);
    background: var(--bg-dark);
    border: 1px solid var(--sev-crit-border);
    clip-path: var(--clip-card);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.ld-modal-title {
    margin: 0 0 var(--space-3);
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.ld-modal-text {
    margin: 0;
    font-size: var(--text-sm);
    line-height: 1.6;
    color: var(--text-secondary);
}

.ld-modal-error {
    margin: var(--space-3) 0 0;
    font-size: var(--text-sm);
    color: var(--neon-magenta);
}

.ld-modal-error[hidden] {
    display: none;
}

.ld-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    margin-top: var(--space-6);
}

@media (max-width: 768px) {
    .ld-bar,
    .ld-modal {
        clip-path: none;
        border-radius: 6px;
    }

    /* The links table is wider than a phone, so the page scrolls sideways
       and an in-flow bar would push its Delete button off-screen. Pin the
       bar to the bottom of the viewport instead. link-deletion.js moves the
       bar into <body> at this width: .card's clip-path would otherwise clip
       the fixed bar whenever the table is scrolled out of view. */
    .ld-bar {
        position: fixed;
        left: var(--space-4);
        right: var(--space-4);
        bottom: var(--space-4);
        z-index: 900;
        flex-wrap: wrap;
        margin: 0;
        background: linear-gradient(var(--sev-crit-bg), var(--sev-crit-bg)), var(--bg-dark);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    }

    body.ld-bar-open #links-table-container {
        padding-bottom: 88px;
    }

    .ld-modal-actions {
        flex-direction: column-reverse;
    }

    .ld-modal-actions .btn {
        width: 100%;
    }
}
