/* ============================================================
   FORGE ATLAS · atlas-helper.css
   Premium operator-grade helper widget. All classes prefixed
   `fa-helper` or `fa-` to avoid collisions with host site.
   Sits bottom-LEFT to coexist with the site's Atlas AI bubble.
   ============================================================ */

.fa-helper {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 70;
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  color: #f5f5f7;
}

/* ---- ORB ---- */
.fa-helper-orb {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 28% 28%, #7eeaff 0%, #00b8cf 60%, #0a4f59 100%);
  border: 1.5px solid rgba(255,255,255,.20);
  box-shadow: 0 10px 30px rgba(126,234,255,.30), inset 0 1px 0 rgba(255,255,255,.30);
  display: grid; place-items: center;
  cursor: pointer;
  position: relative;
  color: #08080a;
  transition: transform 220ms cubic-bezier(.34,1.56,.64,1);
}
.fa-helper-orb:hover { transform: scale(1.08); }
.fa-helper-orb::before {
  content: "";
  position: absolute; inset: -6px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #7eeaff, #D4A843, #a78bfa, #7eeaff);
  z-index: -1; opacity: .45; filter: blur(6px);
  animation: faOrbSpin 9s linear infinite;
}
.fa-helper-orb-pulse {
  position: absolute; inset: -2px;
  border-radius: 50%;
  border: 1px solid #7eeaff; opacity: .4;
  animation: faOrbPulse 2.4s ease-out infinite;
}
@keyframes faOrbSpin  { to { transform: rotate(360deg); } }
@keyframes faOrbPulse { 0%,100% { transform: scale(1); opacity: .4; } 50% { transform: scale(1.18); opacity: 0; } }

/* ---- PANEL ---- */
.fa-helper-panel {
  position: absolute;
  bottom: 76px; left: 0;
  width: min(440px, calc(100vw - 48px));
  height: min(640px, calc(100vh - 160px));
  background: rgba(10, 10, 14, .96);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(126,234,255,.25);
  border-radius: 20px;
  box-shadow: 0 32px 80px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.04);
  display: flex; flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(.96); opacity: 0; pointer-events: none;
  transition: transform 320ms cubic-bezier(.34,1.56,.64,1), opacity 240ms ease;
}
.fa-helper-panel.open { transform: none; opacity: 1; pointer-events: auto; }

/* ---- HEAD ---- */
.fa-helper-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(126,234,255,.05), transparent);
}
.fa-helper-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #7eeaff, #00b8cf);
  display: grid; place-items: center;
  color: #08080a; font-weight: 600; font-size: 16px;
  font-family: 'Oswald', sans-serif;
}
.fa-helper-titles h4 {
  margin: 0; font-family: 'Oswald', sans-serif;
  font-size: 14px; letter-spacing: .08em;
  color: #f5f5f7; font-weight: 500;
}
.fa-helper-sub {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px; letter-spacing: .14em;
  color: #a1a1aa; text-transform: uppercase;
  display: flex; align-items: center; gap: 6px; margin-top: 3px;
}
.fa-helper-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #71717a;
  display: inline-block;
}
.fa-helper-dot.live {
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: faDotPulse 2s ease-in-out infinite;
}
@keyframes faDotPulse { 0%,100%{opacity:1} 50%{opacity:.5} }
.fa-helper-close {
  margin-left: auto;
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.10);
  background: transparent;
  color: #a1a1aa;
  cursor: pointer;
  font-size: 14px;
  display: grid; place-items: center;
  transition: all 200ms ease;
}
.fa-helper-close:hover { color: #f5f5f7; border-color: rgba(255,255,255,.20); }

/* ---- TABS ---- */
.fa-helper-tabs {
  display: flex;
  gap: 2px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  overflow-x: auto;
  scrollbar-width: none;
}
.fa-helper-tabs::-webkit-scrollbar { display: none; }
.fa-helper-tab {
  padding: 7px 12px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: #71717a;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 200ms ease;
  font-weight: 500;
}
.fa-helper-tab:hover { color: #f5f5f7; border-color: rgba(255,255,255,.10); }
.fa-helper-tab.active { color: #08080a; background: #7eeaff; }

/* ---- BODY ---- */
.fa-helper-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent;
}
.fa-helper-body::-webkit-scrollbar { width: 6px; }
.fa-helper-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 3px; }

.fa-help-lead { color: #a1a1aa; font-size: 13.5px; margin: 0 0 4px; line-height: 1.6; }
.fa-help-note { color: #71717a; font-size: 11.5px; margin: 8px 0 0; font-style: italic; }
.fa-h5 {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px; letter-spacing: .18em;
  color: #71717a; text-transform: uppercase;
  margin: 18px 0 10px; font-weight: 500;
}

/* ---- INPUTS ---- */
.fa-input {
  flex: 1;
  padding: 11px 13px;
  background: rgba(0,0,0,.40);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 6px;
  color: #f5f5f7;
  font-size: 13.5px;
  font-family: 'Inter', sans-serif;
  transition: border-color 200ms ease;
  width: 100%;
}
.fa-input:focus {
  border-color: #7eeaff;
  outline: none;
  background: rgba(0,0,0,.60);
}
.fa-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12.5px;
  line-height: 1.6;
}
select.fa-input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #7eeaff 50%), linear-gradient(135deg, #7eeaff 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}
.fa-row { display: flex; gap: 8px; align-items: stretch; }
.fa-stack { display: flex; flex-direction: column; gap: 12px; }
.fa-labeled { display: flex; flex-direction: column; gap: 6px; }
.fa-labeled-text {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px; letter-spacing: .18em;
  color: #71717a; text-transform: uppercase;
  font-weight: 500;
}

/* ---- BUTTONS ---- */
.fa-btn-primary {
  padding: 11px 18px;
  background: #7eeaff;
  color: #08080a;
  border: none; border-radius: 6px;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 200ms ease;
  white-space: nowrap;
}
.fa-btn-primary:hover { background: #a8f1ff; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(126,234,255,.30); }
.fa-btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.fa-btn-sm {
  padding: 5px 10px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 4px;
  color: #a1a1aa;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  cursor: pointer;
  transition: all 200ms ease;
}
.fa-btn-sm:hover { color: #7eeaff; border-color: #7eeaff; }

/* ---- CHECKS GRID ---- */
.fa-checks {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.fa-check-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px;
  cursor: pointer;
  background: rgba(0,0,0,.20);
  font-size: 12.5px; color: #d4d4d8;
  transition: border-color 200ms ease, background 200ms ease;
}
.fa-check-row:hover { border-color: rgba(255,255,255,.18); background: rgba(0,0,0,.40); }
.fa-check-row input { accent-color: #7eeaff; cursor: pointer; }

/* ---- RESULT ---- */
.fa-result {
  display: flex; flex-direction: column; gap: 12px;
  padding-top: 6px;
}
.fa-mode-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 10px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  font-weight: 500;
  align-self: flex-start;
}
.fa-mode-badge.live { color: #34d399; border: 1px solid rgba(52,211,153,.30); background: rgba(52,211,153,.06); }
.fa-mode-badge.fallback { color: #fbbf24; border: 1px solid rgba(251,191,36,.30); background: rgba(251,191,36,.06); }

.fa-summary {
  font-size: 13.5px;
  color: #d4d4d8;
  line-height: 1.6;
  margin: 0;
}
.fa-clean {
  padding: 14px 16px;
  border: 1px solid rgba(52,211,153,.30);
  background: rgba(52,211,153,.06);
  border-radius: 8px;
  color: #34d399;
  font-size: 13.5px;
  text-align: center;
  font-family: 'Oswald', sans-serif;
  letter-spacing: .04em;
}

.fa-score {
  display: flex; align-items: center; gap: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(126,234,255,.20);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(126,234,255,.06), rgba(212,168,67,.04));
}
.fa-score-num {
  font-family: 'Oswald', sans-serif;
  font-size: 44px; font-weight: 600;
  color: #7eeaff; line-height: 1;
  letter-spacing: -.02em;
}
.fa-score-meta { display: flex; flex-direction: column; gap: 4px; }
.fa-score-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px; letter-spacing: .14em;
  color: #d4d4d8; text-transform: uppercase;
}
.fa-score-path { font-size: 11px; color: #71717a; }

/* ---- VERDICT ---- */
.fa-verdict {
  padding: 14px 18px;
  border-radius: 8px;
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  letter-spacing: .04em;
  text-align: center;
}
.fa-verdict.ok { color: #34d399; border: 1px solid rgba(52,211,153,.30); background: rgba(52,211,153,.06); }
.fa-verdict.warn { color: #fbbf24; border: 1px solid rgba(251,191,36,.30); background: rgba(251,191,36,.06); }

/* ---- FINDINGS ---- */
.fa-findings, .fa-wins, .fa-suggest-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.fa-finding {
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.08);
  border-left-width: 3px;
  border-radius: 6px;
  background: rgba(255,255,255,.015);
}
.fa-finding-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 4px;
}
.fa-finding-what {
  font-size: 13px;
  color: #f5f5f7;
  line-height: 1.4;
}
.fa-finding-fix {
  font-size: 12.5px;
  color: #a1a1aa;
  line-height: 1.55;
  margin-top: 4px;
}
.fa-sev-tag {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
  white-space: nowrap;
}
.fa-sev-critical { border-left-color: #f87171; }
.fa-sev-critical .fa-sev-tag { color: #f87171; background: rgba(248,113,113,.10); }
.fa-sev-warning { border-left-color: #fbbf24; }
.fa-sev-warning .fa-sev-tag { color: #fbbf24; background: rgba(251,191,36,.10); }
.fa-sev-info { border-left-color: #7eeaff; }
.fa-sev-info .fa-sev-tag { color: #7eeaff; background: rgba(126,234,255,.10); }
.fa-sev-ok { border-left-color: #34d399; }
.fa-sev-ok .fa-sev-tag { color: #34d399; background: rgba(52,211,153,.10); }

.fa-wins li {
  padding: 8px 12px;
  background: rgba(52,211,153,.04);
  border: 1px solid rgba(52,211,153,.16);
  border-radius: 4px;
  font-size: 12.5px;
  color: #d4d4d8;
}
.fa-wins li::before { content: "✓ "; color: #34d399; font-weight: 600; }

.fa-suggest-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: rgba(0,0,0,.30);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 6px;
}
.fa-suggest-list code {
  flex: 1;
  font-size: 12px;
  color: #f5f5f7;
  background: transparent;
  padding: 0;
  word-break: break-word;
}

/* ---- CODE BLOCK ---- */
.fa-code {
  padding: 14px 16px;
  background: rgba(0,0,0,.50);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.65;
  color: #d4d4d8;
  overflow-x: auto;
  margin: 0;
  white-space: pre;
}
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* ---- SPINNER ---- */
.fa-spinner {
  display: flex; align-items: center; gap: 10px;
  padding: 16px;
  color: #a1a1aa;
  font-size: 13px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: .04em;
}
.fa-spin-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #7eeaff;
  animation: faSpin 1.2s ease-in-out infinite;
}
.fa-spin-dot:nth-child(2) { animation-delay: .15s; background: #D4A843; }
.fa-spin-dot:nth-child(3) { animation-delay: .30s; background: #a78bfa; }
.fa-spin-label { margin-left: 6px; }
@keyframes faSpin { 0%,80%,100% { transform: scale(.6); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

.fa-error {
  padding: 12px 14px;
  background: rgba(248,113,113,.08);
  border: 1px solid rgba(248,113,113,.25);
  border-radius: 6px;
  color: #f87171;
  font-size: 13px;
}

/* ---- FOOT ---- */
.fa-helper-foot-note {
  padding: 10px 16px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .04em;
  color: #71717a;
  border-top: 1px solid rgba(255,255,255,.06);
  background: rgba(0,0,0,.20);
  text-align: center;
}
.fa-helper-foot-note strong { color: #7eeaff; font-weight: 500; }
.fa-helper-foot-note a { color: #D4A843; text-decoration: none; }
.fa-helper-foot-note a:hover { text-decoration: underline; }

/* ---- MOBILE ---- */
@media (max-width: 520px) {
  .fa-helper { bottom: 16px; left: 16px; }
  .fa-helper-orb { width: 50px; height: 50px; }
  .fa-helper-panel {
    bottom: 70px; left: 0;
    width: calc(100vw - 32px);
    height: calc(100vh - 140px);
  }
  .fa-checks { grid-template-columns: 1fr; }
}

/* ---- REDUCED MOTION ---- */
@media (prefers-reduced-motion: reduce) {
  .fa-helper-orb::before, .fa-helper-orb-pulse, .fa-helper-dot.live, .fa-spin-dot {
    animation: none !important;
  }
  .fa-helper-panel { transition: opacity 100ms ease; transform: none; }
}
