/* ============================================================
   GEO SEO Widgets — Frontend Styles
   ============================================================ */

/* ── Shared ─────────────────────────────────────────────── */
.geo-faq-wrap, .geo-facts-box, .geo-toc-box, .geo-author-box {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    direction: rtl;
}

/* ════════════════════════════════════════════════════════════
   1. FAQ SCHEMA
   ════════════════════════════════════════════════════════════ */
.geo-faq-title {
    font-size: 1.4em;
    font-weight: 700;
    margin-bottom: 16px;
    color: #1a1a2e;
}

.geo-faq-item {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
    transition: box-shadow .2s;
}
.geo-faq-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,.07); }

.geo-faq-q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #f8f8ff;
    cursor: pointer;
    font-weight: 600;
    font-size: .97em;
    color: #333;
    border-right: 3px solid transparent;
    transition: all .2s;
    user-select: none;
    gap: 10px;
}
.geo-faq-q span { flex: 1; }
.geo-faq-q:hover { background: #f0edff; }
.geo-faq-item.open .geo-faq-q {
    color: #6c4bdb;
    border-right-color: #6c4bdb;
    background: #f0edff;
}
.geo-faq-icon {
    flex-shrink: 0;
    transition: transform .25s;
    color: #6c4bdb;
}
.geo-faq-item.open .geo-faq-icon { transform: rotate(180deg); }

.geo-faq-a { overflow: hidden; }
.geo-faq-a-inner {
    padding: 14px 18px 16px;
    font-size: .95em;
    color: #444;
    line-height: 1.7;
    border-top: 1px solid #eee;
}
.geo-faq-a-inner p:last-child { margin-bottom: 0; }

/* ════════════════════════════════════════════════════════════
   2. KEY FACTS BOX
   ════════════════════════════════════════════════════════════ */
.geo-facts-box {
    border-radius: 10px;
    padding: 20px 22px;
    margin-bottom: 4px;
}
.geo-facts-box--card {
    background: #fff;
    box-shadow: 0 2px 20px rgba(0,0,0,.09);
}
.geo-facts-box--bordered {
    background: transparent;
    border: 2px solid #6c4bdb;
}
.geo-facts-box--filled {
    background: #f0edff;
}
.geo-facts-box--minimal {
    background: transparent;
    padding: 0;
}

.geo-facts-title {
    font-size: 1em;
    font-weight: 700;
    color: #6c4bdb;
    margin-bottom: 16px;
    letter-spacing: .02em;
}

/* Grid layout */
.geo-facts-layout--grid .geo-facts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
/* List layout */
.geo-facts-layout--list .geo-facts-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.geo-fact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,.6);
    border-radius: 8px;
    padding: 12px 14px;
}
.geo-facts-box--minimal .geo-fact-item {
    padding: 8px 0;
    background: transparent;
    border-bottom: 1px solid #eee;
    border-radius: 0;
}

.geo-fact-icon-wrap {
    font-size: 1.3em;
    color: #6c4bdb;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}
.geo-fact-content {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.geo-fact-value {
    font-size: 1.2em;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.2;
}
.geo-fact-label {
    font-size: .8em;
    color: #6c4bdb;
    font-weight: 500;
}
.geo-facts-source {
    margin-top: 12px;
    font-size: .78em;
    color: #aaa;
    text-align: left;
}
.geo-facts-source a { color: #aaa; text-decoration: underline; }

/* ════════════════════════════════════════════════════════════
   3. TABLE OF CONTENTS
   ════════════════════════════════════════════════════════════ */
.geo-toc-box {
    background: #f9f7ff;
    border-right: 4px solid #6c4bdb;
    border-radius: 8px;
    padding: 16px 18px;
    margin-bottom: 4px;
}
.geo-toc-box.geo-toc--sticky {
    position: sticky;
    top: 20px;
    max-height: 80vh;
    overflow-y: auto;
}
.geo-toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.geo-toc-title {
    font-weight: 700;
    font-size: .97em;
    color: #6c4bdb;
}
.geo-toc-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    padding: 2px;
    line-height: 1;
}
.geo-toc-toggle svg { transition: transform .2s; }
.geo-toc-toggle.collapsed svg { transform: rotate(-90deg); }

.geo-toc { direction: rtl; }
.geo-toc ol, .geo-toc ul { margin: 0; padding: 0; list-style: none; }
.geo-toc li { margin: 0; }
.geo-toc a {
    display: block;
    padding: 4px 0;
    font-size: .9em;
    color: #444;
    text-decoration: none;
    line-height: 1.4;
    transition: color .15s;
    border-bottom: none;
}
.geo-toc a:hover { color: #6c4bdb; }
/* H3 indent */
.geo-toc .geo-toc-h3 a { padding-right: 14px; font-size: .85em; color: #666; }
/* H4 indent */
.geo-toc .geo-toc-h4 a { padding-right: 28px; font-size: .82em; color: #888; }

.geo-toc-numbered { counter-reset: toc-h2; }
.geo-toc-numbered .geo-toc-h2 { counter-reset: toc-h3; counter-increment: toc-h2; }
.geo-toc-numbered .geo-toc-h2 a::before { content: counter(toc-h2) ". "; color: #6c4bdb; font-weight: 600; }
.geo-toc-numbered .geo-toc-h3 { counter-increment: toc-h3; }
.geo-toc-numbered .geo-toc-h3 a::before { content: counter(toc-h2) "." counter(toc-h3) " "; color: #999; }

.geo-toc-loading { font-size: .85em; color: #aaa; }

/* ════════════════════════════════════════════════════════════
   4. AUTHOR BOX
   ════════════════════════════════════════════════════════════ */
.geo-author-box {
    background: #fff;
    border-radius: 10px;
    border-right: 4px solid #6c4bdb;
    box-shadow: 0 2px 16px rgba(0,0,0,.07);
    padding: 20px 22px;
}

/* Horizontal */
.geo-author-box--horizontal {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}
/* Vertical */
.geo-author-box--vertical {
    text-align: center;
}
.geo-author-box--vertical .geo-author-img-wrap { margin: 0 auto 14px; }
/* Compact */
.geo-author-box--compact {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
}
.geo-author-box--compact .geo-author-bio { display: none; }
.geo-author-box--compact .geo-author-creds { display: none; }

.geo-author-img-wrap { flex-shrink: 0; }
.geo-author-img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 3px solid #f0edff;
}

.geo-author-content { flex: 1; }

.geo-author-name {
    font-size: 1.1em;
    font-weight: 700;
    color: #6c4bdb;
    margin-bottom: 3px;
}
.geo-author-role {
    font-size: .85em;
    color: #888;
    margin-bottom: 9px;
    font-style: italic;
}
.geo-author-bio {
    font-size: .9em;
    color: #444;
    line-height: 1.65;
    margin-bottom: 10px;
}
.geo-author-creds {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.geo-author-cred {
    font-size: .78em;
    background: #f0edff;
    color: #5a3db5;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
    position: relative;
}

.geo-author-social {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.geo-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0edff;
    color: #6c4bdb;
    transition: background .15s, color .15s;
    text-decoration: none;
}
.geo-social-link:hover { background: #6c4bdb; color: #fff; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
    .geo-facts-layout--grid .geo-facts-grid { grid-template-columns: 1fr; }
    .geo-author-box--horizontal { flex-direction: column; align-items: center; text-align: center; }
    .geo-author-creds { justify-content: center; }
    .geo-author-social { justify-content: center; }
}

/* ════════════════════════════════════════════════════════════
   5. GEO SCANNER WIDGET (editor-only)
   ════════════════════════════════════════════════════════════ */
.geo-scanner-widget {
    border: 2px dashed #c5bcf7;
    border-radius: 10px;
    background: #faf9ff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    direction: rtl;
    font-size: 13px;
    overflow: hidden;
}

.gsw-header {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #1a1a2e;
    color: #e8e8f0;
    padding: 10px 14px;
    font-weight: 600;
    font-size: 13px;
}
.gsw-logo  { color: #7F77DD; font-size: 16px; }
.gsw-badge {
    margin-right: auto;
    font-size: 10px;
    background: rgba(127,119,221,.25);
    color: #a89fea;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 400;
}

.gsw-body { padding: 14px; }

.gsw-row    { margin-bottom: 9px; }
.gsw-label  { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #999; margin-bottom: 4px; }

.gsw-autocomplete-wrap { position: relative; }
.gsw-input {
    width: 100%;
    padding: 7px 10px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    direction: rtl;
    box-sizing: border-box;
    color: #222;
}
.gsw-input:focus { outline: none; border-color: #7F77DD; }

.gsw-suggestions {
    position: absolute; top: 100%; right: 0; left: 0;
    background: #fff; border: 1px solid #ddd; border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    z-index: 9999; max-height: 160px; overflow-y: auto;
}
.gsw-sug-item { padding: 7px 10px; cursor: pointer; font-size: 12px; color: #333; }
.gsw-sug-item:hover { background: #f0eeff; color: #534AB7; }

.gsw-btn {
    width: 100%; padding: 9px;
    background: #1a1a2e; color: #e8e8f0;
    border: none; border-radius: 6px;
    font-size: 13px; font-weight: 500;
    cursor: pointer; margin-bottom: 12px;
    transition: opacity .15s;
}
.gsw-btn:hover { opacity: .82; }
.gsw-btn:disabled { opacity: .45; cursor: not-allowed; }

/* matched */
.gsw-matched {
    font-size: 11px; background: #eeeeff; color: #534AB7;
    border-radius: 4px; padding: 4px 9px; margin-bottom: 10px; font-weight: 500;
}

/* Score */
.gsw-score-row { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.gsw-circle {
    width: 52px; height: 52px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; flex-shrink: 0;
    background: #eee; color: #555;
    transition: background .3s, color .3s;
}
.gsw-circle.good { background: #EAF3DE; color: #3B6D11; }
.gsw-circle.mid  { background: #FAEEDA; color: #854F0B; }
.gsw-circle.bad  { background: #FCEBEB; color: #A32D2D; }
.gsw-score-right { flex: 1; }
.gsw-score-lbl { font-size: 12px; font-weight: 600; color: #333; margin-bottom: 5px; }
.gsw-bar-bg { height: 4px; background: #e8e8e8; border-radius: 2px; overflow: hidden; }
.gsw-bar    { height: 100%; border-radius: 2px; transition: width .5s; width: 0; }

/* Stats */
.gsw-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px; margin-bottom: 10px; }
.gsw-stat  { background: #f5f5f5; border-radius: 5px; padding: 7px; text-align: center; font-size: 10px; color: #888; }
.gsw-stat-n { display: block; font-size: 18px; font-weight: 700; color: #333; }
.gsw-stat-n.gsw-green { color: #3B6D11; }
.gsw-stat-n.gsw-red   { color: #A32D2D; }

/* Filters */
.gsw-filters { display: flex; gap: 5px; margin-bottom: 8px; }
.gsw-filter {
    flex: 1; padding: 4px 0; font-size: 11px; font-weight: 600;
    border: 1px solid #ddd; border-radius: 4px;
    background: #f5f5f5; color: #666; cursor: pointer;
}
.gsw-filter.active { background: #1a1a2e; color: #e8e8f0; border-color: #1a1a2e; }

/* Terms */
.gsw-sec-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #bbb; margin-bottom: 6px; }
.gsw-terms { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 4px; }
.gsw-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; border-radius: 20px;
    font-size: 11px; border: 1px solid; direction: rtl;
}
.gsw-chip--found   { background: #EAF3DE; color: #3B6D11; border-color: #97C459; }
.gsw-chip--miss    { background: #FCEBEB; color: #A32D2D; border-color: #F09595; }
.gsw-chip--partial { background: #FAEEDA; color: #854F0B; border-color: #EF9F27; }
.gsw-chip-i { font-size: 10px; }
.gsw-chip-c { font-size: 9px; background: rgba(0,0,0,.07); border-radius: 3px; padding: 1px 4px; margin-right: 2px; }

/* Tip */
.gsw-tip {
    background: #f5f5f5; border-right: 3px solid #7F77DD;
    border-radius: 0 5px 5px 0; padding: 8px 11px;
    font-size: 12px; color: #444; line-height: 1.65;
}

/* States */
.gsw-empty { text-align: center; padding: 20px 14px; color: #bbb; font-size: 12px; line-height: 2; }
.gsw-error { background: #FCEBEB; color: #A32D2D; border-radius: 5px; padding: 8px 10px; font-size: 12px; }
