/**
 * Cleanup Removed Plugins Admin Styles
 * Module-specific styles only - uses existing sb-module-* classes from switchboard-admin.css
 */

/* Page Layout */
.switchboard-cleanup-removed-plugins {
    max-width: 1200px;
}

/* Info Boxes Row */
.crp-info-row {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

/* Info Box - uses existing alert pattern */
.crp-info-box {
    flex: 1;
    display: flex;
    gap: 16px;
    padding: 16px 20px;
    background: var(--primary-50);
    border: 1px solid var(--primary-200);
    border-left: 4px solid var(--primary-500);
    border-radius: 8px;
    margin-bottom: 0;
}

.crp-info-icon {
    flex-shrink: 0;
    color: var(--primary-500);
}

.crp-info-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.crp-info-content strong {
    display: block;
    font-size: 14px;
    color: var(--primary-900);
    margin-bottom: 4px;
}

.crp-info-content p {
    margin: 0;
    font-size: 13px;
    color: var(--primary-700);
    line-height: 1.5;
}

/* Warning variant for info box */
.crp-info-box--warning {
    background: #fef3c7;
    border-color: #fde047;
    border-left-color: #f59e0b;
}

.crp-info-box--warning .crp-info-icon {
    color: #b45309;
}

.crp-info-box--warning .crp-info-content strong {
    color: #92400e;
}

.crp-info-box--warning .crp-info-content p {
    color: #a16207;
}

/* Tabs - following dbcleaner pattern */
.crp-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
}

.crp-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s ease;
}

.crp-tab:hover {
    background: white;
    color: var(--primary-600);
}

.crp-tab.active {
    background: white;
    color: var(--primary-600);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.crp-tab .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.crp-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--gray-200);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-600);
}

.crp-tab.active .crp-tab-count {
    background: var(--primary-100);
    color: var(--primary-700);
}

/* Tab Content */
.crp-tab-content {
    display: none;
}

.crp-tab-content.active {
    display: block;
}

/* Filters */
.crp-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    flex-shrink: 0;
}

.crp-source-filter {
    height: 36px;
    padding: 0 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: #334155;
    cursor: pointer;
    min-width: 160px;
}

.crp-source-filter:focus {
    border-color: var(--primary-500);
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--primary-500-rgb), 0.1);
}

.crp-filters input[type="text"] {
    width: 200px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
}

.crp-filters input[type="text"]:focus {
    border-color: var(--primary-500);
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--primary-500-rgb), 0.1);
}

/* Bulk Actions */
.crp-bulk-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.crp-select-all {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-700);
}

.crp-select-all input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-500);
}

.crp-bulk-actions .button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.crp-bulk-actions .button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
}

/* Empty State */
.empty-cell {
    padding: 60px 20px !important;
    text-align: center;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--gray-400);
}

.empty-state .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
}

/* Loading State */
.loading-cell {
    text-align: center;
    padding: 40px !important;
    color: var(--gray-500);
}

.loading-cell .spinner {
    float: none;
    margin-right: 8px;
}

/* Table Rows */
.sb-module-table tbody tr.crp-item {
    transition: background 0.2s ease;
}

.sb-module-table tbody tr.crp-item:hover {
    background: var(--gray-50);
}

.sb-module-table .check-column {
    width: 40px;
    text-align: center;
}

.sb-module-table .check-column input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-500);
}

/* Source Badge */
.source-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--gray-100);
    border-radius: 4px;
    font-size: 12px;
    color: var(--gray-700);
}

.source-badge.known {
    background: var(--primary-50);
    color: var(--primary-700);
}

.source-badge.unknown {
    background: #fef3c7;
    color: #b45309;
}

/* Risk Badges */
.risk-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.risk-badge.low {
    background: #dcfce7;
    color: #166534;
}

.risk-badge.medium {
    background: #fef3c7;
    color: #b45309;
}

.risk-badge.high {
    background: #fee2e2;
    color: #dc2626;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.status-badge.has-callback {
    background: #fef3c7;
    color: #b45309;
}

.status-badge.no-callback {
    background: #fee2e2;
    color: #dc2626;
}

/* Autoload Badge */
.autoload-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.autoload-badge.yes {
    background: #dcfce7;
    color: #166534;
}

.autoload-badge.no {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* Action Buttons */
.crp-actions {
    display: flex;
    gap: 6px;
}

.crp-action-btn-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.15s ease;
}

.crp-action-btn-small:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--gray-700);
}

.crp-action-btn-small.delete:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

.crp-action-btn-small.preview:hover {
    background: var(--primary-50);
    border-color: var(--primary-200);
    color: var(--primary-600);
}

.crp-action-btn-small.ignore:hover {
    background: #fef3c7;
    border-color: #fde047;
    color: #b45309;
}

.crp-action-btn-small .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Modal - uses sb-module-modal patterns */
.crp-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crp-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.crp-modal-content {
    position: relative;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.crp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
}

.crp-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

.crp-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 24px;
    color: var(--gray-400);
    cursor: pointer;
    transition: all 0.15s ease;
}

.crp-modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.crp-modal-body {
    padding: 20px;
    overflow-y: auto;
}

.crp-preview-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.crp-preview-info code {
    padding: 4px 8px;
    background: var(--gray-100);
    border-radius: 4px;
    font-size: 13px;
}

.crp-preview-value {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
}

.crp-preview-value pre {
    margin: 0;
    padding: 16px;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
}

/* Toast - following dbcleaner pattern */
.crp-toast {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 100000;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.crp-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.crp-toast .toast-icon {
    font-size: 18px;
    font-weight: 600;
}

.crp-toast .toast-message {
    font-size: 14px;
    color: var(--gray-800);
}

.crp-toast.success {
    border-left: 4px solid #22c55e;
}

.crp-toast.success .toast-icon {
    color: #22c55e;
}

.crp-toast.success .toast-icon::before {
    content: "\2713";
}

.crp-toast.error {
    border-left: 4px solid #dc2626;
}

.crp-toast.error .toast-icon {
    color: #dc2626;
}

.crp-toast.error .toast-icon::before {
    content: "\2717";
}

.crp-toast.warning {
    border-left: 4px solid #f59e0b;
}

.crp-toast.warning .toast-icon {
    color: #f59e0b;
}

.crp-toast.warning .toast-icon::before {
    content: "\26A0";
}

.crp-toast.info {
    border-left: 4px solid var(--primary-500);
}

.crp-toast.info .toast-icon {
    color: var(--primary-500);
}

.crp-toast.info .toast-icon::before {
    content: "\2139";
}

/* Confirmation Modal */
.crp-confirm-modal-content {
    max-width: 420px;
    text-align: center;
}

.crp-confirm-icon {
    margin-bottom: 16px;
}

.crp-confirm-icon .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #dc2626;
}

.crp-confirm-text {
    font-size: 15px;
    color: var(--gray-700);
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.crp-confirm-warning {
    font-size: 13px;
    color: var(--gray-500);
    margin: 0;
}

.crp-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
    border-radius: 0 0 12px 12px;
}

.crp-confirm-cancel {
    padding: 8px 20px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    height: auto !important;
}

/* Danger button - for destructive actions */
.button-danger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px !important;
    background: #dc2626 !important;
    border-color: #dc2626 !important;
    color: white !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    height: auto !important;
    box-shadow: 0 1px 2px rgba(220, 38, 38, 0.15) !important;
}

.button-danger:hover {
    background: #b91c1c !important;
    border-color: #b91c1c !important;
}

.button-danger:focus {
    box-shadow: 0 0 0 2px #fecaca !important;
}

.button-danger .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Bulk delete button - subtle outline danger style */
.crp-bulk-actions .button-primary {
    background: transparent !important;
    border: 1px solid #fca5a5 !important;
    color: #dc2626 !important;
}

.crp-bulk-actions .button-primary:hover {
    background: #fef2f2 !important;
    border-color: #f87171 !important;
    color: #b91c1c !important;
}

.crp-bulk-actions .button-primary:focus {
    background: #fef2f2 !important;
    border-color: #f87171 !important;
    color: #b91c1c !important;
    box-shadow: 0 0 0 1px #fecaca !important;
}

.crp-bulk-actions .button-primary .dashicons {
    color: #dc2626 !important;
}

.crp-bulk-actions .button-primary:hover .dashicons {
    color: #b91c1c !important;
}

/* Link dropdown styling */
.crp-link-dropdown {
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}

.crp-link-select {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--gray-300);
    background: white;
    color: var(--gray-600);
    cursor: pointer;
    max-width: 140px;
}

.crp-link-select:hover {
    border-color: var(--primary-400);
}

.crp-link-select:focus {
    border-color: var(--primary-500);
    outline: none;
    box-shadow: 0 0 0 2px rgba(var(--primary-500-rgb), 0.1);
}

.crp-link-select:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* Stat sub text */
.sb-module-stat-sub {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
}

/* Scan Button States */
.crp-action-btn.scanning .dashicons,
.dashicons.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Deleting/Ignoring State */
tr.crp-item.deleting,
tr.crp-item.ignoring {
    opacity: 0.5;
    pointer-events: none;
}

/* Ignored Items Indicator */
.crp-ignored-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 12px;
}

.crp-ignored-indicator .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Ignored items modal list */
.crp-ignored-list {
    max-height: 400px;
    overflow-y: auto;
}

.crp-ignored-list h4 {
    margin: 0 0 8px 0;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
    border-bottom: 1px solid var(--gray-200);
}

.crp-ignored-list h4:not(:first-child) {
    margin-top: 20px;
}

.crp-ignored-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.crp-ignored-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
}

.crp-ignored-list li:last-child {
    border-bottom: none;
}

.crp-ignored-list code {
    flex: 1;
    padding: 4px 8px;
    background: var(--gray-100);
    border-radius: 4px;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
}

.crp-unignore-btn {
    color: var(--primary-600) !important;
    font-size: 12px;
    cursor: pointer;
}

.crp-unignore-btn:hover {
    color: var(--primary-800) !important;
    text-decoration: underline;
}

/* Truncation Warning */
.crp-truncation-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 14px;
    background: #fef3c7;
    border-radius: 6px;
    font-size: 13px;
    color: #92400e;
}

.crp-truncation-warning .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #f59e0b;
}

/* Sortable Column Headers */
.sb-module-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.sb-module-table th.sortable:hover {
    background: var(--gray-100);
}

.sb-module-table th.sortable::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 6px;
    vertical-align: middle;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 4px solid var(--gray-400);
    opacity: 0.4;
}

.sb-module-table th.sortable.asc::after {
    border-bottom: 4px solid var(--gray-700);
    opacity: 1;
}

.sb-module-table th.sortable.desc::after {
    border-top: 4px solid var(--gray-700);
    border-bottom: none;
    opacity: 1;
}

/* Risk badge cursor for tooltip */
.risk-badge[title],
.status-badge[title] {
    cursor: help;
}

/* Responsive */
@media (max-width: 1024px) {
    .crp-tabs {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .switchboard-cleanup-removed-plugins .sb-module-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .crp-info-row {
        flex-direction: column;
    }

    .crp-info-box {
        flex-direction: column;
        gap: 12px;
    }

    .crp-bulk-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}
