/* ==========================================================================
   GGR Page Analyzer — page-analyzer.css
   @package GGR_Website_Audit  @since 3.0.0
   ========================================================================== */

/* ── Wrapper ── */
.gpa-wrap {
    max-width: 1060px;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1a2332;
    padding-bottom: 48px;
}

/* ── Header ── */
.gpa-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.gpa-header-brand { display: flex; align-items: center; gap: 10px; }
.gpa-logo-box { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.gpa-plugin-name { font-size: 15px; font-weight: 700; color: #1e3a5f; line-height: 1.2; }
.gpa-plugin-sub  { font-size: 11px; color: #6b7280; margin-top: 1px; }
.gpa-badge-pro {
    background: linear-gradient(135deg, #1e3a5f, #2d527a);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .6px;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
}

/* ── Search Panel ── */
.gpa-search-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px 22px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.gpa-search-top { margin-bottom: 14px; }

/* Type pills */
.gpa-type-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.gpa-type-pill {
    font-size: 12px;
    font-weight: 500;
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #6b7280;
    cursor: pointer;
    transition: all .15s;
}
.gpa-type-pill:hover,
.gpa-type-active {
    background: #1e3a5f;
    color: #fff;
    border-color: #1e3a5f;
}

/* Search row */
.gpa-search-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.gpa-search-box {
    flex: 1;
    position: relative;
}
.gpa-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}
.gpa-search-input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    color: #1a2332;
    background: #fafafa;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}
.gpa-search-input:focus {
    border-color: #1e3a5f;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(30,58,95,.08);
}

/* Dropdown */
.gpa-search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    z-index: 9999;
    max-height: 320px;
    overflow-y: auto;
    display: none;
}
.gpa-search-dropdown.is-open { display: block; }
.gpa-dd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background .1s;
}
.gpa-dd-item:last-child { border-bottom: none; }
.gpa-dd-item:hover { background: #f0f4ff; }
.gpa-dd-title { font-size: 13px; font-weight: 600; color: #1a2332; flex: 1; }
.gpa-dd-type {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 2px 7px;
    border-radius: 10px;
    background: #dbeafe;
    color: #1d4ed8;
    flex-shrink: 0;
}
.gpa-dd-type-page    { background: #f3e8ff; color: #7c3aed; }
.gpa-dd-type-product { background: #fef3c7; color: #b45309; }
.gpa-dd-empty {
    padding: 16px 14px;
    font-size: 13px;
    color: #9ca3af;
    text-align: center;
}
.gpa-dd-loading {
    padding: 14px;
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
}

/* Analyze button */
.gpa-analyze-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #1e3a5f;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, opacity .15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.gpa-analyze-btn:hover:not(:disabled) { background: #2d527a; }
.gpa-analyze-btn:disabled { opacity: .45; cursor: not-allowed; }

/* Selected post chip */
.gpa-selected-post {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    background: #f0f4ff;
    border: 1px solid #c7d7f5;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
}
.gpa-sel-icon { font-size: 15px; }
.gpa-sel-title { font-weight: 600; color: #1e3a5f; flex: 1; }
.gpa-sel-type {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    background: #dbeafe;
    color: #1d4ed8;
    padding: 2px 7px;
    border-radius: 10px;
}
.gpa-sel-clear {
    background: none;
    border: none;
    font-size: 18px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
    transition: color .12s;
}
.gpa-sel-clear:hover { color: #dc2626; }

/* ── Score Hero ── */
.gpa-score-hero {
    display: flex;
    align-items: center;
    gap: 28px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 24px 28px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.gpa-score-ring-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}
.gpa-ring-svg { width: 130px; height: 130px; }
.gpa-ring-score-text {
    font-size: 30px;
    font-weight: 900;
    fill: #1a2332;
    dominant-baseline: middle;
    letter-spacing: -1px;
}
.gpa-ring-denom {
    font-size: 12px;
    fill: #9ca3af;
    dominant-baseline: middle;
    font-weight: 500;
}
.gpa-score-grade {
    margin-top: 6px;
    font-size: 13px;
    font-weight: 800;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1e3a5f;
    color: #fff;
}
.gpa-score-grade-A { background: #16a34a; }
.gpa-score-grade-B { background: #3b82f6; }
.gpa-score-grade-C { background: #f59e0b; }
.gpa-score-grade-D { background: #dc2626; }

.gpa-score-meta { flex: 1; }
.gpa-score-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a2332;
    margin: 0 0 4px;
    line-height: 1.3;
}
.gpa-score-url {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 10px;
    word-break: break-all;
}
.gpa-score-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.gpa-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    background: #f3f4f6;
    color: #374151;
}
.gpa-score-actions { display: flex; gap: 8px; }
.gpa-btn-edit, .gpa-btn-view {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 8px;
    text-decoration: none;
    transition: background .12s;
}
.gpa-btn-edit { background: #1e3a5f; color: #fff; }
.gpa-btn-edit:hover { background: #2d527a; color: #fff; }
.gpa-btn-view { background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; }
.gpa-btn-view:hover { background: #e5e7eb; color: #374151; }

.gpa-score-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
    min-width: 100px;
}
.gpa-summary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 16px;
    text-align: center;
}
.gpa-sum-num { font-size: 22px; font-weight: 800; color: #1a2332; line-height: 1; }
.gpa-sum-lbl { font-size: 10px; color: #9ca3af; font-weight: 600; margin-top: 3px; text-transform: uppercase; letter-spacing: .4px; }
#gpa-sum-good .gpa-sum-num { color: #16a34a; }
#gpa-sum-warn .gpa-sum-num { color: #f59e0b; }
#gpa-sum-crit .gpa-sum-num { color: #dc2626; }

/* ── Group Tabs ── */
.gpa-group-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}
.gpa-gtab {
    font-size: 12px;
    font-weight: 500;
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #6b7280;
    cursor: pointer;
    transition: all .15s;
}
.gpa-gtab:hover,
.gpa-gtab-active {
    background: #1e3a5f;
    color: #fff;
    border-color: #1e3a5f;
}

/* ── Checks Grid ── */
.gpa-checks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}
.gpa-check-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    transition: transform .12s, box-shadow .12s;
    position: relative;
    overflow: hidden;
}
.gpa-check-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    border-radius: 12px 0 0 12px;
}
.gpa-check-good::before   { background: #16a34a; }
.gpa-check-warning::before { background: #f59e0b; }
.gpa-check-critical::before { background: #dc2626; }
.gpa-check-card:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.08); }

.gpa-check-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
    flex-shrink: 0;
    color: #fff;
}
.gpa-icon-good     { background: #16a34a; }
.gpa-icon-warning  { background: #f59e0b; }
.gpa-icon-critical { background: #dc2626; }

.gpa-check-body { flex: 1; }
.gpa-check-label {
    font-size: 13px;
    font-weight: 700;
    color: #1a2332;
    margin-bottom: 3px;
}
.gpa-check-desc {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
}
.gpa-check-value {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 6px;
    display: inline-block;
}
.gpa-val-good     { background: #f0fdf4; color: #166534; }
.gpa-val-warning  { background: #fef3c7; color: #92400e; }
.gpa-val-critical { background: #fee2e2; color: #991b1b; }

/* ── Empty State ── */
.gpa-empty {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.gpa-empty-icon { font-size: 48px; margin-bottom: 14px; }
.gpa-empty-title { font-size: 18px; font-weight: 700; color: #1a2332; margin-bottom: 8px; }
.gpa-empty-sub { font-size: 13px; color: #6b7280; max-width: 440px; margin: 0 auto 20px; line-height: 1.6; }
.gpa-empty-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}
.gpa-empty-features span {
    font-size: 12px;
    font-weight: 600;
    color: #16a34a;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 4px 12px;
    border-radius: 20px;
}

/* ── Loading ── */
.gpa-loading {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
}
.gpa-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #1e3a5f;
    border-radius: 50%;
    animation: gpa-spin .8s linear infinite;
    margin: 0 auto 14px;
}
@keyframes gpa-spin { to { transform: rotate(360deg); } }
.gpa-loading-text { font-size: 14px; font-weight: 600; color: #374151; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .gpa-score-hero { flex-direction: column; align-items: flex-start; }
    .gpa-score-summary { flex-direction: row; min-width: auto; width: 100%; }
    .gpa-checks-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .gpa-search-row { flex-direction: column; }
    .gpa-analyze-btn { width: 100%; justify-content: center; }
    .gpa-header { flex-direction: column; gap: 10px; align-items: flex-start; }
}

/* ── Core Web Vitals Panel ── */
.gpa-cwv-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 18px 22px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.gpa-cwv-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.gpa-cwv-title {
    font-size: 13px;
    font-weight: 700;
    color: #1a2332;
    flex: 1;
}
.gpa-cwv-source {
    font-size: 11px;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 3px 10px;
    border-radius: 20px;
}
.gpa-cwv-strategy-toggle { display: flex; gap: 4px; }
.gpa-strat-btn {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #6b7280;
    cursor: pointer;
    transition: all .15s;
}
.gpa-strat-btn:hover,
.gpa-strat-active { background: #1e3a5f; color: #fff; border-color: #1e3a5f; }

.gpa-cwv-no-key {
    font-size: 13px;
    color: #6b7280;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.gpa-cwv-no-key a { color: #b45309; font-weight: 600; }

.gpa-cwv-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}
.gpa-cwv-metric {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 14px;
}
.gpa-cwv-metric-label {
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 6px;
}
.gpa-cwv-hint { font-size: 10px; color: #9ca3af; font-weight: 400; }
.gpa-cwv-metric-val {
    font-size: 22px;
    font-weight: 800;
    color: #1a2332;
    margin-bottom: 8px;
    line-height: 1;
}
.gpa-cwv-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}
.gpa-cwv-bar-fill {
    height: 100%;
    border-radius: 4px;
    width: 0%;
    transition: width .6s ease;
}
.gpa-cwv-threshold { font-size: 10px; color: #9ca3af; }

/* CWV status colors */
.gpa-cwv-good   .gpa-cwv-metric-val { color: #16a34a; }
.gpa-cwv-good   .gpa-cwv-bar-fill   { background: #16a34a; }
.gpa-cwv-warn   .gpa-cwv-metric-val { color: #f59e0b; }
.gpa-cwv-warn   .gpa-cwv-bar-fill   { background: #f59e0b; }
.gpa-cwv-crit   .gpa-cwv-metric-val { color: #dc2626; }
.gpa-cwv-crit   .gpa-cwv-bar-fill   { background: #dc2626; }

/* Opportunities */
.gpa-cwv-opps { display: flex; flex-direction: column; gap: 6px; }
.gpa-cwv-opp {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
}
.gpa-cwv-opp.gpa-opp-critical { background: #fee2e2; border-color: #fca5a5; }
.gpa-cwv-opp-title { font-weight: 700; color: #1a2332; }
.gpa-cwv-opp-savings { font-size: 11px; color: #16a34a; font-weight: 600; margin-left: 6px; }

.gpa-cwv-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #6b7280;
    padding: 8px 0;
}

@media (max-width: 900px) {
    .gpa-cwv-metrics { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .gpa-cwv-metrics { grid-template-columns: 1fr 1fr; }
}

/* ══════════════════════════════════════════════════════════════
   STATUS BANNER — unique GGR feature
══════════════════════════════════════════════════════════════ */
#gpa-status-banner { margin-bottom: 14px; }

.gpa-status-banner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    border-radius: 12px;
    padding: 16px 20px;
    border: 1.5px solid;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.gpa-status-banner-left  { display: flex; align-items: flex-start; gap: 12px; flex: 1; }
.gpa-status-banner-icon  { font-size: 22px; flex-shrink: 0; margin-top: 1px; }
.gpa-status-banner-title { font-size: 14px; font-weight: 700; color: #1a2332; margin-bottom: 5px; }
.gpa-advisory-line       { font-size: 12px; color: #374151; line-height: 1.6; }
.gpa-advisory-main       { font-weight: 600; }

.gpa-status-banner-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

/* Banner colour variants */
.gpa-banner-success   { background: #f0fdf4; border-color: #86efac; }
.gpa-banner-warning   { background: #fffbeb; border-color: #fcd34d; }
.gpa-banner-draft     { background: #f8fafc; border-color: #cbd5e1; }
.gpa-banner-pending   { background: #faf5ff; border-color: #c4b5fd; }
.gpa-banner-scheduled { background: #eff6ff; border-color: #93c5fd; }
.gpa-banner-info      { background: #f0f9ff; border-color: #7dd3fc; }

/* Visibility badge */
.gpa-vis-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}
.gpa-vis-public   { background: #f0fdf4; color: #166534; border: 1px solid #86efac; }
.gpa-vis-private  { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }
.gpa-vis-password { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }

/* Permalink badge */
.gpa-permalink-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}
.gpa-pl-good { background: #f0fdf4; color: #166534; border: 1px solid #86efac; }
.gpa-pl-warn { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }

/* Google indexability badge */
.gpa-index-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}
.gpa-index-yes { background: #f0fdf4; color: #166534; border: 1px solid #86efac; }
.gpa-index-no  { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }

/* Fix in editor button */
.gpa-banner-edit-btn {
    font-size: 11px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 8px;
    background: #1e3a5f;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    transition: background .12s;
}
.gpa-banner-edit-btn:hover { background: #2d527a; color: #fff; }

/* Permalink row */
.gpa-permalink-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 12px;
}
.gpa-permalink-label { font-weight: 700; color: #374151; flex-shrink: 0; }
.gpa-permalink-url   { font-family: monospace; color: #1e3a5f; background: #e0e7ff; padding: 2px 7px; border-radius: 4px; word-break: break-all; }
.gpa-pl-advice-good  { color: #16a34a; font-weight: 600; }
.gpa-pl-advice-warn  { color: #b45309; font-weight: 600; }

/* ── Dropdown status badges ── */
.gpa-dd-status {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}
.gpa-dd-status-draft     { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.gpa-dd-status-pending   { background: #faf5ff; color: #7c3aed; border: 1px solid #c4b5fd; }
.gpa-dd-status-future    { background: #eff6ff; color: #1d4ed8; border: 1px solid #93c5fd; }
.gpa-dd-status-private   { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }

/* ── Type hint bar ── */
.gpa-type-hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: 8px;
    padding: 6px 10px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
}
.gpa-type-hint strong { color: #1e3a5f; }

/* ── Type mismatch badge in dropdown ── */
.gpa-dd-mismatch {
    font-size: 10px;
    font-weight: 700;
    color: #b45309;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: help;
}

