/* AI Optimizer v1.6.0 — Frontend Entity Widget & Knowledge Graph */

/* ── Entity Widget (post page) ─────────────────────────────────────────────── */
.ai-opt-entity-widget {
    margin: 32px 0;
    padding: 20px 24px;
    background: #f8f9fa;
    border-left: 3px solid #0073aa;
    border-radius: 0 6px 6px 0;
    font-size: 14px;
    line-height: 1.6;
}

.ai-opt-entity-widget__label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #646970;
    margin-bottom: 10px;
}

.ai-opt-entity-widget__primary {
    font-weight: 600;
    color: #1d2327;
    font-size: 15px;
    margin-bottom: 10px;
    display: block;
}

.ai-opt-entity-widget__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.ai-opt-entity-tag {
    display: inline-block;
    padding: 3px 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 100px;
    font-size: 12px;
    color: #2271b1;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s;
}

.ai-opt-entity-tag:hover {
    border-color: #2271b1;
    color: #135e96;
}

.ai-opt-entity-widget__related {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e5e5e5;
}

.ai-opt-entity-widget__related-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #646970;
    display: block;
    margin-bottom: 8px;
}

.ai-opt-entity-widget__related-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ai-opt-entity-widget__related-links a {
    font-size: 13px;
    color: #2271b1;
    text-decoration: none;
}

.ai-opt-entity-widget__related-links a:hover {
    text-decoration: underline;
}

/* ── Public Knowledge Graph page ───────────────────────────────────────────── */
.ai-opt-kg-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ai-opt-kg-page h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1d2327;
    margin-bottom: 8px;
}

.ai-opt-kg-page__meta {
    font-size: 13px;
    color: #646970;
    margin-bottom: 32px;
}

.ai-opt-kg-graph-container {
    width: 100%;
    height: 480px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: #fafafa;
    margin-bottom: 32px;
    overflow: hidden;
    position: relative;
}

.ai-opt-kg-graph-container svg {
    width: 100%;
    height: 100%;
}

.ai-opt-kg-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.ai-opt-kg-post-card {
    padding: 16px 18px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    text-decoration: none;
    display: block;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ai-opt-kg-post-card:hover {
    border-color: #2271b1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ai-opt-kg-post-card__role {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #646970;
    margin-bottom: 6px;
    display: block;
}

.ai-opt-kg-post-card__role--primary { color: #00a32a; }
.ai-opt-kg-post-card__role--secondary { color: #d4a017; }

.ai-opt-kg-post-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: #1d2327;
    margin: 0;
    line-height: 1.4;
}

/* ── Entity cloud (homepage widget) ────────────────────────────────────────── */
.ai-opt-entity-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 24px 0;
}

.ai-opt-entity-cloud a {
    display: inline-block;
    padding: 5px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 100px;
    font-size: 13px;
    color: #2271b1;
    text-decoration: none;
    transition: all 0.15s;
}

.ai-opt-entity-cloud a:hover,
.ai-opt-entity-cloud a[data-size="large"] {
    background: #f0f6fc;
    border-color: #2271b1;
    font-weight: 600;
}

@media (max-width: 600px) {
    .ai-opt-entity-widget { padding: 16px; }
    .ai-opt-kg-posts-grid { grid-template-columns: 1fr; }
    .ai-opt-kg-graph-container { height: 320px; }
}

/* ── GEO Q&A Block ─────────────────────────────────────────────────────────── */
.ai-opt-geo-block {
    margin: 36px 0 24px;
    padding: 24px 28px;
    background: #f0f7ff;
    border-left: 3px solid #2271b1;
    border-radius: 0 6px 6px 0;
    font-size: 14px;
}

.ai-opt-geo-block__title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #646970;
    margin: 0 0 18px;
}

.ai-opt-geo-item {
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #dce3f0;
}

.ai-opt-geo-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.ai-opt-geo-item__q {
    font-size: 14px;
    color: #1d2327;
    margin: 0 0 6px;
    line-height: 1.5;
}

.ai-opt-geo-item__a {
    font-size: 13px;
    color: #50575e;
    margin: 0;
    line-height: 1.7;
}
