/* retoor <retoor@molodetz.nl> */

.tools-page {
    max-width: 920px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg) var(--space-2xl);
}

.seo-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: var(--space-xl);
    align-items: start;
}

.seo-main {
    min-width: 0;
}

.seo-side-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.seo-side-list li {
    padding-left: var(--space-md);
    position: relative;
}

.seo-side-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

.seo-form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.tools-header h1,
.seo-header h1 {
    font-size: 1.75rem;
    margin: 0 0 0.5rem;
}

.tools-header p,
.seo-header p {
    color: var(--text-secondary);
    margin: 0 0 1.5rem;
    max-width: 60ch;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.tool-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
}

.tool-card:hover {
    border-color: var(--accent);
}

.tool-card-icon { font-size: 1.5rem; }
.tool-card-name { font-weight: 600; color: var(--text-primary); }
.tool-card-desc { font-size: 0.8125rem; color: var(--text-secondary); }

.seo-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.seo-input,
.seo-select {
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9375rem;
}

.seo-input[type="url"] { flex: 1 1 280px; }
.seo-input-num { width: 5rem; }

.seo-pages {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.seo-pages[hidden] {
    display: none;
}

.seo-run-btn { flex-shrink: 0; }

.seo-form-error {
    margin: 0.625rem 0 0;
    color: var(--danger);
    font-size: 0.875rem;
}

.seo-live {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.seo-live-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.625rem;
    font-size: 0.875rem;
}

.seo-live-status { font-weight: 600; color: var(--text-primary); }
.seo-live-count { color: var(--text-muted); }

.seo-progress {
    height: 6px;
    border-radius: 3px;
    background: var(--bg-secondary);
    overflow: hidden;
}

.seo-progress-bar {
    height: 100%;
    width: 0;
    background: var(--accent);
    transition: width 0.3s ease;
}

.seo-log {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    max-height: 200px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.seo-log li {
    padding: 0.125rem 0;
    border-bottom: 1px solid var(--border);
}

.seo-score-card {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    margin-bottom: 1.25rem;
}

.seo-gauge {
    flex-shrink: 0;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 3px solid var(--accent);
}

.seo-gauge-score { font-size: 1.75rem; font-weight: 700; color: var(--text-primary); line-height: 1; }
.seo-gauge-grade { font-size: 0.875rem; font-weight: 600; color: var(--text-muted); }

.seo-grade-a { border-color: var(--success); }
.seo-grade-b { border-color: var(--success); }
.seo-grade-c { border-color: var(--warning); }
.seo-grade-d { border-color: var(--warning); }
.seo-grade-f { border-color: var(--danger); }

.seo-score-meta h2 { margin: 0 0 0.5rem; font-size: 1.0625rem; word-break: break-all; }
.seo-report-sub { color: var(--text-muted); font-size: 0.8125rem; margin: 0.375rem 0 0; }

.seo-counts { display: flex; flex-wrap: wrap; gap: 0.375rem; }

.seo-chip {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    border: 1px solid var(--border);
}

.seo-chip-pass { color: var(--success); }
.seo-chip-warn { color: var(--warning); }
.seo-chip-fail { color: var(--danger); }
.seo-chip-info { color: var(--text-muted); }

.seo-report-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--accent);
}

.seo-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.seo-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-card);
    font-size: 0.8125rem;
}

.seo-cat-name { color: var(--text-secondary); }
.seo-cat-score { font-weight: 700; color: var(--text-primary); }

.seo-check-group { margin-bottom: 1.5rem; }
.seo-check-group h2 { font-size: 1rem; margin: 0 0 0.625rem; text-transform: capitalize; }

.seo-check {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border);
    border-left-width: 3px;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    background: var(--bg-card);
}

.seo-check-pass { border-left-color: var(--success); }
.seo-check-warn { border-left-color: var(--warning); }
.seo-check-fail { border-left-color: var(--danger); }
.seo-check-info { border-left-color: var(--text-muted); }
.seo-check-skip { border-left-color: var(--border); }

.seo-check-status {
    flex-shrink: 0;
    text-transform: uppercase;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.1875rem 0.375rem;
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.seo-check-body { display: flex; flex-direction: column; gap: 0.1875rem; flex: 1; }
.seo-check-title { font-weight: 600; color: var(--text-primary); font-size: 0.875rem; }
.seo-check-url { font-weight: 400; color: var(--text-muted); font-size: 0.75rem; word-break: break-all; }
.seo-check-value { font-size: 0.8125rem; color: var(--text-secondary); }
.seo-check-rec { font-size: 0.8125rem; color: var(--accent); }

.seo-check-severity {
    flex-shrink: 0;
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.seo-sev-critical { color: var(--danger); }
.seo-sev-high { color: var(--warning); }

.seo-empty {
    padding: 1.5rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
}

.seo-report-target { color: var(--text-muted); word-break: break-all; }

@media (max-width: 1024px) {
    .seo-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .seo-form-card { padding: var(--space-lg); }
    .seo-form-row { flex-direction: column; align-items: stretch; }
    .seo-input[type="url"] { flex: 1 1 auto; }
    .seo-pages { justify-content: space-between; }
    .seo-run-btn { width: 100%; }
    .seo-score-card { flex-direction: column; align-items: flex-start; }
}
