/* ============================================================================
   BLOCKLIST MANAGEMENT STYLES (V6.1)
   Mirrors allowlist-ui.css patterns
   ============================================================================ */

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

.blocklist-toolbar .toolbar-left,
.blocklist-toolbar .toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.blocklist-toolbar .toolbar-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
}

/* Scope Tabs */
.blocklist-scope-tabs {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 3px;
}

.blocklist-scope-tab {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary, #adb5bd);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    white-space: nowrap;
}

.blocklist-scope-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary, #fff);
}

.blocklist-scope-tab.active {
    background: var(--accent-red, #e03131);
    color: #fff;
    font-weight: 600;
}

.blocklist-scope-tab .tab-icon {
    font-size: 14px;
}

/* Search */
.blocklist-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.blocklist-search-wrapper .search-icon {
    position: absolute;
    left: 10px;
    font-size: 14px;
    pointer-events: none;
}

.blocklist-search-wrapper input {
    padding-left: 32px;
    min-width: 200px;
}

/* Bulk Action Bar */
.blocklist-bulk-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    margin-bottom: 8px;
    border-left: 3px solid var(--accent-red, #e03131);
}

/* Table */
.blocklist-table-wrapper {
    overflow-x: auto;
}

.blocklist-table {
    width: 100%;
    border-collapse: collapse;
}

.blocklist-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary, #adb5bd);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

.blocklist-table th.sortable {
    cursor: pointer;
}

.blocklist-table th.sortable:hover {
    color: var(--text-primary, #fff);
}

.blocklist-table td {
    padding: 10px 12px;
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}

.blocklist-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.blocklist-table .col-check {
    width: 40px;
}

.blocklist-table .domain-cell {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.blocklist-table .col-actions {
    width: 80px;
    text-align: center;
}

.blocklist-table .empty-row td {
    text-align: center;
    padding: 40px 0;
    color: var(--text-secondary, #adb5bd);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-category {
    background: rgba(108, 99, 255, 0.15);
    color: #6c63ff;
    border: 1px solid rgba(108, 99, 255, 0.3);
}

.badge-manual {
    background: rgba(134, 142, 150, 0.12);
    color: #adb5bd;
    border: 1px dashed rgba(134, 142, 150, 0.4);
    font-style: italic;
}

.badge-unapplied {
    background: rgba(255, 193, 7, 0.15);
    color: #fcc419;
    border: 1px dashed rgba(255, 193, 7, 0.4);
    font-style: italic;
}

.unapplied-row td {
    opacity: 0.75;
}

.unapplied-row:hover td {
    opacity: 1;
}

/* Status filter toggle */
.bl-status-toggle {
    display: flex;
    gap: 2px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    padding: 2px;
}

.bl-status-btn {
    padding: 5px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary, #adb5bd);
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    white-space: nowrap;
}

.bl-status-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary, #fff);
}

.bl-status-btn.active {
    background: var(--accent-red, #e03131);
    color: #fff;
    font-weight: 600;
}

.text-muted {
    color: var(--text-secondary, #868e96);
    font-size: 12px;
}

/* Pagination */
.blocklist-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.page-info {
    display: flex;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary, #adb5bd);
}

.page-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-controls select {
    width: auto;
    min-width: 60px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal, 1000);
}

.modal-overlay.hidden {
    display: none;
}

.bl-modal-box {
    width: 95%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary, #adb5bd);
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 600;
}

.form-group small {
    font-weight: normal;
    color: var(--text-secondary, #adb5bd);
}

.form-row {
    display: flex;
    gap: 12px;
}

/* Button sizes */
.btn-xs {
    padding: 2px 8px;
    font-size: 11px;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-danger {
    background: var(--accent-red, #e03131);
    color: #fff;
    border: 1px solid var(--accent-red, #e03131);
}

.btn-danger:hover {
    background: #c92a2a;
}

/* Apply Configurator Modal */
.apply-cfg-categories {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    margin-bottom: 4px;
}

.apply-cfg-cat-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.apply-cfg-cat-row:last-child {
    border-bottom: none;
}

.apply-cfg-cat-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
}

.apply-cfg-cat-count {
    font-size: 12px;
    min-width: 70px;
}

/* Category Toggle Panel */
.bl-cat-toggle-panel {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 8px;
}

.bl-cat-toggle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.bl-cat-toggle-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bl-cat-toggle-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 13px;
}

.bl-cat-toggle-row.disabled {
    opacity: 0.5;
}

.bl-cat-toggle-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(134, 142, 150, 0.4);
    border-radius: 20px;
    transition: 0.2s;
}

.toggle-slider:before {
    content: "";
    position: absolute;
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent-red, #e03131);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(16px);
}
