// ============================================
// MobileRank Admin Dashboard
// SCSS Variables & Theme
// ============================================

$brand:       #1a73e8;
$brand-dark:  #0d47a1;
$accent:      #ff6d00;
$success:     #2e7d32;
$warning:     #f57f17;
$danger:      #c62828;
$gray:        #667085;
$gray-light:  #98a2b3;
$bg:          #f0f2f5;
$bg-card:     #f8f9fb;
$text:        #1a1a2e;
$text-body:   #333333;
$border:      #e4e7ec;
$border-light:#f0f2f5;
$white:       #ffffff;
$radius:      12px;
$radius-sm:   8px;

/* ============================================
   MobileRank Admin Dashboard
   Premium WordPress Plugin UI
   ============================================ */

/* --- Reset & Base --- */
#mobilerank-app {
    margin: 0 -20px 0 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
    color: #1a1a2e;
    background: #f0f2f5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

#mobilerank-app *, #mobilerank-app *::before, #mobilerank-app *::after {
    box-sizing: border-box;
}

/* --- Top Header Bar --- */
.pp-header {
    background: linear-gradient(135deg, #0d47a1 0%, #1565c0 50%, #1a73e8 100%);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: sticky;
    top: 32px;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(13, 71, 161, 0.3);
}

.pp-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pp-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pp-logo svg {
    width: 28px;
    height: 28px;
}

.pp-logo-text {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}

.pp-logo-version {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    font-weight: 500;
    background: rgba(255,255,255,0.12);
    padding: 2px 8px;
    border-radius: 10px;
}

.pp-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pp-header-badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ff6d00;
    background: rgba(255, 109, 0, 0.12);
    border: 1px solid rgba(255, 109, 0, 0.25);
    padding: 4px 12px;
    border-radius: 12px;
}

/* --- Navigation Tabs --- */
.pp-nav {
    background: #fff;
    padding: 0 32px;
    display: flex;
    align-items: center;
    gap: 0;
    border-bottom: 1px solid #e4e7ec;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.pp-nav-item {
    padding: 16px 20px;
    font-size: 13px;
    font-weight: 600;
    color: #667085;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    user-select: none;
}

.pp-nav-item:hover {
    color: #1a73e8;
    background: rgba(26, 115, 232, 0.04);
}

.pp-nav-item.active {
    color: #1a73e8;
    border-bottom-color: #1a73e8;
}

/* --- Main Content Area --- */
.pp-content {
    padding: 24px 32px;
    max-width: 1400px;
}

/* --- Cards --- */
.pp-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    margin-bottom: 20px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.pp-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
}

.pp-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pp-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pp-card-body {
    padding: 24px;
}

/* --- Score Ring (the centerpiece) --- */
.pp-score-section {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 32px 0;
}

.pp-stat-cards {
    display: flex;
    gap: 16px;
    flex: 1;
    flex-wrap: wrap;
}

.pp-stat-card {
    flex: 1;
    min-width: 100px;
    text-align: center;
    padding: 16px 12px;
    background: #f8f9fb;
    border-radius: 12px;
    border: 1px solid #e8ecf1;
}

.pp-stat-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
}

.pp-stat-label {
    font-size: 11px;
    font-weight: 600;
    color: #667085;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.pp-score-ring-wrap {
    position: relative;
    flex-shrink: 0;
}

.pp-score-ring-wrap svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.pp-score-ring-bg {
    fill: none;
    stroke: #f0f2f5;
    stroke-width: 10;
}

.pp-score-ring-fill {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.3s ease;
}

.pp-score-ring-fill.score-red { stroke: #c62828; }
.pp-score-ring-fill.score-yellow { stroke: #f57f17; }
.pp-score-ring-fill.score-green { stroke: #2e7d32; }

.pp-score-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.pp-score-value {
    font-size: 56px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -2px;
}

.pp-score-value.score-red { color: #c62828; }
.pp-score-value.score-yellow { color: #f57f17; }
.pp-score-value.score-green { color: #2e7d32; }

.pp-score-label {
    font-size: 12px;
    font-weight: 600;
    color: #667085;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* --- Web Vitals Cards --- */
.pp-vitals-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    flex: 1;
}

.pp-vital-card {
    background: #f8f9fb;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    border: 1px solid #e8ecf1;
    transition: all 0.2s ease;
}

.pp-vital-card:hover {
    border-color: #1a73e8;
    background: #f0f4ff;
}

.pp-vital-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #667085;
    margin-bottom: 8px;
}

.pp-vital-value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 4px;
}

.pp-vital-unit {
    font-size: 14px;
    font-weight: 500;
    color: #667085;
}

.pp-vital-status {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 10px;
    margin-top: 6px;
}

.pp-vital-status.good { background: #e8f5e9; color: #2e7d32; }
.pp-vital-status.needs-work { background: #fff8e1; color: #f57f17; }
.pp-vital-status.poor { background: #fce4ec; color: #c62828; }

/* --- Stats Strip --- */
.pp-stats-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.pp-stat-box {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e8ecf1;
}

.pp-stat-number {
    font-size: 32px;
    font-weight: 800;
    color: #1a1a2e;
    letter-spacing: -1px;
}

.pp-stat-number.critical { color: #c62828; }
.pp-stat-number.warning { color: #f57f17; }
.pp-stat-number.primary { color: #1a73e8; }

.pp-stat-label {
    font-size: 12px;
    font-weight: 600;
    color: #667085;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 4px;
}

/* --- Buttons --- */
.pp-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.4;
}

.pp-btn-primary {
    background: linear-gradient(135deg, #1a73e8, #1565c0);
    color: #fff;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.35);
}

.pp-btn-primary:hover {
    background: linear-gradient(135deg, #1565c0, #0d47a1);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.45);
    transform: translateY(-1px);
    color: #fff;
}

.pp-btn-primary:active {
    transform: translateY(0);
}

.pp-btn-secondary {
    background: #f0f2f5;
    color: #333;
    border: 1px solid #d0d5dd;
}

.pp-btn-secondary:hover {
    background: #e4e7ec;
    color: #333;
}

.pp-btn-danger {
    background: #fef2f2;
    color: #c62828;
    border: 1px solid #fecaca;
}

.pp-btn-danger:hover {
    background: #fce4ec;
}

.pp-btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.pp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.pp-btn .pp-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pp-spin 0.6s linear infinite;
}

@keyframes pp-spin {
    to { transform: rotate(360deg); }
}

/* --- Pages Table --- */
.pp-table-wrap {
    overflow-x: auto;
}

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

.pp-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #667085;
    border-bottom: 2px solid #e4e7ec;
    white-space: nowrap;
}

.pp-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f2f5;
    font-size: 13px;
    color: #333;
    vertical-align: middle;
}

.pp-table tr:hover td {
    background: #f8f9fb;
}

.pp-table tr:last-child td {
    border-bottom: none;
}

.pp-page-title {
    font-weight: 600;
    color: #1a1a2e;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pp-page-url {
    font-size: 11px;
    color: #98a2b3;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Score Badges --- */
.pp-score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 800;
}

.pp-score-badge.score-red {
    background: #fce4ec;
    color: #c62828;
    border: 2px solid #ef9a9a;
}

.pp-score-badge.score-yellow {
    background: #fff8e1;
    color: #f57f17;
    border: 2px solid #ffe082;
}

.pp-score-badge.score-green {
    background: #e8f5e9;
    color: #2e7d32;
    border: 2px solid #a5d6a7;
}

/* --- Status Badges --- */
.pp-status-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.pp-status-badge.healthy { background: #e8f5e9; color: #2e7d32; }
.pp-status-badge.needs-work { background: #fff8e1; color: #f57f17; }
.pp-status-badge.critical { background: #fce4ec; color: #c62828; }

/* --- SEO Impact Badges --- */
.pp-seo-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.pp-seo-badge.high { background: #fce4ec; color: #c62828; }
.pp-seo-badge.medium { background: #fff8e1; color: #f57f17; }
.pp-seo-badge.low { background: #e8f5e9; color: #2e7d32; }

.pp-seo-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.pp-seo-badge.high::before { background: #c62828; }
.pp-seo-badge.medium::before { background: #f57f17; }
.pp-seo-badge.low::before { background: #2e7d32; }

/* --- Issues List --- */
.pp-issue-item {
    padding: 20px 24px;
    border-bottom: 1px solid #f0f2f5;
    transition: background 0.15s ease;
}

.pp-issue-item:hover {
    background: #f8f9fb;
}

.pp-issue-item:last-child {
    border-bottom: none;
}

.pp-issue-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

.pp-issue-left {
    flex: 1;
}

.pp-issue-title {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pp-issue-severity {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pp-issue-severity.critical { background: #c62828; }
.pp-issue-severity.moderate { background: #f57f17; }
.pp-issue-severity.info { background: #1a73e8; }

.pp-issue-desc {
    font-size: 13px;
    color: #667085;
    line-height: 1.5;
    margin-bottom: 8px;
}

.pp-issue-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pp-issue-tag {
    font-size: 11px;
    font-weight: 500;
    color: #667085;
    background: #f0f2f5;
    padding: 2px 8px;
    border-radius: 4px;
}

.pp-issue-element {
    font-size: 11px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    color: #1a73e8;
    background: #eef4ff;
    padding: 2px 8px;
    border-radius: 4px;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Fix Panel --- */
.pp-fix-panel {
    background: #f8f9fb;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    margin-top: 12px;
    overflow: hidden;
}

.pp-fix-toggle {
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 700;
    color: #1a73e8;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease;
}

.pp-fix-toggle:hover {
    background: #eef4ff;
}

.pp-fix-toggle svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.pp-fix-toggle.open svg {
    transform: rotate(90deg);
}

.pp-fix-content {
    padding: 0 16px 16px;
}

.pp-fix-desc {
    font-size: 13px;
    color: #333;
    line-height: 1.5;
    margin-bottom: 12px;
}

.pp-fix-code {
    position: relative;
}

.pp-fix-code pre {
    background: #1a1a2e;
    color: #e4e7ec;
    padding: 16px;
    border-radius: 8px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 12px;
    line-height: 1.6;
    overflow-x: auto;
    margin: 0;
    white-space: pre;
    tab-size: 4;
}

.pp-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pp-copy-btn:hover {
    background: rgba(255,255,255,0.2);
}

.pp-copy-btn.copied {
    background: #2e7d32;
    border-color: #2e7d32;
}

/* --- Device Tabs --- */
.pp-device-tabs {
    display: flex;
    gap: 4px;
    background: #f0f2f5;
    padding: 4px;
    border-radius: 8px;
    width: fit-content;
}

.pp-device-tab {
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #667085;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.pp-device-tab:hover {
    color: #1a73e8;
}

.pp-device-tab.active {
    background: #fff;
    color: #1a73e8;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.pp-device-tab svg {
    width: 16px;
    height: 16px;
}

/* --- Settings Form --- */
.pp-form-group {
    margin-bottom: 24px;
}

.pp-form-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
}

.pp-form-hint {
    font-size: 12px;
    color: #98a2b3;
    margin-bottom: 8px;
}

.pp-form-input {
    width: 100%;
    max-width: 500px;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #fff;
    color: #333;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.pp-form-input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

.pp-form-select {
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    color: #333;
    font-family: inherit;
}

.pp-form-textarea {
    width: 100%;
    max-width: 500px;
    padding: 10px 14px;
    font-size: 13px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
    color: #333;
}

.pp-form-textarea:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

/* --- Progress Bar --- */
.pp-progress-wrap {
    margin: 24px 0;
}

.pp-progress-bar {
    width: 100%;
    height: 8px;
    background: #e4e7ec;
    border-radius: 4px;
    overflow: hidden;
}

.pp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1a73e8, #1565c0);
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pp-progress-text {
    font-size: 13px;
    color: #667085;
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
}

/* --- Scan Animation --- */
.pp-scanning-animation {
    text-align: center;
    padding: 48px 24px;
}

.pp-scanning-pulse {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(26, 115, 232, 0.1);
    margin: 0 auto 24px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pp-scanning-pulse::before,
.pp-scanning-pulse::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #1a73e8;
    animation: pp-pulse 2s ease-out infinite;
}

.pp-scanning-pulse::after {
    animation-delay: 0.5s;
}

@keyframes pp-pulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.8); opacity: 0; }
}

.pp-scanning-pulse svg {
    width: 32px;
    height: 32px;
    color: #1a73e8;
}

.pp-scanning-text {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.pp-scanning-sub {
    font-size: 13px;
    color: #667085;
}

/* --- Empty State --- */
.pp-empty-state {
    text-align: center;
    padding: 64px 24px;
}

.pp-empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: #f0f4ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pp-empty-icon svg {
    width: 40px;
    height: 40px;
    color: #1a73e8;
}

.pp-empty-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.pp-empty-desc {
    font-size: 14px;
    color: #667085;
    max-width: 400px;
    margin: 0 auto 24px;
    line-height: 1.5;
}

/* --- Back Link --- */
.pp-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #667085;
    cursor: pointer;
    margin-bottom: 16px;
    transition: color 0.2s ease;
    text-decoration: none;
}

.pp-back-link:hover {
    color: #1a73e8;
}

.pp-back-link svg {
    width: 16px;
    height: 16px;
}

/* --- Toast Notifications --- */
.pp-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1a1a2e;
    color: #fff;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    z-index: 100000;
    min-width: 300px;
    max-width: 520px;
    animation: pp-toast-in 0.3s ease;
}

.pp-toast.success { background: #1b5e20; }
.pp-toast.error { background: #b71c1c; }

.pp-toast-icon { font-size: 18px; flex-shrink: 0; }
.pp-toast-msg { flex: 1; line-height: 1.4; }

.pp-toast-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 16px;
    cursor: pointer;
    padding: 0 0 0 8px;
    line-height: 1;
}

.pp-toast-close:hover { color: #fff; }

@keyframes pp-toast-in {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* --- Page limit notice --- */
.pp-limit-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #fff3e0, #fff8e1);
    border: 1px solid #ffe0b2;
    border-radius: 10px;
    padding: 14px 20px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #e65100;
}

.pp-limit-notice svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #ff6d00;
}

/* --- Standalone Scores Grid --- */
.pp-standalone-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .pp-score-section {
        flex-direction: column;
        align-items: center;
    }
    .pp-vitals-grid,
    .pp-stat-cards {
        width: 100%;
    }
    .pp-stats-strip {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .pp-header {
        padding: 0 16px;
    }
    .pp-content {
        padding: 16px;
    }
    .pp-vitals-grid {
        grid-template-columns: 1fr;
    }
    .pp-stats-strip {
        grid-template-columns: 1fr;
    }
    .pp-standalone-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Dismiss Issue --- */
.pp-issue-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.pp-dismiss-btn {
    font-size: 11px;
    color: #98a2b3;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s ease;
    background: none;
    border: none;
}

.pp-dismiss-btn:hover {
    background: #f0f2f5;
    color: #667085;
}

.pp-issue-item.dismissed {
    opacity: 0.4;
}

/* --- Category Headers --- */
.pp-category-header {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #98a2b3;
    padding: 12px 24px 8px;
    background: #f8f9fb;
    border-bottom: 1px solid #f0f2f5;
}

/* --- Scan button area --- */
.pp-scan-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pp-last-scan {
    font-size: 12px;
    color: #98a2b3;
}

/* --- Info Tooltip --- */
.pp-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e4e7ec;
    color: #667085;
    font-size: 10px;
    font-weight: 700;
    cursor: help;
    flex-shrink: 0;
}

/* --- Google audit link --- */
.pp-audit-link {
    font-size: 11px;
    color: #1a73e8;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pp-audit-link:hover {
    text-decoration: underline;
    color: #1a73e8;
}

/* --- Flex utilities --- */
.pp-flex { display: flex; }
.pp-flex-col { flex-direction: column; }
.pp-items-center { align-items: center; }
.pp-justify-between { justify-content: space-between; }
.pp-gap-8 { gap: 8px; }
.pp-gap-16 { gap: 16px; }
.pp-mt-16 { margin-top: 16px; }
.pp-mb-16 { margin-bottom: 16px; }

/* ============================================
   ONBOARDING WIZARD
   ============================================ */

.pp-wizard-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(10, 15, 30, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: pp-fade-in 0.3s ease;
}

@keyframes pp-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.pp-wizard-modal {
    background: #fff;
    border-radius: 16px;
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
    animation: pp-slide-up 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes pp-slide-up {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.pp-wizard-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 24px 24px 0;
}

.pp-wizard-dot {
    width: 32px;
    height: 4px;
    border-radius: 2px;
    background: #e4e7ec;
    transition: all 0.3s ease;
}

.pp-wizard-dot.active {
    background: #1a73e8;
    width: 48px;
}

.pp-wizard-dot.done {
    background: #2e7d32;
}

.pp-wizard-step-header {
    text-align: center;
    padding: 20px 32px 0;
}

.pp-wizard-step-count {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1a73e8;
    margin-bottom: 8px;
}

.pp-wizard-step-title {
    font-size: 22px;
    font-weight: 800;
    color: #1a1a2e;
    margin: 0 0 4px;
}

.pp-wizard-step-subtitle {
    font-size: 14px;
    color: #667085;
    margin: 0;
}

.pp-wizard-content {
    padding: 24px 32px;
}

.pp-wizard-hero-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e8f0fe, #d2e3fc);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: #1a73e8;
}

.pp-wizard-hero-icon--success {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: #2e7d32;
}

.pp-wizard-mascot {
    text-align: center;
    margin: 0 auto 16px;
}

.pp-wizard-mascot img {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
    animation: pp-mascot-bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pp-mascot-bounce {
    0% { transform: scale(0.5) translateY(20px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.pp-wizard-heading {
    font-size: 20px;
    font-weight: 800;
    color: #1a1a2e;
    text-align: center;
    margin: 0 0 12px;
    line-height: 1.3;
}

.pp-wizard-text {
    font-size: 14px;
    color: #667085;
    line-height: 1.6;
    text-align: center;
    margin: 0 0 20px;
}

.pp-wizard-text-accent {
    font-size: 16px;
    font-weight: 700;
    color: #1a73e8;
    text-align: center;
}

.pp-wizard-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.pp-wizard-feature {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    background: #f8f9fb;
    border-radius: 10px;
    border: 1px solid #e8ecf1;
}

.pp-wizard-feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #e8f0fe;
    color: #1a73e8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pp-wizard-feature strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 2px;
}

.pp-wizard-feature span {
    font-size: 13px;
    color: #667085;
}

.pp-wizard-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.pp-wizard-stat {
    text-align: center;
    padding: 20px 12px;
    background: #f8f9fb;
    border-radius: 12px;
    border: 1px solid #e8ecf1;
}

.pp-wizard-stat-number {
    font-size: 36px;
    font-weight: 900;
    color: #1a73e8;
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: 8px;
}

.pp-wizard-stat-label {
    font-size: 12px;
    color: #667085;
    line-height: 1.4;
}

.pp-wizard-form {
    max-width: 460px;
    margin: 0 auto;
}

.pp-wizard-skip-note {
    font-size: 12px;
    color: #98a2b3;
    text-align: center;
    margin-top: 16px;
    font-style: italic;
}

.pp-wizard-checklist {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 320px;
    margin: 24px auto 0;
}

.pp-wizard-check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #2e7d32;
}

.pp-wizard-check-item svg {
    flex-shrink: 0;
}

.pp-wizard-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px 24px;
    border-top: 1px solid #f0f2f5;
}

/* ============================================
   MOBILE PREVIEW
   ============================================ */

.pp-preview-section {
    padding: 0;
}

.pp-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.pp-preview-title {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.pp-preview-legend {
    display: flex;
    gap: 16px;
}

.pp-preview-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
}

.pp-preview-legend-item.critical { color: #c62828; }
.pp-preview-legend-item.moderate { color: #f57f17; }

.pp-preview-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.pp-preview-legend-item.critical .pp-preview-legend-dot { background: #c62828; }
.pp-preview-legend-item.moderate .pp-preview-legend-dot { background: #f57f17; }

.pp-preview-container {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

/* Phone Frame */
.pp-phone-frame {
    width: 280px;
    flex-shrink: 0;
    background: #1a1a2e;
    border-radius: 32px;
    padding: 12px;
    box-shadow:
        0 0 0 2px #333,
        0 8px 32px rgba(0, 0, 0, 0.25),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.pp-phone-notch {
    width: 100px;
    height: 6px;
    background: #333;
    border-radius: 3px;
    margin: 0 auto 8px;
}

.pp-phone-screen {
    width: 100%;
    height: 480px;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.pp-phone-iframe {
    border: none;
    transform-origin: top left;
    pointer-events: none;
    display: block;
}

.pp-phone-home-bar {
    width: 80px;
    height: 4px;
    background: #555;
    border-radius: 2px;
    margin: 8px auto 0;
}

.pp-preview-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #f8f9fb;
    z-index: 2;
    font-size: 13px;
    color: #667085;
}

/* Issue markers on the preview */
.pp-preview-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.pp-preview-marker {
    position: absolute;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    animation: pp-marker-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: transform 0.15s ease;
    z-index: 2;
}

.pp-preview-marker:hover, .pp-preview-marker.active {
    transform: scale(1.2);
    z-index: 3;
}

.pp-preview-marker.critical {
    background: #c62828;
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.25), 0 2px 8px rgba(198, 40, 40, 0.3);
}

.pp-preview-marker.moderate {
    background: #f57f17;
    box-shadow: 0 0 0 3px rgba(245, 127, 23, 0.25), 0 2px 8px rgba(245, 127, 23, 0.3);
}

.pp-preview-marker.info {
    background: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.25), 0 2px 8px rgba(26, 115, 232, 0.3);
}

@keyframes pp-marker-pop {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.pp-preview-marker-num {
    font-size: 11px;
    font-weight: 800;
    color: #fff;
}

.pp-preview-tooltip {
    position: absolute;
    left: 32px;
    top: 50%;
    transform: translateY(-50%);
    background: #1a1a2e;
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    white-space: nowrap;
    font-size: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
    pointer-events: none;
}

.pp-preview-tooltip::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: #1a1a2e;
    border-left: none;
}

.pp-preview-tooltip strong {
    font-weight: 700;
}

/* Issue list sidebar */
.pp-preview-issues {
    flex: 1;
    min-width: 0;
}

.pp-preview-issues-title {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f2f5;
}

.pp-preview-no-issues {
    padding: 24px;
    text-align: center;
    font-size: 13px;
    color: #2e7d32;
    background: #e8f5e9;
    border-radius: 8px;
}

.pp-preview-issue-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 6px;
    transition: background 0.15s ease;
    cursor: default;
}

.pp-preview-issue-row:hover, .pp-preview-issue-row.active {
    background: #f8f9fb;
}

.pp-preview-issue-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.pp-preview-issue-num.critical { background: #c62828; }
.pp-preview-issue-num.moderate { background: #f57f17; }
.pp-preview-issue-num.info { background: #1a73e8; }

.pp-preview-issue-info {
    min-width: 0;
}

.pp-preview-issue-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 3px;
}

.pp-preview-issue-severity {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #667085;
    text-transform: capitalize;
}

@media (max-width: 860px) {
    .pp-preview-container {
        flex-direction: column;
        align-items: center;
    }
    .pp-preview-issues {
        width: 100%;
    }
}

/* ============================================
   QUICK FIXES
   ============================================ */

.pp-quickfix-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: #f0f4ff;
    border-bottom: 1px solid #d2e3fc;
    font-size: 12px;
    color: #1a73e8;
}

.pp-quickfix-info svg {
    flex-shrink: 0;
}

.pp-quickfix-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f2f5;
    transition: background 0.15s ease;
}

.pp-quickfix-item:last-child {
    border-bottom: none;
}

.pp-quickfix-item:hover {
    background: #f8f9fb;
}

.pp-quickfix-item.applied {
    background: #f6fff7;
}

.pp-quickfix-left {
    flex: 1;
    min-width: 0;
}

.pp-quickfix-title {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.pp-quickfix-desc {
    font-size: 13px;
    color: #667085;
    line-height: 1.5;
    margin-bottom: 8px;
}

.pp-quickfix-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.pp-quickfix-impact {
    font-size: 11px;
    font-weight: 600;
    color: #1a73e8;
    background: #e8f0fe;
    padding: 2px 8px;
    border-radius: 4px;
}

.pp-quickfix-risk {
    font-size: 11px;
    font-weight: 600;
    color: #2e7d32;
    background: #e8f5e9;
    padding: 2px 8px;
    border-radius: 4px;
}

.pp-quickfix-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.pp-quickfix-confirm {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #667085;
}

.pp-applied-count {
    font-size: 11px;
    font-weight: 600;
    color: #2e7d32;
    background: #e8f5e9;
    padding: 2px 10px;
    border-radius: 10px;
    margin-left: 8px;
}

/* ============================================
   SCORE SUMMARY (BEFORE / AFTER)
   ============================================ */

.pp-summary-card {
    border-left: 4px solid #1a73e8;
}

.pp-summary-compare {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 16px 0;
}

.pp-summary-col {
    text-align: center;
    min-width: 100px;
}

.pp-summary-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #98a2b3;
    margin-bottom: 8px;
}

.pp-summary-score {
    font-size: 48px;
    font-weight: 900;
    letter-spacing: -2px;
    line-height: 1;
    margin-bottom: 4px;
}

.pp-summary-score.score-green { color: #2e7d32; }
.pp-summary-score.score-yellow { color: #f57f17; }
.pp-summary-score.score-red { color: #c62828; }

.pp-summary-date {
    font-size: 11px;
    color: #98a2b3;
}

.pp-summary-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.pp-summary-diff {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.pp-summary-diff.improved { color: #2e7d32; }
.pp-summary-diff.declined { color: #c62828; }
.pp-summary-diff.neutral { color: #667085; }

.pp-summary-vitals {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 16px 0;
    border-top: 1px solid #f0f2f5;
    margin-top: 8px;
}

.pp-summary-vital-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.pp-summary-vital-label {
    font-weight: 700;
    color: #667085;
    font-size: 11px;
    width: 32px;
}

.pp-summary-vital-prev {
    font-weight: 600;
}

.pp-summary-vital-arrow {
    color: #98a2b3;
    font-size: 11px;
}

.pp-summary-vital-curr {
    font-weight: 700;
}

.pp-summary-resolved {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    margin-top: 8px;
    background: #e8f5e9;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #2e7d32;
}

@media (max-width: 600px) {
    .pp-summary-compare {
        flex-direction: column;
        gap: 16px;
    }
    .pp-summary-vitals {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    .pp-wizard-stat-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   PREVIEW TAB
   ============================================ */

.pp-preview-controls {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.pp-preview-page-select {
    flex: 1;
    min-width: 280px;
}

.pp-preview-dropdown {
    width: 100%;
    max-width: 100%;
    font-size: 13px;
}

.pp-preview-score-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    background: #f8f9fb;
    border-radius: 10px;
    border: 1px solid #e8ecf1;
}

.pp-preview-score-bar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.pp-preview-score-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Device frames */
.pp-device-frame {
    flex-shrink: 0;
    background: #1a1a2e;
    box-shadow:
        0 0 0 2px #333,
        0 8px 32px rgba(0, 0, 0, 0.25),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.pp-device-frame--desktop {
    background: #e4e7ec;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    border: 1px solid #d0d5dd;
    overflow: hidden;
}

.pp-desktop-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f0f2f5;
    border-bottom: 1px solid #d0d5dd;
}

.pp-desktop-dots {
    display: flex;
    gap: 5px;
}

.pp-desktop-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.pp-desktop-url-bar {
    flex: 1;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 4px;
    padding: 3px 10px;
    overflow: hidden;
}

.pp-desktop-url-text {
    font-size: 11px;
    color: #667085;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

@media (max-width: 980px) {
    .pp-preview-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .pp-preview-score-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================
   SETTINGS - EMAIL & CHECKBOX
   ============================================ */

.pp-settings-divider {
    height: 1px;
    background: #e4e7ec;
    margin: 28px 0;
}

.pp-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    line-height: 1.4;
}

.pp-checkbox-label span {
    padding-top: 1px;
}

.pp-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid #d0d5dd;
    cursor: pointer;
    accent-color: #1a73e8;
    flex-shrink: 0;
    margin-top: 2px;
}

.pp-checkbox:checked {
    border-color: #1a73e8;
}

.pp-checkbox:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pp-checkbox-label:has(.pp-checkbox:disabled) {
    opacity: 0.5;
    cursor: not-allowed;
}
