/* Patent Tool — Agentic AI Systems light theme (navy/blue).
   Re-themed from the original dark IDF Evaluator stylesheet; all selectors
   preserved so idf.js renders unchanged. — Opus 2026-09-19 */

:root{
  --navy:#0f1c3f; --blue:#2563eb; --blue-dk:#1d4ed8; --blue-soft:#e7edfb;
  --bg:#f7f9fc; --surface:#ffffff; --panel:#eef2f9; --border:#d7dee8;
  --ink:#0d1117; --muted:#5b6472; --faint:#8a94a6;
  --green:#1e8449; --green-lite:#e6f6ec; --amber:#b45309; --amber-lite:#fef3c7; --red:#b91c1c; --red-lite:#fbeaea;
}
* { box-sizing: border-box; }
body {
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 32px 16px 64px;
}

.idf-wrap { max-width: 860px; margin: 0 auto; padding-top: 20px; }
.idf-header { text-align: center; margin-bottom: 24px; }
.idf-header .kicker { color: var(--blue); font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 8px; }
.idf-header h1 { font-size: 2rem; font-weight: 800; color: var(--navy); margin: 0 0 4px; letter-spacing: -.01em; }
.idf-role { color: var(--blue); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 10px; }
.idf-header p { color: var(--muted); font-size: 0.95rem; margin: 0 auto; max-width: 620px; }

.idf-form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(15,28,63,.04);
}
.idf-form-card textarea {
    width: 100%;
    min-height: 180px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--ink);
    font-family: inherit;
    font-size: 0.94rem;
    line-height: 1.6;
    padding: 14px;
    resize: vertical;
}
.idf-form-card textarea:focus { outline: none; border-color: var(--blue); }
.idf-form-card textarea::placeholder { color: var(--faint); }
.idf-submit-btn {
    margin-top: 12px;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, transform .15s;
}
.idf-submit-btn:hover { background: var(--blue-dk); transform: translateY(-1px); }
.idf-submit-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.idf-form-error { color: var(--red); font-size: 0.85rem; margin-top: 8px; }

#idfResults { display: flex; flex-direction: column; gap: 16px; }

/* ── progress card, lens tabs, summary, score bars, patent list ── */
.idf-result li { margin-bottom: 4px; }
.idf-result code {
    background: var(--panel); border-radius: 4px; padding: 1px 5px;
    font-size: 12px; font-family: 'Fira Code', 'Consolas', monospace; color: #0369a1;
}
.idf-result .code-block { position: relative; margin: 8px 0; }
.idf-result .code-block pre { background: #0d1b2a; border-radius: 8px; padding: 32px 12px 10px; overflow-x: auto; margin: 0; }
.idf-result pre { background: #0d1b2a; border-radius: 8px; padding: 10px 12px; overflow-x: auto; margin: 8px 0; }
.idf-result pre code { background: none; padding: 0; font-size: 12px; color: #7dd3fc; }
.code-copy {
    position: absolute; top: 6px; right: 8px;
    background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25); border-radius: 5px;
    color: #cbd5e1; font-size: 11px; font-family: inherit; padding: 3px 10px; cursor: pointer; transition: all 0.2s;
}
.code-copy:hover { background: rgba(255,255,255,0.24); color: #fff; }
.code-copy.copied { color: #34d399; border-color: rgba(16,185,129,0.5); background: rgba(16,185,129,0.15); }
.idf-result hr { border: none; border-top: 1px solid var(--border); margin: 8px 0; }
a.patent-link { color: var(--blue); text-decoration: none; border-bottom: 1px dashed rgba(37,99,235,0.5); font-family: monospace; font-size: 0.95em; }
a.patent-link:hover { color: var(--blue-dk); border-bottom-style: solid; }

.idf-lens-response {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15,28,63,.04);
}
.lens-tab-bar { display: flex; gap: 4px; padding: 8px 8px 0; background: var(--panel); flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.lens-tab { background: transparent; border: 1px solid var(--border); border-bottom: none; color: var(--muted); font-size: 12px; padding: 5px 14px; border-radius: 6px 6px 0 0; cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.lens-tab:hover { color: var(--blue); border-color: var(--blue); }
.lens-tab.active { background: var(--blue-soft); color: var(--blue-dk); border-color: var(--blue); }
.lens-panel { display: none; padding: 16px; overflow: auto; color: var(--ink); }
.lens-panel.active { display: block; }
.lens-panel p, .lens-panel li { color: var(--ink); }
.idf-summary-tab { font-weight: 700; color: var(--blue) !important; }
.idf-summary-tab.active { background: var(--blue-soft) !important; color: var(--blue-dk) !important; }

.idf-progress-card { background: var(--surface); border: 1px solid var(--blue); border-radius: 12px; padding: 16px; box-shadow: 0 1px 3px rgba(15,28,63,.04); }
.idf-progress-card.idf-error { border-color: var(--red); }
.idf-progress-title { font-size: 13px; font-weight: 700; color: var(--blue-dk); margin-bottom: 14px; }
.idf-progress-card.idf-error .idf-progress-title { color: var(--red); }
.idf-stages { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.idf-stage { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.idf-stage-dot { width: 10px; height: 10px; border-radius: 50%; background: #dfe5ee; border: 1.5px solid #cbd3df; flex-shrink: 0; transition: all 0.3s; }
.idf-stage.done .idf-stage-dot  { background: #10b981; border-color: #10b981; }
.idf-stage.done .idf-stage-label { color: var(--faint); text-decoration: line-through; }
.idf-stage.active .idf-stage-dot { background: transparent; border-color: var(--blue); animation: idf-spin 1s linear infinite; }
.idf-stage.active .idf-stage-label { color: var(--blue-dk); font-weight: 600; }
.idf-stage.pending .idf-stage-label { color: var(--faint); }
.idf-progress-hint { font-size: 11px; color: var(--faint); font-style: italic; }
@keyframes idf-spin { 0% { box-shadow: 0 -4px 0 0 var(--blue); } 25% { box-shadow: 4px 0 0 0 var(--blue); } 50% { box-shadow: 0 4px 0 0 var(--blue); } 75% { box-shadow: -4px 0 0 0 var(--blue); } 100% { box-shadow: 0 -4px 0 0 var(--blue); } }

.idf-rec-card { border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; border: 1px solid; }
.idf-rec-proceed  { background: var(--green-lite); border-color: #b8e0c4; }
.idf-rec-caution  { background: var(--amber-lite); border-color: #f0dfa8; }
.idf-rec-stop     { background: var(--red-lite);  border-color: #f0c4c4; }
.idf-rec-header   { font-size: 14px; font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.idf-rec-proceed .idf-rec-header  { color: var(--green); }
.idf-rec-caution  .idf-rec-header { color: var(--amber); }
.idf-rec-stop     .idf-rec-header { color: var(--red); }
.idf-rec-confidence { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.idf-rec-explanation { font-size: 12px; color: var(--ink); line-height: 1.6; margin-top: 4px; }

.idf-scores-title  { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.idf-scores-note   { font-size: 10px; font-weight: 400; color: var(--faint); text-transform: none; letter-spacing: 0; }
.idf-score-bars    { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.idf-score-row     { display: grid; grid-template-columns: 120px 1fr 36px; align-items: center; gap: 8px; flex-wrap: wrap; }
.idf-score-label   { font-size: 12px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idf-score-track   { height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.idf-score-fill    { height: 100%; border-radius: 4px; transition: width 0.6s ease; }
.idf-bar-good      { background: linear-gradient(90deg, #10b981, #34d399); }
.idf-bar-mid       { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.idf-bar-bad       { background: linear-gradient(90deg, #ef4444, #f87171); }
.idf-score-pct     { font-size: 11px; color: var(--muted); text-align: right; }
.idf-score-sublabel { font-size: 10px; color: var(--faint); grid-column: 2 / 4; margin-top: -4px; }

.idf-section-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 14px 0 6px; border-top: 1px solid var(--border); padding-top: 12px; }

.idf-patent-list   { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 5px; }
.idf-patent-list li { font-size: 12px; color: var(--ink); display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.idf-patent-list a  { color: var(--blue); text-decoration: none; }
.idf-patent-list a:hover { text-decoration: underline; }
.idf-threat-high   { background: var(--red-lite); color: var(--red); border: 1px solid #f0c4c4; border-radius: 3px; padding: 1px 5px; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.idf-threat-mid    { background: var(--amber-lite); color: var(--amber); border: 1px solid #f0dfa8; border-radius: 3px; padding: 1px 5px; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.idf-threat-ref    { background: var(--blue-soft); color: var(--blue-dk); border: 1px solid #cddaf7; border-radius: 3px; padding: 1px 5px; font-size: 10px; font-weight: 700; flex-shrink: 0; }

.idf-pub-list      { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 5px; }
.idf-pub-list li   { font-size: 12px; color: var(--ink); }
.idf-pub-list a    { color: var(--blue); text-decoration: none; }
.idf-pub-list a:hover { text-decoration: underline; }

/* Modal for legal warning */
.idf-modal {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
}
.idf-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(15,28,63,0.5);
}
.idf-modal-content {
    position: relative; z-index: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    max-width: 520px;
    width: 90%;
    box-shadow: 0 24px 64px rgba(15,28,63,0.28);
    color: var(--ink);
}

/* Rewrite patent card */
#idfRewriteCard h3 { font-size: 14px; font-weight: 700; color: var(--navy); }
#idfRewriteCard select { font-size: 13px; }
#idfRewriteCard option { background: var(--surface); color: var(--ink); }

/* Rewrite status display */
#idfRewriteStatus pre {
    background: #0d1b2a;
    border-radius: 8px;
    padding: 12px;
    overflow-x: auto;
    white-space: pre-wrap;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
    color: #7dd3fc;
    max-height: 400px;
    margin: 0;
}
