/* =============================================
   LightningMine Page Speed Checker — lm-pagespeed.css
   Extends lightningmine-diagnostics.css conventions
   ============================================= */

/* ── Strategy radio buttons ── */
.lm-ps-strategy-wrap {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.lm-ps-strategy-label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin: 0;
}
.lm-ps-radio-label {
    font-size: 14px;
    color: #444;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
}

/* ── Score ring ── */
.lm-ps-scores {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.lm-ps-score-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 22px 28px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    min-width: 240px;
}
.lm-ps-ring-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}
.lm-ps-ring-svg {
    transform: rotate(-90deg);
    width: 80px;
    height: 80px;
}
.lm-ps-ring-bg {
    fill: none;
    stroke: #e8edf3;
    stroke-width: 7;
}
.lm-ps-ring-fill {
    fill: none;
    stroke-width: 7;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}
.lm-ps-ring-fill.good   { stroke: #28a745; }
.lm-ps-ring-fill.ok     { stroke: #ffc107; }
.lm-ps-ring-fill.poor   { stroke: #dc3545; }
.lm-ps-ring-number {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}
.lm-ps-ring-number.good  { color: #28a745; }
.lm-ps-ring-number.ok    { color: #c08000; }
.lm-ps-ring-number.poor  { color: #dc3545; }
.lm-ps-score-info h4 {
    margin: 0 0 4px;
    font-size: 16px;
    color: #1a1a2e;
}
.lm-ps-score-info p {
    margin: 0;
    font-size: 13px;
    color: #5a6a7e;
    line-height: 1.5;
}

/* ── Metrics table ── */
.lm-ps-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
    animation: lm-ps-fadeup 0.22s ease both;
}
@keyframes lm-ps-fadeup {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.lm-ps-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f5f8fc;
    padding: 11px 16px;
    border-bottom: 1px solid #ddd;
}
.lm-ps-section-header h3 {
    margin: 0;
    font-size: 15px;
    color: #1a1a2e;
}
.lm-ps-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    font-family: "Courier New", Courier, monospace;
    letter-spacing: 0.6px;
}
.lm-ps-badge-green  { background: #d4f8e8; color: #1b7a40; }
.lm-ps-badge-yellow { background: #fff8d6; color: #7a5c00; }
.lm-ps-badge-red    { background: #fde8e8; color: #b52020; }
.lm-ps-badge-blue   { background: #dbeeff; color: #0073aa; }

.lm-ps-section-body { padding: 4px 0; }

/* Metric row */
.lm-ps-metric-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #f0f4f8;
    font-size: 13px;
}
.lm-ps-metric-row:last-child { border-bottom: none; }
.lm-ps-metric-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.lm-ps-metric-dot.good  { background: #28a745; }
.lm-ps-metric-dot.ok    { background: #ffc107; }
.lm-ps-metric-dot.poor  { background: #dc3545; }
.lm-ps-metric-dot.na    { background: #adb5bd; }
.lm-ps-metric-label {
    flex: 1;
    color: #1a1a2e;
    font-weight: 500;
}
.lm-ps-metric-value {
    font-family: "Courier New", Courier, monospace;
    font-weight: 600;
    color: #1a1a2e;
    min-width: 80px;
    text-align: right;
}
.lm-ps-metric-value.good  { color: #1b7a40; }
.lm-ps-metric-value.ok    { color: #c08000; }
.lm-ps-metric-value.poor  { color: #b52020; }

/* Opportunity row */
.lm-ps-opp-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 16px;
    border-bottom: 1px solid #f0f4f8;
    font-size: 13px;
}
.lm-ps-opp-row:last-child { border-bottom: none; }
.lm-ps-opp-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.lm-ps-opp-title {
    flex: 1;
    color: #1a1a2e;
    font-weight: 600;
    line-height: 1.4;
}
.lm-ps-opp-desc {
    font-size: 12px;
    color: #64748b;
    margin-top: 3px;
    line-height: 1.5;
    font-weight: 400;
}
.lm-ps-opp-savings {
    font-family: "Courier New", Courier, monospace;
    font-size: 12px;
    color: #1b7a40;
    background: #d4f8e8;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ── Status bar ── */
.lm-ps-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #5a6a7e;
    margin-bottom: 18px;
    padding: 8px 12px;
    background: #f5f8fc;
    border-radius: 6px;
    border: 1px solid #d0d7e3;
}
.lm-ps-status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #28a745;
    flex-shrink: 0;
}
.lm-tool-domain { font-family: "Courier New", Courier, monospace; font-weight: 600; color: #0073aa; }

/* ── Loader ── */
.lm-tool-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 48px 0;
    font-size: 14px;
    color: #5a6a7e;
}
.lm-tool-spinner {
    width: 20px; height: 20px;
    border: 2px solid #d0d7e3;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: lm-ps-spin 0.65s linear infinite;
    flex-shrink: 0;
}
@keyframes lm-ps-spin { to { transform: rotate(360deg); } }

/* ── Error ── */
.lm-tool-error {
    background: #fff3f3;
    border: 1px solid #f5c0c0;
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 13px;
    color: #c0392b;
    font-family: "Courier New", Courier, monospace;
}

/* ── About box ── */
.lm-tool-about {
    margin-top: 20px;
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 13px;
    color: #555;
    line-height: 1.7;
}
.lm-tool-about strong { color: #1a1a2e; }
.lm-tool-about a { color: #0073aa; }

/* ── Responsive ── */
@media (max-width: 640px) {
    .lm-ps-score-card { flex-direction: column; align-items: flex-start; }
    .lm-ps-scores { flex-direction: column; }
}
/* LightningMine Page Speed Checker — v1.1.0 CSS additions
   Append these rules to the bottom of your existing lm-pagespeed.css file */

/* Category score tiles */
.lm-ps-cat-tiles {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 16px 0;
}
.lm-ps-cat-tile {
    flex: 1;
    min-width: 120px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}
.lm-ps-cat-title {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}
.lm-ps-cat-score {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}
.lm-ps-cat-score.good  { color: #16a34a; }
.lm-ps-cat-score.ok    { color: #d97706; }
.lm-ps-cat-score.poor  { color: #dc2626; }
.lm-ps-cat-device {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

/* Badge colours for new sections */
.lm-ps-badge-teal   { background: #0e7490; color: #fff; }
.lm-ps-badge-blue   { background: #1d4ed8; color: #fff; }
.lm-ps-badge-purple { background: #7c3aed; color: #fff; }
.lm-ps-badge-orange { background: #c2410c; color: #fff; }
.lm-ps-badge-gray   { background: #475569; color: #fff; }

/* Screenshots */
.lm-ps-screenshots {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 8px 0;
}
.lm-ps-screenshot-wrap {
    flex: 0 0 auto;
}

/* Diagnostics file items */
.lm-ps-diag-items {
    margin-top: 6px;
    padding-left: 8px;
    border-left: 2px solid #e2e8f0;
}
.lm-ps-diag-item {
    font-size: 12px;
    color: #64748b;
    padding: 2px 0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}
.lm-ps-diag-file {
    font-family: monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}
.lm-ps-diag-savings {
    color: #d97706;
    font-weight: 600;
    white-space: nowrap;
}

/* Passed audits toggle button */
.lm-ps-passed-toggle {
    font-size: 13px;
    padding: 6px 12px;
}

@media (max-width: 640px) {
    .lm-ps-cat-tiles { flex-direction: column; }
    .lm-ps-screenshots { flex-direction: column; }
    .lm-ps-diag-file { max-width: 160px; }
}