/* ── Speed Test Visual Sections ── */

/* PDF export button */
.st-pdf-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: #10b981;
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}
.st-pdf-btn:hover { background: #059669; }
.st-pdf-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}
.st-pdf-btn svg {
    width: 1.125rem;
    height: 1.125rem;
}

/* Visual sections wrapper — hidden until scan completes */
#st-visuals {
    display: none;
}
#st-visuals.visible {
    display: block;
}

/* Lighthouse gauge grid */
.st-gauge-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}
@media (max-width: 640px) {
    .st-gauge-grid {
        grid-template-columns: 1fr;
    }
}

.st-gauge-column h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 1rem;
    text-align: center;
}

.st-gauges {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.st-gauge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.st-gauge-item canvas {
    width: 120px !important;
    height: 120px !important;
}
.st-gauge-label {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #94a3b8;
    text-align: center;
}

/* Timing chart */
#st-timing-section {
    margin-top: 1.5rem;
}
#st-timing-chart {
    max-height: 220px;
}

/* CWV cards grid */
.st-cwv-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    margin-top: 1.5rem;
}
@media (max-width: 768px) {
    .st-cwv-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 480px) {
    .st-cwv-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.st-cwv-card {
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    border: 1px solid;
}
.st-cwv-card .st-cwv-value {
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1;
}
.st-cwv-card .st-cwv-name {
    font-size: 0.7rem;
    margin-top: 0.5rem;
    opacity: 0.8;
}
.st-cwv-card .st-cwv-full {
    font-size: 0.625rem;
    margin-top: 0.15rem;
    opacity: 0.55;
}

/* CWV color variants */
.st-cwv-good {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}
.st-cwv-needs-improvement {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}
.st-cwv-poor {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* Section card (reusable) */
.st-section {
    background: #111827;
    border: 1px solid #1e293b;
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.st-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 1rem;
}

/* PDF loading spinner */
.st-pdf-btn .st-spinner {
    display: none;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: st-spin 0.6s linear infinite;
}
.st-pdf-btn.loading .st-spinner { display: inline-block; }
.st-pdf-btn.loading svg { display: none; }

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