/**
 * DK Spam Shield - Stylesheet
 * Minimal, lightweight CSS for frontend honeypot concealment, math challenge widgets, and admin dashboard.
 *
 * @package DK_Spam_Shield
 */

/* ==========================================================================
   1. FRONTEND HONEYPOT & SECURITY WIDGETS
   ========================================================================== */

/* Conceal Honeypot securely from humans and accessibility tree without triggering aggressive adblockers */
.dkss-hp-wrap {
    opacity: 0 !important;
    position: absolute !important;
    top: 0 !important;
    left: -9999px !important;
    height: 0 !important;
    width: 0 !important;
    z-index: -1 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

.dkss-shield-wrapper {
    margin: 14px 0;
    clear: both;
}

/* Custom Math Challenge Container */
.dkss-math-challenge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    color: #1e293b;
    font-size: 14px;
    max-width: 100%;
}

.dkss-math-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dkss-math-icon {
    color: #0284c7;
    flex-shrink: 0;
}

.dkss-math-label {
    font-weight: 500;
    color: #475569;
}

.dkss-math-expr {
    display: inline-block;
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace, monospace;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.dkss-math-refresh {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s ease, transform 0.3s ease;
}

.dkss-math-refresh:hover {
    color: #0284c7;
    transform: rotate(45deg);
}

.dkss-math-refresh.dkss-spinning {
    animation: dkss-spin 0.6s linear infinite;
}

@keyframes dkss-spin {
    100% {
        transform: rotate(360deg);
    }
}

.dkss-math-input {
    width: 70px !important;
    padding: 4px 8px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    text-align: center !important;
    background: #ffffff !important;
    color: #0f172a !important;
    margin: 0 !important;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dkss-math-input:focus {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2) !important;
}

.dkss-turnstile-container {
    margin: 8px 0;
}

/* ==========================================================================
   2. ADMIN DASHBOARD STYLING
   ========================================================================== */

.dkss-admin-wrap {
    max-width: 1100px;
    margin-top: 20px;
}

.dkss-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    padding: 24px 28px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.dkss-admin-header h1 {
    color: #ffffff !important;
    font-size: 26px;
    font-weight: 700;
    margin: 4px 0 6px 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dkss-brand-badge {
    display: inline-block;
    background: rgba(2, 132, 199, 0.25);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dkss-version-tag {
    font-size: 13px;
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 400;
}

.dkss-subtitle {
    color: #94a3b8;
    margin: 0;
    font-size: 14px;
}

.dkss-quick-stats-badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 12px 20px;
    border-radius: 10px;
    text-align: center;
    min-width: 140px;
}

.dkss-badge-num {
    font-size: 28px;
    font-weight: 800;
    color: #38bdf8;
    line-height: 1.1;
}

.dkss-badge-lbl {
    font-size: 11px;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Tabs */
.dkss-tabs-nav {
    margin-bottom: 20px !important;
    border-bottom: 1px solid #cbd5e1 !important;
}

.dkss-tabs-nav .nav-tab {
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.dkss-tab-pane {
    display: none;
}

.dkss-tab-pane.active {
    display: block;
    animation: dkss-tab-fade 0.2s ease-in-out;
}

@keyframes dkss-tab-fade {
    from {
        opacity: 0;
        transform: translateY(3px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dkss-form-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 24px 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dkss-section-header {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 14px;
    margin-bottom: 20px;
}

.dkss-section-header h2 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.dkss-section-header p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}

.dkss-table th {
    width: 260px;
    font-weight: 600;
    color: #1e293b;
    padding: 16px 12px 16px 0;
}

.dkss-table td {
    padding: 16px 0;
}

/* Custom Switch */
.dkss-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

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

.dkss-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 34px;
}

.dkss-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.dkss-switch input:checked + .dkss-slider {
    background-color: #0284c7;
}

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

.dkss-radio-label {
    display: block;
    margin-bottom: 12px;
    font-size: 14px;
}

.dkss-desc-inline {
    display: block;
    margin-left: 24px;
    color: #64748b;
    font-size: 12px;
    margin-top: 2px;
}

.dkss-checkbox-row {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Integrations Grid */
.dkss-integrations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.dkss-integration-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 18px 20px;
}

.dkss-integration-card h3 {
    margin: 0 0 12px 0;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
}

.dkss-integration-card label {
    display: block;
    margin-bottom: 10px;
    font-size: 13px;
    color: #334155;
    font-weight: 500;
}

/* Analytics Cards Grid */
.dkss-stats-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.dkss-stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dkss-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.dkss-card-total {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #86efac;
}

.dkss-card-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.dkss-card-value {
    font-size: 32px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
    margin-bottom: 6px;
}

.dkss-card-title {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dkss-last-blocked {
    margin-top: 15px;
    color: #64748b;
    font-size: 13px;
    background: #f8fafc;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.dkss-reset-form {
    margin-top: 20px;
}

/* IP Management & Activity Tables */
.dkss-tab-count {
    background: #ef4444;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

.dkss-ip-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.dkss-box-head {
    background: #f8fafc;
    padding: 12px 18px;
    border-bottom: 1px solid #e2e8f0;
}

.dkss-box-head h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dkss-manage-table {
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.dkss-manage-table th {
    background: #f1f5f9 !important;
    font-weight: 600 !important;
    color: #334155 !important;
    padding: 10px 14px !important;
}

.dkss-manage-table td {
    padding: 10px 14px !important;
    vertical-align: middle !important;
}

.dkss-badge-blocked {
    display: inline-block;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

.dkss-badge-whitelisted {
    display: inline-block;
    background: #dcfce7;
    color: #15803d;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

.button-unblock {
    background: #0284c7 !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
}

.button-unblock:hover {
    background: #0369a1 !important;
    border-color: #0369a1 !important;
    color: #ffffff !important;
}

.dkss-empty-notice {
    padding: 20px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.dkss-time-text {
    color: #64748b;
    font-size: 12px;
}

/* Pills for detection layers */
.dkss-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.dkss-pill-amber {
    background: #fef3c7;
    color: #92400e;
}

.dkss-pill-purple {
    background: #f3e8ff;
    color: #6b21a8;
}

.dkss-pill-blue {
    background: #e0f2fe;
    color: #0369a1;
}

.dkss-pill-red {
    background: #fee2e2;
    color: #991b1b;
}

.dkss-pill-slate {
    background: #f1f5f9;
    color: #334155;
}

.dkss-pill-orange {
    background: #ffedd5;
    color: #9a3412;
}

.dkss-tab-count-amber {
    background: #f59e0b !important;
}

/* Comment Cleaner Tab */
.dkss-comment-counts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.dkss-comment-count-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 12px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.dkss-count-num {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
    margin-bottom: 6px;
}

.dkss-count-lbl {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
}

.dkss-card-amber {
    border-color: #fde68a;
    background: #fffbeb;
}
.dkss-card-amber .dkss-count-num {
    color: #b45309;
}

.dkss-card-blue {
    border-color: #bae6fd;
    background: #f0f9ff;
}
.dkss-card-blue .dkss-count-num {
    color: #0369a1;
}

.dkss-card-green {
    border-color: #bbf7d0;
    background: #f0fdf4;
}
.dkss-card-green .dkss-count-num {
    color: #15803d;
}

.dkss-card-slate {
    border-color: #e2e8f0;
    background: #f8fafc;
}

.dkss-cleaner-actions-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
}

.dkss-cleaner-actions-box h3 {
    margin-top: 0;
    font-size: 16px;
    font-weight: 700;
}

.dkss-cleaner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.dkss-cleaner-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.dkss-cleaner-card h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dkss-cleaner-card p {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 16px 0;
    line-height: 1.4;
}

.dkss-cleaner-card-danger {
    background: #fff1f2;
    border-color: #fecdd3;
}

.button-cleaner-spam {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
}

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

.button-danger-wipe {
    background: #991b1b !important;
    border-color: #991b1b !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}

.button-danger-wipe:hover {
    background: #7f1d1d !important;
    border-color: #7f1d1d !important;
    color: #ffffff !important;
}
