/**
 * Pixellize Site Issue Scanner - Premium UI
 * Primary Accent: #754ffe
 */

:root {
    --spf-primary-hue: 253;
    --spf-primary: #754ffe;
    --spf-primary-hover: #5d3eca;
    --spf-primary-light: #ece9fe;

    --spf-bg-color: #f8fafc;
    --spf-card-bg: rgba(255, 255, 255, 0.85);
    /* Glassmorphism Base */
    --spf-card-border: rgba(255, 255, 255, 0.4);

    --spf-text-main: #1e293b;
    --spf-text-muted: #64748b;

    --spf-success: #10b981;
    --spf-warning: #f59e0b;
    --spf-error: #ef4444;

    --spf-radius-lg: 16px;
    --spf-radius-md: 12px;
    --spf-radius-sm: 8px;

    --spf-shadow-soft: none;
    --spf-shadow-hover: none;
}

/* Base App Wrapper */
.spf-wrap-premium {
    margin: 20px 20px 0 0 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--spf-text-main);
    background-color: var(--spf-bg-color);
    padding: 20px;
    border-radius: var(--spf-radius-lg);
}

.spf-wrap-premium h1,
.spf-wrap-premium h2,
.spf-wrap-premium h3 {
    color: var(--spf-text-main);
    font-weight: 600;
}

/* Header */
.spf-app-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.spf-app-header h1 {
    font-size: 28px;
    margin: 0 0 5px 0;
    background: linear-gradient(135deg, var(--spf-primary) 0%, #906bf0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.spf-app-header p {
    font-size: 15px;
    color: var(--spf-text-muted);
    margin: 0;
}

/* Layout Grids */
.spf-dashboard-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.spf-hero-section {
    display: flex;
    align-items: stretch;
    gap: 20px;
}

.spf-main-card {
    background: var(--spf-card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--spf-card-border);
    border-radius: var(--spf-radius-lg);
    padding: 30px;
    padding: 30px;
}

.spf-scanner-hero {
    flex: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient(145deg, #ffffff, #fbfaff);
    position: relative;
    overflow: hidden;
}

.spf-scanner-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(117, 79, 254, 0.03) 0%, transparent 60%);
    z-index: 0;
}

.spf-hero-content {
    position: relative;
    z-index: 1;
}

.spf-scanner-hero h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.spf-scanner-hero p {
    color: var(--spf-text-muted);
    margin-bottom: 25px;
    font-size: 15px;
}

/* Controls */
.spf-controls-group {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.spf-btn {
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.spf-btn-primary {
    background: var(--spf-primary);
    color: white;
}

.spf-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spf-btn-secondary {
    background: white;
    color: var(--spf-text-main);
    border: 1px solid #e2e8f0;
}

.spf-quick-links-side {
    flex: 1;
}

/* Links List */
.spf-link-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.spf-link-list li {
    margin-bottom: 15px;
}

.spf-link-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid transparent;
    border-radius: var(--spf-radius-md);
    color: var(--spf-text-main);
    text-decoration: none;
    font-weight: 500;
}

/* Progress Area */
#spf-progress-area {
    width: 100%;
    margin: 30px auto 0;
    text-align: left;
}

.spf-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--spf-text-muted);
    font-weight: 500;
    margin-bottom: 10px;
}

.spf-progress-track {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.spf-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--spf-primary) 0%, #906bf0 100%);
    border-radius: 10px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Animated Pulse on Fill */
.spf-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading-pulse 1.5s infinite;
}

@keyframes loading-pulse {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.spf-terminal-log {
    background: #0f172a;
    color: #38bdf8;
    padding: 15px;
    border-radius: var(--spf-radius-md);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 12px;
    height: 120px;
    overflow-y: auto;
}

.spf-terminal-log div {
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 4px;
}

.spf-terminal-log .log-err {
    color: #f87171;
}

.spf-terminal-log .log-warn {
    color: #fbbf24;
}

.spf-terminal-log .log-succ {
    color: #4ade80;
}

/* Stats Overview */
.spf-stats-board {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}

.spf-health-ring-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.spf-ring-wrap {
    position: relative;
    width: 140px;
    height: 140px;
    margin-bottom: 20px;
}

.spf-ring-bg {
    fill: none;
    stroke: var(--spf-primary-light);
    stroke-width: 8;
}

.spf-ring-fill {
    fill: none;
    stroke: var(--spf-primary);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease-out;
}

.spf-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 36px;
    font-weight: 700;
    color: var(--spf-text-main);
    display: flex;
    align-items: baseline;
}

.spf-ring-text span {
    font-size: 14px;
    color: var(--spf-text-muted);
    font-weight: 500;
    margin-left: 2px;
}

.spf-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    align-content: center;
}

.spf-stat-pill {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--spf-card-border);
    padding: 20px;
    border-radius: var(--spf-radius-md);
    text-align: center;
}

.spf-pill-val {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: var(--spf-text-main);
    margin-bottom: 5px;
}

.spf-pill-val.error {
    color: var(--spf-error);
}

.spf-pill-val.warning {
    color: var(--spf-warning);
}

.spf-pill-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--spf-text-muted);
    font-weight: 600;
}

/* Modals & Alerts */
.spf-activity-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--spf-card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.spf-activity-item:last-child {
    border-bottom: none;
}

.spf-activity-date {
    font-weight: 500;
    color: var(--spf-text-main);
    font-size: 14px;
}

.spf-activity-meta {
    font-size: 13px;
    color: var(--spf-text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.spf-activity-meta .dashicons {
    width: 14px;
    height: 14px;
    line-height: 1;
}

.spf-score-high {
    color: var(--spf-success);
    font-weight: 600;
    font-size: 18px;
}

.spf-score-med {
    color: var(--spf-warning);
    font-weight: 600;
    font-size: 18px;
}

.spf-score-low {
    color: var(--spf-error);
    font-weight: 600;
    font-size: 18px;
}

/* Toast Notification */
#spf-alert-container {
    position: fixed;
    top: 60px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 380px;
    width: 100%;
}

.spf-toast {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    background: #ffffff;
    border-radius: var(--spf-radius-md);
    border-left: 4px solid var(--spf-primary);
    pointer-events: all;
    animation: toastSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.spf-toast.toast-success {
    border-left-color: #22c55e;
}

.spf-toast.toast-danger {
    border-left-color: #ef4444;
}

.spf-toast.toast-info {
    border-left-color: var(--spf-primary);
}

.spf-toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.toast-success .spf-toast-icon {
    background: #dcfce7;
    color: #16a34a;
}

.toast-danger .spf-toast-icon {
    background: #fee2e2;
    color: #dc2626;
}

.toast-info .spf-toast-icon {
    background: var(--spf-primary-light);
    color: var(--spf-primary);
}

.spf-toast-body {
    flex: 1;
}

.spf-toast-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--spf-text-main);
    margin-bottom: 3px;
}

.spf-toast-msg {
    font-size: 13px;
    color: var(--spf-text-muted);
    line-height: 1.5;
}

.spf-toast-msg a {
    color: var(--spf-primary);
    font-weight: 600;
}

.spf-toast-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--spf-text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.6;
    flex-shrink: 0;
}

.spf-toast-close:hover {
    opacity: 1;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Tables (Reports) */
.spf-table-wrapper {
    background: var(--spf-card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--spf-card-border);
    border-radius: var(--spf-radius-lg);
    overflow: hidden;
    box-shadow: var(--spf-shadow-soft);
}

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

.spf-modern-table th {
    background: #f8fafc;
    padding: 15px 20px;
    text-align: left;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--spf-text-muted);
    border-bottom: 1px solid #e2e8f0;
}

.spf-modern-table td {
    padding: 15px 20px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--spf-text-main);
    font-size: 14px;
}

.spf-modern-table tbody tr {}

.spf-modern-table tbody tr:last-child td {
    border-bottom: none;
}

.spf-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
}

.spf-tag.error {
    background: #fee2e2;
    color: #b91c1c;
}

.spf-tag.warning {
    background: #fef3c7;
    color: #b45309;
}

/* Dashboard Tabs / Top actions */
.spf-batch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    background: var(--spf-card-bg);
    padding: 15px 25px;
    border-radius: var(--spf-radius-md);
    box-shadow: var(--spf-shadow-soft);
}

select.spf-select-modern {
    padding: 10px 15px;
    border-radius: var(--spf-radius-sm);
    border: 1px solid #cbd5e1;
    background: white;
    color: var(--spf-text-main);
    font-size: 14px;
    outline: none;
    cursor: pointer;
}

select.spf-select-modern:focus {
    border-color: var(--spf-primary);
}

/* Helper Guide inside Reports */
.spf-fix-guide {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 1px solid var(--spf-card-border);
    border-left: 4px solid var(--spf-primary);
    padding: 20px 25px;
    border-radius: var(--spf-radius-md);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--spf-shadow-soft);
}

.spf-guide-icon {
    font-size: 32px;
    color: var(--spf-primary);
}

.spf-guide-text h3 {
    margin: 0 0 5px;
    font-size: 16px;
    color: var(--spf-primary);
}

.spf-guide-text p {
    margin: 0;
    color: var(--spf-text-muted);
    font-size: 14px;
}

/* WP_List_Table Overrides for Drill Down View */
.spf-table-wrapper {
    background: var(--spf-card-bg);
    border: 1px solid var(--spf-card-border);
    border-radius: var(--spf-radius-lg);
    padding: 20px;
}

.spf-table-wrapper .wp-list-table {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.spf-table-wrapper .wp-list-table thead th,
.spf-table-wrapper .wp-list-table tfoot th {
    background: #f8fafc !important;
    color: var(--spf-text-muted) !important;
    font-size: 13px !important;
    text-transform: uppercase !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 15px !important;
}

.spf-table-wrapper .wp-list-table tbody td {
    padding: 15px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    font-size: 14px !important;
    color: var(--spf-text-main) !important;
    background: transparent !important;
}

.spf-table-wrapper .wp-list-table tbody tr:last-child td {
    border-bottom: none !important;
}

.spf-table-wrapper .tablenav {
    height: auto !important;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}