/* =========================
   Mindset Digital · Content Citability Scorer
   ========================= */

.mdt-citability-scorer {
  background: var(--md-background); color: var(--md-foreground);
  min-height: 100vh; display: grid; place-items: start center; padding: 2rem;
}
@supports (height:1dvh) { .mdt-citability-scorer { min-height: 100dvh; } }
.mdt-citability-scorer .md-card { width: min(900px, 96vw); background: var(--md-surface,#fff); }

/* Header */
.header-row { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:.75rem; }
.theme-toggle { display:inline-flex; align-items:center; gap:.5rem; padding:.35rem .65rem; border:1px solid var(--md-border,rgba(0,0,0,.12)); border-radius:999px; background:transparent; color:var(--md-foreground); cursor:pointer; line-height:1; }
.theme-toggle:hover { background:rgba(0,0,0,.04); }
[data-theme="dark"] .theme-toggle:hover { background:rgba(255,255,255,.06); }
.theme-toggle svg { width:18px; height:18px; display:block; }
#iconMoon { display:none; } [data-theme="dark"] #iconSun { display:none; } [data-theme="dark"] #iconMoon { display:block; }
@media (max-width:480px) { .theme-toggle__label { display:none; } }

/* Form */
.form-grid { display:grid; gap:.85rem; margin:1rem 0; }
.form-group { display:flex; flex-direction:column; gap:.25rem; }
.form-label { font-weight:600; font-size:.9rem; color:var(--md-foreground); }
.form-grid textarea {
  font-size:.9rem; padding:.65rem .75rem; border:1px solid var(--md-border);
  border-radius:6px; background:var(--md-surface); color:var(--md-foreground);
  width:100%; box-sizing:border-box; font-family:inherit; resize:vertical; min-height:140px;
}
.form-grid textarea:focus { border-color:var(--md-color-primary); }

/* Actions */
.actions { display:flex; gap:.65rem; flex-wrap:wrap; margin:1rem 0; align-items:center; position:relative; }
.md-btn { background:var(--md-color-primary,#1063ff); color:var(--md-color-primary-contrast,#fff); }
.md-btn--secondary { background:var(--md-color-secondary,#f0b138); color:var(--md-color-secondary-contrast,#090a08); }

/* Help */
.icon-btn { display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; padding:0; border:1px solid var(--md-border); border-radius:50%; background:var(--md-surface); color:var(--md-foreground); cursor:pointer; }
.icon-btn svg { width:18px; height:18px; }
.help-popover { position:absolute; right:0; top:100%; margin-top:.5rem; z-index:1000; width:min(560px,86vw); background:var(--md-surface); color:var(--md-foreground); border:1px solid var(--md-border); border-radius:var(--md-radius); box-shadow:0 10px 30px rgba(0,0,0,.12); padding:.85rem 1rem; display:none; }
.help-popover.is-open { display:block; }
.help-popover ul { padding-left:1.2rem; margin:.5rem 0; }
.help-popover li { margin-bottom:.4rem; }
.help-popover code { background:rgba(0,0,0,.06); padding:.1rem .3rem; border-radius:3px; font-size:.85em; }
[data-theme="dark"] .help-popover code { background:rgba(255,255,255,.08); }

/* Results */
.results-section { margin-top:1.25rem; }
.results-heading { font-size:1rem; font-weight:700; margin-bottom:1rem; color:var(--md-foreground); }

/* Score ring */
.score-display { display:flex; align-items:center; gap:1.5rem; margin-bottom:1.5rem; }
.score-ring { position:relative; width:120px; height:120px; flex-shrink:0; }
.score-ring svg { width:100%; height:100%; }
.score-value { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:2rem; font-weight:800; color:var(--md-foreground); }
.score-label { font-size:1rem; color:var(--md-foreground); }
.score-label strong { display:block; font-size:1.2rem; margin-bottom:.25rem; }

/* Ring colors */
.score-ring--green #score-arc { stroke:#22c55e; }
.score-ring--orange #score-arc { stroke:#f59e0b; }
.score-ring--red #score-arc { stroke:#ef4444; }
[data-theme="dark"] .score-ring--green #score-arc { stroke:#4ade80; }
[data-theme="dark"] .score-ring--orange #score-arc { stroke:#fbbf24; }
[data-theme="dark"] .score-ring--red #score-arc { stroke:#f87171; }

/* Categories */
.categories-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:.65rem; margin-bottom:1.25rem; }

.cat-card {
  border:1px solid var(--md-border); border-radius:var(--md-radius,8px);
  padding:.75rem 1rem; background:var(--md-surface);
}
.cat-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:.45rem; }
.cat-name { font-weight:700; font-size:.85rem; color:var(--md-foreground); }
.cat-score { font-weight:800; font-size:.95rem; }
.cat-score--green { color:#22c55e; }
.cat-score--orange { color:#f59e0b; }
.cat-score--red { color:#ef4444; }
[data-theme="dark"] .cat-score--green { color:#4ade80; }
[data-theme="dark"] .cat-score--orange { color:#fbbf24; }
[data-theme="dark"] .cat-score--red { color:#f87171; }

.cat-bar { height:6px; border-radius:3px; background:var(--md-border); overflow:hidden; }
.cat-fill { height:100%; border-radius:3px; transition:width .4s ease; }
.cat-fill--green { background:#22c55e; }
.cat-fill--orange { background:#f59e0b; }
.cat-fill--red { background:#ef4444; }

.cat-detail { font-size:.78rem; color:var(--md-foreground); opacity:.6; margin-top:.35rem; }

/* Quotable highlight */
.quotable-section { margin-top: 1.25rem; }
.md-btn--small { font-size: .82rem; padding: .35rem .7rem; }
.highlight-block { margin-top: .75rem; }
.highlight-heading { font-size: .9rem; font-weight: 600; margin-bottom: .5rem; color: var(--md-foreground); }
.highlighted-text {
  font-size: .88rem; line-height: 1.7; color: var(--md-foreground);
  padding: .75rem 1rem; border: 1px solid var(--md-border);
  border-radius: var(--md-radius, 8px); background: var(--md-surface);
  max-height: 400px; overflow-y: auto;
}
.quotable {
  background: rgba(0, 201, 117, .12);
  border-radius: 3px;
  padding: 1px 3px;
  border-bottom: 2px solid rgba(0, 201, 117, .4);
}
[data-theme="dark"] .quotable {
  background: rgba(0, 201, 117, .15);
  border-bottom-color: rgba(0, 201, 117, .5);
}

/* Recommendations */
.recommendations-section { margin-top:1rem; }
.reco-heading { font-size:.95rem; font-weight:700; margin-bottom:.5rem; color:var(--md-foreground); }
.reco-list { padding-left:1.2rem; margin:0; }
.reco-list li { margin-bottom:.45rem; font-size:.88rem; color:var(--md-foreground); }
.reco-icon { margin-right:.3rem; }

/* Status */
.status-line { font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:.95rem; color:var(--md-foreground); display:inline-block; padding:.3rem .5rem; border-radius:6px; background:color-mix(in srgb,var(--md-surface) 85%,transparent); min-height:1.4em; }
.status-line::after { content:"▊"; margin-left:.3rem; opacity:.7; animation:blink 1s steps(2,end) infinite; }
@keyframes blink { 0%,50%{opacity:0} 50.01%,100%{opacity:1} }

/* A11y */
.skip-link { position:absolute; left:.5rem; top:-1000px; background:var(--md-foreground); color:var(--md-background); padding:.5rem .75rem; border-radius:6px; text-decoration:none; }
.skip-link:focus { top:.5rem; z-index:10; }
textarea:focus-visible,input:focus-visible,button:focus-visible,select:focus-visible { outline:3px solid var(--md-focus,#0a57ff); outline-offset:2px; }
:root { color-scheme:light dark; }
.sr-only { position:absolute; width:1px; height:1px; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); }
