/* AKORE Free 3D Analyzer — standalone, self-contained styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #0e0f13;
  --surface: #161821;
  --surface-2: #1d2030;
  --border: #262a3a;
  --text: #e8eaed;
  --muted: #9aa0ad;
  --primary: #5b8cff;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
}
html, body { height: 100%; }
/* The [hidden] attribute must beat explicit display rules (.loading/.results
   use display:flex, which would otherwise override [hidden] and stay visible). */
[hidden] { display: none !important; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* Header */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; line-height: 0; }
.brand-logo {
  height: 30px; width: auto; display: block;
  /* logo asset is black-on-transparent → force pure white for the dark header */
  filter: brightness(0) invert(1);
}
@media (max-width: 560px) { .brand-logo { height: 24px; } }
.top-cta {
  color: var(--primary); text-decoration: none; font-weight: 600; font-size: 14px;
  border: 1px solid var(--border); padding: 8px 14px; border-radius: 9px;
  transition: background .15s, border-color .15s;
}
.top-cta:hover { background: var(--surface); border-color: var(--primary); }

/* Layout */
main { max-width: 1080px; margin: 0 auto; padding: 34px 22px 60px; }
h1 { font-size: 30px; font-weight: 800; letter-spacing: -.5px; }
.sub { color: var(--muted); margin-top: 10px; font-size: 15px; line-height: 1.6; max-width: 640px; }
.sub b { color: var(--text); }

.stage {
  display: grid; grid-template-columns: 1fr 360px; gap: 20px; margin-top: 26px;
}
@media (max-width: 860px) { .stage { grid-template-columns: 1fr; } }

/* Drop zone / viewer */
.dropzone {
  position: relative;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 16px;
  min-height: 440px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  transition: border-color .15s, background .15s;
}
.dropzone.dragover { border-color: var(--primary); background: var(--surface-2); }
.dropzone.has-model { border-style: solid; cursor: grab; }
.dropzone.has-model:active { cursor: grabbing; }

.drop-prompt { text-align: center; color: var(--muted); padding: 24px; pointer-events: none; }
.drop-prompt svg { color: var(--primary); opacity: .85; }
.drop-title { font-size: 18px; font-weight: 700; color: var(--text); margin-top: 14px; }
.drop-or { margin-top: 6px; font-size: 14px; }
.drop-hint { margin-top: 10px; font-size: 12.5px; opacity: .8; }
.link {
  background: none; border: none; color: var(--primary); cursor: pointer;
  font: inherit; text-decoration: underline; pointer-events: auto;
}
#viewer { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.viewer-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(to top, rgba(14,15,19,.92), rgba(14,15,19,0));
}
.file-label { flex: 1 1 auto; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vbtn {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 6px 11px; font-size: 13px; cursor: pointer;
}
.vbtn:hover { border-color: var(--primary); }

.loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(14,15,19,.7); color: var(--text); font-weight: 600; backdrop-filter: blur(2px);
}

/* Results */
.results { display: flex; flex-direction: column; gap: 14px; }
.verdict {
  border-radius: 12px; padding: 14px 16px; font-weight: 600; font-size: 14.5px; line-height: 1.5;
  background: var(--surface); border: 1px solid var(--border);
}
.verdict.ok   { border-color: rgba(52,211,153,.5);  background: rgba(52,211,153,.08); }
.verdict.warn { border-color: rgba(251,191,36,.5);  background: rgba(251,191,36,.08); }
.verdict.bad  { border-color: rgba(248,113,113,.5); background: rgba(248,113,113,.08); }

.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.metric {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 13px; display: flex; flex-direction: column; gap: 4px;
}
.m-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.m-val { font-size: 16px; font-weight: 700; }

.block { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 13px; }
.block-head { font-size: 13px; font-weight: 700; margin-bottom: 9px; color: var(--text); }
.block-head small { color: var(--muted); font-weight: 500; }
.mesh-row { font-size: 14px; line-height: 1.5; }
.mesh-row .pill { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12.5px; font-weight: 600; margin: 2px 4px 2px 0; }
.pill.ok  { background: rgba(52,211,153,.12); color: var(--ok); }
.pill.bad { background: rgba(248,113,113,.12); color: var(--bad); }

.mat-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.mat-table td { padding: 6px 4px; border-bottom: 1px solid var(--border); }
.mat-table tr:last-child td { border-bottom: none; }
.mat-table td:first-child { color: var(--muted); }
.mat-table td:last-child { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.fineprint { font-size: 11.5px; color: var(--muted); margin-top: 8px; }

.cta-card {
  background: linear-gradient(135deg, rgba(91,140,255,.14), rgba(91,140,255,.04));
  border: 1px solid rgba(91,140,255,.4); border-radius: 12px; padding: 16px;
}
.cta-title { font-weight: 800; font-size: 15px; }
.cta-card p { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin: 7px 0 12px; }
.cta-card b { color: var(--text); }
.cta-btn {
  display: inline-block; background: var(--primary); color: #fff; text-decoration: none;
  font-weight: 700; font-size: 14px; padding: 10px 16px; border-radius: 9px;
}
.cta-btn:hover { filter: brightness(1.08); }

.disclaimer { margin-top: 28px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.disclaimer a { color: var(--primary); text-decoration: none; }
.disclaimer a:hover { text-decoration: underline; }
