/* ─────────────────────────────────────────────────────────────────
   GN Spam User Cleaner — Admin Stylesheet
───────────────────────────────────────────────────────────────── */

.gn-spam-wrap {
    max-width: 1100px;
}

/* ── Page Header ──────────────────────────────────────────────── */
.gn-page-header h1 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 600;
    color: #1d2327;
}

.gn-page-header h1 .dashicons {
    font-size: 26px;
    width: 26px;
    height: 26px;
    color: #2271b1;
    margin-top: -2px;
}

/* ── Cards ────────────────────────────────────────────────────── */
.gn-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    margin-top: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

.gn-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #f0f0f1;
}

.gn-card-head h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gn-card-body {
    padding: 20px;
}

.gn-card-foot {
    padding: 14px 20px;
    border-top: 1px solid #f0f0f1;
    background: #f6f7f7;
    border-radius: 0 0 4px 4px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.gn-card-foot .button .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-top: -2px;
    margin-right: 2px;
}

/* ── Tab Navigation ──────────────────────────────────────────── */
.gn-tab-nav {
    display: flex;
    align-items: flex-end;
    border-bottom: 1px solid #c3c4c7;
    background: #f0f0f1; /* matches WP admin page background */
    padding: 0 12px;
    gap: 4px;
}

.gn-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #50575e;
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-bottom: none;
    border-radius: 3px 3px 0 0;
    cursor: pointer;
    transition: color .12s, background .12s;
    white-space: nowrap;
    position: relative;
    bottom: -1px;  /* sits on top of the border-bottom */
}

.gn-tab-btn .dashicons {
    font-size: 15px;
    width: 15px;
    height: 15px;
    opacity: .65;
}

.gn-tab-btn:hover {
    color: #1d2327;
    background: #eee;
}

.gn-tab-btn.active {
    color: #1d2327;
    background: #fff;
    border-color: #c3c4c7;
    border-bottom-color: #fff; /* hides the card border behind active tab */
    z-index: 1;
}

.gn-tab-btn.active .dashicons {
    opacity: 1;
}

/* Small badge inside the tab button (e.g. "Active") */
.gn-tab-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 2px 7px;
    border-radius: 10px;
    line-height: 1.6;
}

.gn-tab-badge-active {
    background: #edfaef;
    color: #00a32a;
}

/* ── Settings Layout ──────────────────────────────────────────── */
.gn-settings-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.gn-field-label {
    font-weight: 600;
    font-size: 13px;
    color: #1d2327;
    margin: 0 0 10px;
}

.gn-role-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px 16px;
}

.gn-role-grid label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: #1d2327;
    cursor: pointer;
}

.gn-role-locked {
    color: #8c8f94 !important;
    cursor: default !important;
}

.gn-role-locked .dashicons {
    font-size: 13px;
    width: 13px;
    height: 13px;
}

.gn-option-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
}

.gn-badge-score {
    display: inline-block;
    background: #f0b849;
    color: #1d2327;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    line-height: 1.7;
}

.gn-threshold-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

.gn-threshold-row input[type="range"] {
    flex: 1;
    cursor: pointer;
    accent-color: #2271b1;
}

.gn-threshold-row input[type="number"] {
    width: 58px;
    text-align: center;
}

/* ── Stats Row ────────────────────────────────────────────────── */
.gn-stats-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.gn-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    padding: 14px 18px;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    gap: 4px;
}

.gn-stat-highlight {
    background: #f0f6fc;
    border-color: #2271b1;
}

.gn-stat-highlight .gn-stat-num {
    color: #2271b1;
}

.gn-stat-num {
    font-size: 28px;
    font-weight: 700;
    color: #1d2327;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.gn-stat-lbl {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #8c8f94;
    white-space: nowrap;
}

.gn-stat-divider {
    font-size: 28px;
    color: #dcdcde;
    font-weight: 300;
    align-self: center;
}

.gn-stat-spacer {
    flex: 1;
}

/* ── Progress ─────────────────────────────────────────────────── */
.gn-progress-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gn-progress-track {
    flex: 1;
    height: 14px;
    background: #f0f0f1;
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid #dcdcde;
}

.gn-progress-fill {
    height: 100%;
    background: #2271b1;
    border-radius: 7px;
    transition: width .35s ease;
}

.gn-progress-fill-danger {
    background: #d63638;
}

.gn-progress-pct {
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    min-width: 38px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.gn-progress-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #d63638;
    margin: 0 0 8px;
}

/* ── Excluded Emails Section ──────────────────────────────────── */
.gn-excluded-section {
    padding: 20px;
    border-top: 1px solid #f0f0f1;
    margin-top: 4px;
}

.gn-excluded-header {
    margin-bottom: 10px;
}

.gn-excluded-header .gn-field-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.gn-excluded-count {
    font-size: 11px;
    font-weight: 600;
    background: #e6f0fa;
    color: #2271b1;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: .2px;
}

.gn-excluded-textarea {
    font-family: monospace;
    font-size: 12px;
    line-height: 1.6;
    resize: vertical;
    min-height: 90px;
    border-color: #c3c4c7;
}

.gn-excluded-textarea:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.gn-excluded-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.gn-excluded-actions .button .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-top: -2px;
    margin-right: 3px;
}

.gn-save-status {
    font-size: 13px;
    display: none;
}

.gn-save-ok    { color: #00a32a; }
.gn-save-error { color: #d63638; }

/* ── Status Badge ─────────────────────────────────────────────── */
.gn-status-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    padding: 3px 10px;
    border-radius: 12px;
}

.gn-status-idle     { background: #f0f0f1; color: #8c8f94; }
.gn-status-running  { background: #e6f0fa; color: #2271b1; }
.gn-status-done     { background: #edfaef; color: #00a32a; }
.gn-status-deleting { background: #fef3cd; color: #9a6700; }
.gn-status-error    { background: #fef0f0; color: #d63638; }

/* ── Filter Bar ───────────────────────────────────────────────── */
.gn-filter-bar {
    padding: 14px 20px;
    background: #f6f7f7;
    border-bottom: 1px solid #dcdcde;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gn-filter-row {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    flex-wrap: wrap;
}

.gn-domain-filter-wrap {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.gn-filter-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #8c8f94;
}

.gn-domain-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gn-domain-select {
    min-width: 220px;
    max-width: 320px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    background: #fff;
    font-size: 13px;
    color: #1d2327;
    cursor: pointer;
}

.gn-domain-select:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

/* ── Only / Except toggle ─────────────────────────────────────── */
.gn-domain-mode {
    display: flex;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    overflow: hidden;
    transition: opacity .15s;
}

.gn-domain-mode.gn-mode-disabled {
    opacity: .4;
    pointer-events: none;
}

.gn-mode-btn {
    padding: 0 12px;
    height: 32px;
    font-size: 12px;
    font-weight: 600;
    background: #fff;
    border: none;
    border-right: 1px solid #c3c4c7;
    color: #50575e;
    cursor: pointer;
    transition: background .12s, color .12s;
    line-height: 32px;
}

.gn-mode-btn:last-child {
    border-right: none;
}

.gn-mode-btn:hover {
    background: #f0f0f1;
}

.gn-mode-btn.active {
    background: #2271b1;
    color: #fff;
}

/* "Except" active state uses a distinct red so it's clearly different */
.gn-mode-btn[data-mode="exclude"].active {
    background: #d63638;
    color: #fff;
}

/* .gn-filter-mode removed — replaced by .gn-filter-logic-row toggle */

/* ── Filter Logic Row ────────────────────────────────────────── */
.gn-filter-logic-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 2px;
}

.gn-toggle-desc {
    font-size: 12px;
    color: #50575e;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.gn-toggle-desc strong {
    color: #1d2327;
}

.gn-toggle-hint {
    color: #8c8f94;
}

/* ── Toggle Switch (pure CSS, cross-browser) ─────────────────── */
.gn-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
    cursor: pointer;
}

.gn-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.gn-toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #c3c4c7;
    border-radius: 22px;
    transition: background .2s;
}

/* The moving circle */
.gn-toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.gn-toggle input:checked + .gn-toggle-slider {
    background: #2271b1;
}

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

/* Focus ring for accessibility */
.gn-toggle input:focus-visible + .gn-toggle-slider {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* ── Reason Chips ─────────────────────────────────────────────── */
.gn-reason-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.gn-reason-chips label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 14px;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
    transition: border-color .12s, background .12s;
    color: #50575e;
}

.gn-reason-chips label:hover {
    border-color: #2271b1;
    background: #f0f6fc;
}

.gn-reason-chips label:has(input:checked) {
    border-color: #2271b1;
    background: #e6f0fa;
    color: #1d2327;
    font-weight: 600;
}

/* ── Bulk Actions Bar ─────────────────────────────────────────── */
.gn-bulk-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-bottom: 1px solid #f0f0f1;
    background: #fff;
    flex-wrap: wrap;
}

.gn-check-all-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.gn-bulk-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── Danger Button ────────────────────────────────────────────── */
.gn-button-danger.button {
    background: #d63638;
    border-color: #b32d2e;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.gn-button-danger.button:hover,
.gn-button-danger.button:focus {
    background: #b32d2e;
    border-color: #8a2020;
    color: #fff;
}

.gn-button-danger .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    margin-top: 1px;
}

/* WP 7.0's [class*=branch-7].wp-core-ui .button .dashicons rule forces
   color: var(--wp-admin-theme-color) with higher specificity than a
   two-class selector — the ID selector beats it regardless of how many
   classes core stacks on that rule. Same fix applies to #gn-scan below,
   whose button-primary background is also the theme color, so the
   forced icon color nearly disappeared into it. */
#gn-delete .dashicons {
    color: #fff;
}

#gn-scan .dashicons {
    color: #fff;
}

/* ── Results Table ────────────────────────────────────────────── */
#gn-results-table {
    margin: 0;
    border: none;
}

#gn-results-table th.check-column,
#gn-results-table td.check-column {
    padding-left: 16px;
    width: 40px;
}

.gn-col-score {
    width: 80px;
    text-align: center !important;
}

.gn-sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.gn-sortable:hover {
    background: #f0f6fc;
}

.gn-sort-arrows {
    opacity: .45;
    font-size: 12px;
    margin-left: 3px;
}

/* ── GN - User Spam Shield Card ──────────────────────────────────────────── */
.gn-ms-card .gn-card-head .dashicons {
    color: #2271b1;
    font-size: 18px;
    width: 18px;
    height: 18px;
    margin-right: 2px;
}

/* Active / Inactive badge next to card title */
.gn-ms-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 3px 10px;
    border-radius: 12px;
}

.gn-ms-badge-active   { background: #edfaef; color: #00a32a; }
.gn-ms-badge-inactive { background: #f0f0f1; color: #8c8f94; }

/* ── Active state body ────────────────────────────────────────── */
.gn-ms-active-body {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    flex-wrap: wrap;
}

.gn-ms-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.gn-ms-detail-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #1d2327;
}

.gn-ms-detail-row .dashicons {
    color: #8c8f94;
    font-size: 16px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.gn-ms-icon-ok { color: #00a32a !important; }

.gn-ms-deactivate-btn {
    color: #d63638 !important;
    border-color: #d63638 !important;
    margin-top: 4px;
}

.gn-ms-deactivate-btn:hover {
    background: #d63638 !important;
    color: #fff !important;
}

/* ── Inactive state body ──────────────────────────────────────── */
.gn-ms-inactive-body {
    padding: 20px;
}

.gn-ms-split {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
    align-items: start;
}

@media (max-width: 800px) {
    .gn-ms-split { grid-template-columns: 1fr; }
}

.gn-ms-tagline {
    font-size: 13px;
    color: #1d2327;
    margin: 0 0 12px;
    font-weight: 600;
}

.gn-ms-feature-list {
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.gn-ms-feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: 13px;
    color: #1d2327;
}

.gn-ms-feature-list .dashicons {
    color: #00a32a;
    font-size: 16px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.gn-ms-pricing {
    font-size: 14px;
    color: #1d2327;
    margin: 0 0 16px;
}

.gn-ms-buy-btn {
    font-size: 13px !important;
}

/* Activate column */
.gn-ms-activate-col {
    padding: 20px;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
}

.gn-ms-key-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 6px;
}

.gn-ms-key-row input {
    flex: 1;
    font-family: monospace;
    letter-spacing: .05em;
}

.gn-ms-status-msg {
    font-size: 13px;
    margin-top: 8px;
}

.gn-ms-msg-ok    { color: #00a32a; }
.gn-ms-msg-error { color: #d63638; }

/* ── GN - User Spam Shield upsell chip (shown in filter bar when not licensed) ── */
.gn-ms-upsell-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    background: #f0f6fc;
    border: 1px dashed #2271b1;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
    color: #2271b1;
    text-decoration: none;
    cursor: pointer;
    transition: background .12s, border-color .12s;
}

.gn-ms-upsell-chip:hover {
    background: #e6f0fa;
    color: #135e96;
    text-decoration: none;
}

.gn-ms-upsell-chip .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* ── Email Status Badges ──────────────────────────────────────── */
.gn-col-status {
    width: 90px;
    text-align: center !important;
    white-space: nowrap;
}

.gn-email-status {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.gn-email-status-invalid {
    background: #fef0f0;
    color: #d63638;
}

.gn-email-status-risky {
    background: #fef3cd;
    color: #9a6700;
}

/* ── Status Filter Chips ──────────────────────────────────────── */
.gn-status-chips {
    border-top: 1px solid #e8e8e8;
    padding-top: 10px;
    margin-top: 2px;
}

.gn-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 14px;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
    transition: border-color .12s, background .12s;
    color: #50575e;
    font-weight: 600;
}

.gn-status-chip:hover {
    border-color: #2271b1;
    background: #f0f6fc;
}

.gn-status-chip:has(input:checked) {
    color: #1d2327;
}

.gn-status-chip-invalid:has(input:checked) {
    border-color: #d63638;
    background: #fef0f0;
    color: #d63638;
}

.gn-status-chip-risky:has(input:checked) {
    border-color: #9a6700;
    background: #fef3cd;
    color: #9a6700;
}

.gn-chip-count {
    font-weight: 400;
    opacity: .75;
    font-size: 11px;
}

/* ── Score Badges ─────────────────────────────────────────────── */
.gn-score {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    min-width: 28px;
    text-align: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-variant-numeric: tabular-nums;
}

.gn-score-low    { background: #edfaef; color: #00a32a; }
.gn-score-medium { background: #fef9e8; color: #9a6700; }
.gn-score-high   { background: #fef3e0; color: #c07b0a; }
.gn-score-danger { background: #fef0f0; color: #d63638; }

/* ── Reason Tags ──────────────────────────────────────────────── */
.gn-reason-tag {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #f0f0f1;
    color: #50575e;
    margin: 2px 3px 2px 0;
    white-space: nowrap;
}

/* ── Empty / Result Count ─────────────────────────────────────── */
.gn-empty-state {
    text-align: center;
    padding: 24px !important;
    color: #8c8f94;
    font-style: italic;
}

.gn-result-count {
    font-size: 12px;
    font-weight: 400;
    color: #8c8f94;
    margin-left: 8px;
}

/* ── Pagination ───────────────────────────────────────────────── */
.gn-pagination {
    padding: 10px 16px;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
    border-top: 1px solid #f0f0f1;
    min-height: 22px;
}

.gn-page-btn {
    min-width: 32px;
    height: 30px;
    padding: 0 8px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    color: #2271b1;
    line-height: 28px;
    transition: background .1s, border-color .1s;
}

.gn-page-btn:hover {
    background: #f0f6fc;
    border-color: #2271b1;
}

.gn-page-btn.active {
    background: #2271b1;
    border-color: #135e96;
    color: #fff;
    font-weight: 700;
    cursor: default;
}
