Samad14 commited on
Commit
d54a751
·
1 Parent(s): d040f58

feat(frontend): HUD glass design system + clay components

Browse files

Add reusable UI kit (GlassPanel, HudPanel, HudLegend, DataCard, CriticalButton,
ClaySegmented, ClaySlider, ClayToggle, FlatInput) and apply the glass/HUD styling
across pipeline, structure, and results views. Adds CODE_SAMPLE_TEMPLATE.md.

Files changed (23) hide show
  1. bioai-platform/frontend/CODE_SAMPLE_TEMPLATE.md +80 -0
  2. bioai-platform/frontend/src/app/globals.css +256 -0
  3. bioai-platform/frontend/src/app/page.tsx +23 -24
  4. bioai-platform/frontend/src/components/AlphaFoldViewer.tsx +19 -20
  5. bioai-platform/frontend/src/components/DockingViewer.tsx +10 -9
  6. bioai-platform/frontend/src/components/phylo/PhyloTreeViewer.tsx +11 -13
  7. bioai-platform/frontend/src/components/pipeline/JobProgress.tsx +3 -3
  8. bioai-platform/frontend/src/components/pipeline/SequenceInput.tsx +15 -14
  9. bioai-platform/frontend/src/components/results/PipelineResults.tsx +4 -4
  10. bioai-platform/frontend/src/components/results/ScoreBars.tsx +1 -1
  11. bioai-platform/frontend/src/components/structure/RamachandranPlot.tsx +1 -1
  12. bioai-platform/frontend/src/components/ui/ClaySegmented.tsx +49 -0
  13. bioai-platform/frontend/src/components/ui/ClaySlider.tsx +60 -0
  14. bioai-platform/frontend/src/components/ui/ClayToggle.tsx +59 -0
  15. bioai-platform/frontend/src/components/ui/CriticalButton.tsx +41 -0
  16. bioai-platform/frontend/src/components/ui/DataCard.tsx +35 -0
  17. bioai-platform/frontend/src/components/ui/FlatInput.tsx +18 -0
  18. bioai-platform/frontend/src/components/ui/GlassPanel.tsx +16 -0
  19. bioai-platform/frontend/src/components/ui/HudLegend.tsx +41 -0
  20. bioai-platform/frontend/src/components/ui/HudPanel.tsx +16 -0
  21. bioai-platform/frontend/src/components/ui/index.ts +9 -0
  22. bioai-platform/frontend/src/components/wizard/AnalysisWizard.tsx +20 -19
  23. bioai-platform/frontend/tailwind.config.ts +4 -0
bioai-platform/frontend/CODE_SAMPLE_TEMPLATE.md ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # CODE SAMPLE TEMPLATE — how to share code with your AI
2
+
3
+ > Paste one small, *representative* snippet of your code into this file and
4
+ > share it. That gives the AI a reference for **your** conventions so every
5
+ > later instruction ("apply the design system", "fix the chart", "add a page")
6
+ > is implemented in your style, not a generic one.
7
+
8
+ ## When to use
9
+
10
+ - You're about to ask for a big refactor / new feature and want the result to
11
+ match your existing code.
12
+ - Something the AI built "almost" looks right but doesn't match how you write
13
+ components.
14
+ - You're starting a fresh session and want to re-establish your conventions.
15
+
16
+ ## What to include
17
+
18
+ 1. **One component** (a card, a panel, a viewer wrapper) — full file.
19
+ 2. **One page / route** — the layout skeleton only, if you have one.
20
+ 3. **Your conventions** (tick what applies).
21
+
22
+ ---
23
+
24
+ ## 1 · A representative component
25
+
26
+ ```tsx
27
+ 'use client';
28
+
29
+ // Paste ONE component you consider "typical" of how you build UI.
30
+ // Include imports, props pattern, styling approach, and how you handle state.
31
+ ```
32
+
33
+ ## 2 · A representative page / route
34
+
35
+ ```tsx
36
+ // Optional — paste the skeleton of one page (imports + layout structure).
37
+ ```
38
+
39
+ ## 3 · Conventions checklist (tick what applies)
40
+
41
+ - [ ] `'use client'` at top of interactive components
42
+ - [ ] Tailwind utility classes inline (no CSS module files)
43
+ - [ ] Custom CSS classes live in `src/app/globals.css` under `@layer components`
44
+ - [ ] Colors from the design tokens: `text-text-primary`, `text-text-secondary`, `text-text-muted`, `accent-cyan`, `glass-card`, `data-card`
45
+ - [ ] Icons from `lucide-react` with `className="w-4 h-4"`
46
+ - [ ] Animations from `@/lib/animations` (`fadeUp`, `stagger`, `cardHover`, `fadeIn`)
47
+ - [ ] Data fetching with `fetch("/api/backend/...")` (no axios)
48
+ - [ ] Forms: controlled inputs, `useState`, no form library
49
+ - [ ] Default export for components; named export for shared UI primitives
50
+ - [ ] font stacks: `font-display` (Space Grotesk), body default (Inter), `font-mono` (JetBrains Mono)
51
+ - [ ] Style by trust zone: data → flat/opaque (`data-card`), chrome/status → `glass`, discrete controls → clay, 3D viewers → HUD
52
+
53
+ ## 4 · Notes / anything unusual about your codebase
54
+
55
+ <!-- Anything the AI should know: naming conventions, folder rules,
56
+ server components vs client, legacy Tailwind classes you override, etc. -->
57
+
58
+ ---
59
+
60
+ ### Example (filled in)
61
+
62
+ ```tsx
63
+ 'use client';
64
+
65
+ import { motion } from 'framer-motion';
66
+ import { fadeUp } from '@/lib/animations';
67
+ import type { BlastHitSummary } from '@/types/pipeline';
68
+
69
+ export function ScoreBars({ hits }: { hits: BlastHitSummary[] | null }) {
70
+ return (
71
+ <motion.div variants={fadeUp} className="data-card p-6">
72
+ <h2 className="text-lg font-semibold text-text-primary mb-4">Score Distribution</h2>
73
+ ...
74
+ </motion.div>
75
+ );
76
+ }
77
+ ```
78
+
79
+ > Copy this whole file, delete the instructions you don't need, fill the
80
+ > blocks, and send it back to the AI in your next message.
bioai-platform/frontend/src/app/globals.css CHANGED
@@ -40,6 +40,25 @@
40
  --error: #EF4444;
41
  --error-dim: rgba(239, 68, 68, 0.15);
42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  --transition-fast: 150ms cubic-bezier(0.25, 0.1, 0.25, 1);
44
  --transition-default: 250ms cubic-bezier(0.25, 0.1, 0.25, 1);
45
  --transition-slow: 400ms cubic-bezier(0.25, 1, 0.5, 1);
@@ -149,6 +168,243 @@
149
  -webkit-backdrop-filter: blur(32px) saturate(180%);
150
  }
151
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  .text-gradient {
153
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-purple) 100%);
154
  -webkit-background-clip: text;
 
40
  --error: #EF4444;
41
  --error-dim: rgba(239, 68, 68, 0.15);
42
 
43
+ /* ── Claymorphism (tactile, low-stakes controls) ─────────────────── */
44
+ --clay-bg: linear-gradient(145deg, #181830 0%, #0F0F1E 100%);
45
+ --clay-bg-hover: linear-gradient(145deg, #1C1C36 0%, #111120 100%);
46
+ --clay-shadow: rgba(0, 0, 0, 0.5);
47
+ --clay-highlight: rgba(255, 255, 255, 0.045);
48
+ --clay-thumb-bg: linear-gradient(145deg, #2A2A45 0%, #181830 100%);
49
+
50
+ /* ── Liquid glass (hero / nav chrome) ────────────────────────────── */
51
+ --liquid-border: rgba(255, 255, 255, 0.10);
52
+ --liquid-sheen: rgba(255, 255, 255, 0.08);
53
+
54
+ /* ── Flat data cards (near-opaque, for scientific output) ────────── */
55
+ --data-card-bg: rgba(8, 8, 18, 0.96);
56
+ --data-card-border: rgba(100, 110, 180, 0.16);
57
+
58
+ /* ── Spatial HUD (3D viewer chrome, near-opaque) ─────────────────── */
59
+ --hud-bg: rgba(13, 13, 26, 0.90);
60
+ --hud-border: rgba(100, 110, 180, 0.20);
61
+
62
  --transition-fast: 150ms cubic-bezier(0.25, 0.1, 0.25, 1);
63
  --transition-default: 250ms cubic-bezier(0.25, 0.1, 0.25, 1);
64
  --transition-slow: 400ms cubic-bezier(0.25, 1, 0.5, 1);
 
168
  -webkit-backdrop-filter: blur(32px) saturate(180%);
169
  }
170
 
171
+ /* ── Claymorphism — discrete, tactile, pressable objects ─────────────
172
+ Use ONLY for isolated low-stakes choices (toggles, sliders, mode
173
+ pickers). Never for data, charts, or irreversible/expensive actions.
174
+ ──────────────────────────────────────────────────────────────────── */
175
+ .clay {
176
+ background: var(--clay-bg);
177
+ border: 1px solid rgba(100, 110, 180, 0.16);
178
+ border-radius: 0.75rem;
179
+ box-shadow:
180
+ 5px 5px 12px var(--clay-shadow),
181
+ -3px -3px 8px rgba(255, 255, 255, 0.03),
182
+ inset 0 1px 0 rgba(255, 255, 255, 0.05);
183
+ transition:
184
+ transform var(--transition-fast),
185
+ box-shadow var(--transition-fast),
186
+ background var(--transition-fast);
187
+ }
188
+
189
+ .clay:hover {
190
+ background: var(--clay-bg-hover);
191
+ }
192
+
193
+ .clay:active {
194
+ transform: translateY(1px);
195
+ box-shadow:
196
+ 3px 3px 8px var(--clay-shadow),
197
+ -2px -2px 6px rgba(255, 255, 255, 0.02),
198
+ inset 0 2px 6px rgba(0, 0, 0, 0.35);
199
+ }
200
+
201
+ .clay-toggle-track {
202
+ background: linear-gradient(145deg, #181830 0%, #0D0D1A 100%);
203
+ border: 1px solid rgba(100, 110, 180, 0.20);
204
+ box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.45);
205
+ transition: background var(--transition-fast);
206
+ }
207
+
208
+ .clay-toggle-thumb {
209
+ background: var(--clay-thumb-bg);
210
+ border: 1px solid rgba(100, 110, 180, 0.30);
211
+ box-shadow:
212
+ 0 2px 4px rgba(0, 0, 0, 0.50),
213
+ inset 0 1px 0 rgba(255, 255, 255, 0.08);
214
+ }
215
+
216
+ .clay-slider {
217
+ -webkit-appearance: none;
218
+ appearance: none;
219
+ height: 8px;
220
+ border-radius: 9999px;
221
+ background:
222
+ linear-gradient(90deg, var(--accent-cyan) 0%, var(--accent-cyan) var(--fill, 50%),
223
+ #181830 var(--fill, 50%), #181830 100%);
224
+ box-shadow:
225
+ inset 0 2px 5px rgba(0, 0, 0, 0.45),
226
+ inset 0 -1px 0 rgba(255, 255, 255, 0.04);
227
+ outline: none;
228
+ }
229
+
230
+ .clay-slider::-webkit-slider-thumb {
231
+ -webkit-appearance: none;
232
+ appearance: none;
233
+ width: 20px;
234
+ height: 20px;
235
+ border-radius: 50%;
236
+ background: var(--clay-thumb-bg);
237
+ border: 1px solid rgba(100, 110, 180, 0.30);
238
+ box-shadow:
239
+ 0 2px 6px rgba(0, 0, 0, 0.55),
240
+ inset 0 1px 0 rgba(255, 255, 255, 0.10);
241
+ cursor: grab;
242
+ transition: box-shadow var(--transition-fast);
243
+ }
244
+
245
+ .clay-slider::-webkit-slider-thumb:active {
246
+ cursor: grabbing;
247
+ box-shadow:
248
+ 0 1px 3px rgba(0, 0, 0, 0.50),
249
+ inset 0 2px 4px rgba(0, 0, 0, 0.30);
250
+ }
251
+
252
+ .clay-slider::-moz-range-thumb {
253
+ width: 20px;
254
+ height: 20px;
255
+ border-radius: 50%;
256
+ background: var(--clay-thumb-bg);
257
+ border: 1px solid rgba(100, 110, 180, 0.30);
258
+ box-shadow:
259
+ 0 2px 6px rgba(0, 0, 0, 0.55),
260
+ inset 0 1px 0 rgba(255, 255, 255, 0.10);
261
+ cursor: grab;
262
+ }
263
+
264
+ /* ── Liquid glass — premium, alive chrome (hero / nav) ──────────────
265
+ Expensive to render; reserve for the "wow" surfaces only. Never use
266
+ over data that must be read precisely. ──────────────────────────── */
267
+ .liquid-glass {
268
+ position: relative;
269
+ overflow: hidden;
270
+ background: linear-gradient(
271
+ 120deg,
272
+ rgba(120, 130, 200, 0.10),
273
+ rgba(255, 255, 255, 0.03) 40%,
274
+ rgba(0, 245, 212, 0.04) 60%,
275
+ rgba(120, 130, 200, 0.10)
276
+ );
277
+ border: 1px solid var(--liquid-border);
278
+ border-radius: 1rem;
279
+ backdrop-filter: blur(24px) saturate(180%);
280
+ -webkit-backdrop-filter: blur(24px) saturate(180%);
281
+ box-shadow:
282
+ inset 0 1px 0 rgba(255, 255, 255, 0.12),
283
+ inset -1px -1px 2px rgba(255, 255, 255, 0.02),
284
+ 0 8px 32px rgba(0, 0, 0, 0.45);
285
+ }
286
+
287
+ .liquid-glass::before {
288
+ content: '';
289
+ position: absolute;
290
+ inset: 0;
291
+ background: linear-gradient(110deg, transparent 20%, var(--liquid-sheen) 50%, transparent 80%);
292
+ transform: translateX(-100%);
293
+ animation: liquid-sheen 7s ease-in-out infinite;
294
+ pointer-events: none;
295
+ }
296
+
297
+ @keyframes liquid-sheen {
298
+ 0%, 55% { transform: translateX(-100%); }
299
+ 100% { transform: translateX(100%); }
300
+ }
301
+
302
+ /* ── Flat data cards — opaque, high-contrast, zero blur ─────────────
303
+ For charts, trees, scores, structures data-ink. Translucency behind
304
+ data reduces contrast and reads as decoration. ──────────────────── */
305
+ .data-card {
306
+ background: var(--data-card-bg);
307
+ border: 1px solid var(--data-card-border);
308
+ border-radius: 0.875rem;
309
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
310
+ transition: border-color var(--transition-default);
311
+ }
312
+
313
+ .data-card:hover {
314
+ border-color: rgba(100, 110, 180, 0.26);
315
+ }
316
+
317
+ /* ── Spatial HUD — chrome that lives in the viewer's space ────────── */
318
+ .hud {
319
+ background: var(--hud-bg);
320
+ border: 1px solid var(--hud-border);
321
+ border-radius: 0.75rem;
322
+ box-shadow: 0 2px 12px rgba(0, 0, 0, 0.50);
323
+ }
324
+
325
+ .hud-legend {
326
+ background: rgba(8, 8, 18, 0.94);
327
+ border: 1px solid var(--hud-border);
328
+ border-radius: 0.5rem;
329
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
330
+ }
331
+
332
+ /* ── Critical actions — solid, deliberate, not casually clickable ─── */
333
+ .btn-critical {
334
+ display: inline-flex;
335
+ align-items: center;
336
+ justify-content: center;
337
+ gap: 0.5rem;
338
+ padding: 0.7rem 1.5rem;
339
+ border-radius: 0.625rem;
340
+ background: linear-gradient(180deg, #00E0C0 0%, #00B8A0 100%);
341
+ color: #04040A;
342
+ font-family: 'Space Grotesk', sans-serif;
343
+ font-weight: 600;
344
+ font-size: 0.875rem;
345
+ letter-spacing: 0.01em;
346
+ border: 1px solid rgba(255, 255, 255, 0.16);
347
+ box-shadow:
348
+ 0 2px 0 rgba(0, 0, 0, 0.30),
349
+ 0 6px 16px rgba(0, 0, 0, 0.40);
350
+ transition:
351
+ background var(--transition-fast),
352
+ transform var(--transition-fast),
353
+ box-shadow var(--transition-fast);
354
+ }
355
+
356
+ .btn-critical:hover:not(:disabled) {
357
+ background: linear-gradient(180deg, #00F0D0 0%, #00C6AB 100%);
358
+ transform: translateY(-1px);
359
+ box-shadow:
360
+ 0 3px 0 rgba(0, 0, 0, 0.30),
361
+ 0 8px 20px rgba(0, 0, 0, 0.45);
362
+ }
363
+
364
+ .btn-critical:active:not(:disabled) {
365
+ transform: translateY(1px);
366
+ box-shadow: 0 1px 0 rgba(0, 0, 0, 0.30);
367
+ }
368
+
369
+ .btn-critical:disabled {
370
+ opacity: 0.45;
371
+ cursor: not-allowed;
372
+ }
373
+
374
+ .btn-critical-danger {
375
+ background: linear-gradient(180deg, #F87171 0%, #DC2626 100%);
376
+ color: #fff;
377
+ }
378
+
379
+ .btn-critical-danger:hover:not(:disabled) {
380
+ background: linear-gradient(180deg, #FB8888 0%, #EF4444 100%);
381
+ }
382
+
383
+ /* ── Flat data-entry inputs — neutral, precision over decoration ──── */
384
+ .input-flat {
385
+ width: 100%;
386
+ padding: 0.65rem 0.875rem;
387
+ background: var(--bg-surface-1);
388
+ border: 1px solid var(--glass-border);
389
+ border-radius: 0.5rem;
390
+ color: var(--text-primary);
391
+ font-size: 0.875rem;
392
+ outline: none;
393
+ transition:
394
+ border-color var(--transition-fast),
395
+ box-shadow var(--transition-fast);
396
+ }
397
+
398
+ .input-flat::placeholder {
399
+ color: var(--text-muted);
400
+ opacity: 0.7;
401
+ }
402
+
403
+ .input-flat:focus {
404
+ border-color: var(--accent-cyan-30);
405
+ box-shadow: 0 0 0 2px var(--accent-cyan-10);
406
+ }
407
+
408
  .text-gradient {
409
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-purple) 100%);
410
  -webkit-background-clip: text;
bioai-platform/frontend/src/app/page.tsx CHANGED
@@ -66,30 +66,29 @@ export default function LandingPage() {
66
 
67
  return (
68
  <main className="relative bg-void text-text-primary overflow-x-hidden">
69
- <nav
70
- className="fixed top-0 inset-x-0 z-50 flex items-center justify-between px-8 py-5"
71
- style={{ backdropFilter: 'blur(12px)', WebkitBackdropFilter: 'blur(12px)' }}
72
- >
73
- <span className="font-display text-sm font-semibold tracking-widest uppercase">
74
- Bio <span className="text-gradient">Nexus</span>
75
- </span>
76
-
77
- <div className="flex items-center gap-6">
78
- <Link href="#features" className="hidden sm:block text-xs text-text-muted hover:text-text-primary transition-colors tracking-wide">
79
- Features
80
- </Link>
81
- <Link href="#pipeline" className="hidden sm:block text-xs text-text-muted hover:text-text-primary transition-colors tracking-wide">
82
- Pipeline
83
- </Link>
84
- <Link
85
- href="/auth"
86
- className="text-xs px-4 py-2 rounded-full border border-glass-border text-text-secondary hover:border-accent-cyan/40 hover:text-accent-cyan transition-all"
87
- >
88
- Sign in
89
- </Link>
90
- <Link href="/dashboard" className="btn-primary text-xs py-2 px-4">
91
- Get started
92
- </Link>
93
  </div>
94
  </nav>
95
 
 
66
 
67
  return (
68
  <main className="relative bg-void text-text-primary overflow-x-hidden">
69
+ <nav className="fixed top-4 inset-x-0 z-50 flex justify-center px-4 pointer-events-none">
70
+ <div className="liquid-glass pointer-events-auto flex w-full max-w-5xl items-center justify-between px-6 py-3.5">
71
+ <span className="font-display text-sm font-semibold tracking-widest uppercase">
72
+ Bio <span className="text-gradient">Nexus</span>
73
+ </span>
74
+
75
+ <div className="flex items-center gap-6">
76
+ <Link href="#features" className="hidden sm:block text-xs text-text-muted hover:text-text-primary transition-colors tracking-wide">
77
+ Features
78
+ </Link>
79
+ <Link href="#pipeline" className="hidden sm:block text-xs text-text-muted hover:text-text-primary transition-colors tracking-wide">
80
+ Pipeline
81
+ </Link>
82
+ <Link
83
+ href="/auth"
84
+ className="text-xs px-4 py-2 rounded-full border border-glass-border text-text-secondary hover:border-accent-cyan/40 hover:text-accent-cyan transition-all"
85
+ >
86
+ Sign in
87
+ </Link>
88
+ <Link href="/dashboard" className="btn-primary text-xs py-2 px-4">
89
+ Get started
90
+ </Link>
91
+ </div>
 
92
  </div>
93
  </nav>
94
 
bioai-platform/frontend/src/components/AlphaFoldViewer.tsx CHANGED
@@ -1,6 +1,7 @@
1
  'use client';
2
 
3
  import { useCallback, useEffect, useRef, useState } from 'react';
 
4
 
5
  interface MoleViewer {
6
  setStyle: (sel: Record<string, unknown>, style: Record<string, unknown>) => void;
@@ -201,9 +202,10 @@ export function AlphaFoldViewer({
201
  }, [status]);
202
 
203
  return (
204
- <div className="w-full overflow-hidden rounded-lg border border-white/10 bg-[#0d1117]">
205
- <div className="flex flex-wrap items-center justify-between gap-2 border-b border-white/10 px-3 py-2">
206
- <span className="font-mono text-xs text-white/60">
 
207
  {uniprotId ? `AlphaFold model — ${uniprotId}` : 'AlphaFold model'}
208
  </span>
209
 
@@ -212,7 +214,7 @@ export function AlphaFoldViewer({
212
  value={styleMode}
213
  onChange={(e) => setStyleMode(e.target.value as StyleMode)}
214
  disabled={status !== 'ready'}
215
- className="rounded border border-white/10 bg-black/30 px-2 py-1 text-xs text-white/80 disabled:opacity-40"
216
  >
217
  <option value="confidence">Cartoon · pLDDT</option>
218
  <option value="spectrum">Cartoon · spectrum</option>
@@ -223,40 +225,37 @@ export function AlphaFoldViewer({
223
  type="button"
224
  onClick={() => setSpinning((s) => !s)}
225
  disabled={status !== 'ready'}
226
- className="rounded border border-white/10 bg-black/30 px-2 py-1 text-xs text-white/80 hover:bg-black/50 disabled:opacity-40"
227
  >
228
  {spinning ? 'Stop spin' : 'Spin'}
229
  </button>
230
  </div>
231
- </div>
232
 
233
  <div className="relative" style={{ height }}>
234
  <div ref={containerRef} className="absolute inset-0" />
235
 
236
  {status === 'loading' && (
237
- <div className="absolute inset-0 flex items-center justify-center bg-[#0d1117]/80 text-sm text-white/60">
238
  Loading structure...
239
  </div>
240
  )}
241
 
242
  {status === 'error' && (
243
- <div className="absolute inset-0 flex items-center justify-center bg-[#0d1117]/90 px-6 text-center text-sm text-red-400">
244
  {error}
245
  </div>
246
  )}
247
- </div>
248
 
249
- {status === 'ready' && styleMode !== 'spectrum' && (
250
- <div className="flex flex-wrap items-center gap-3 border-t border-white/10 px-3 py-2 text-[11px] text-white/60">
251
- <span className="font-mono uppercase tracking-wide text-white/40">pLDDT confidence</span>
252
- {CONFIDENCE_BANDS.map((band) => (
253
- <span key={band.label} className="flex items-center gap-1">
254
- <span className="inline-block h-2.5 w-2.5 rounded-sm" style={{ backgroundColor: band.color }} />
255
- {band.label}
256
- </span>
257
- ))}
258
- </div>
259
- )}
260
  </div>
261
  );
262
  }
 
1
  'use client';
2
 
3
  import { useCallback, useEffect, useRef, useState } from 'react';
4
+ import { HudPanel, HudLegend, LegendItem } from '@/components/ui';
5
 
6
  interface MoleViewer {
7
  setStyle: (sel: Record<string, unknown>, style: Record<string, unknown>) => void;
 
202
  }, [status]);
203
 
204
  return (
205
+ <div className="relative w-full overflow-hidden rounded-xl border border-glass-border bg-[#0d1117]">
206
+ {/* HUD toolbar — floats in the viewer's space, near-opaque */}
207
+ <HudPanel className="absolute left-3 right-3 top-3 z-10 flex flex-wrap items-center justify-between gap-2 px-3 py-2">
208
+ <span className="font-mono text-xs text-text-muted">
209
  {uniprotId ? `AlphaFold model — ${uniprotId}` : 'AlphaFold model'}
210
  </span>
211
 
 
214
  value={styleMode}
215
  onChange={(e) => setStyleMode(e.target.value as StyleMode)}
216
  disabled={status !== 'ready'}
217
+ className="rounded-md border border-glass-border bg-black/40 px-2 py-1 text-xs text-text-secondary outline-none disabled:opacity-40 focus:border-accent-cyan/40"
218
  >
219
  <option value="confidence">Cartoon · pLDDT</option>
220
  <option value="spectrum">Cartoon · spectrum</option>
 
225
  type="button"
226
  onClick={() => setSpinning((s) => !s)}
227
  disabled={status !== 'ready'}
228
+ className="rounded-md border border-glass-border bg-black/40 px-2 py-1 text-xs text-text-secondary hover:bg-black/60 hover:text-text-primary disabled:opacity-40 transition-colors"
229
  >
230
  {spinning ? 'Stop spin' : 'Spin'}
231
  </button>
232
  </div>
233
+ </HudPanel>
234
 
235
  <div className="relative" style={{ height }}>
236
  <div ref={containerRef} className="absolute inset-0" />
237
 
238
  {status === 'loading' && (
239
+ <div className="absolute inset-0 flex items-center justify-center bg-[#0d1117]/80 text-sm text-text-secondary">
240
  Loading structure...
241
  </div>
242
  )}
243
 
244
  {status === 'error' && (
245
+ <div className="absolute inset-0 flex items-center justify-center bg-[#0d1117]/90 px-6 text-center text-sm text-error">
246
  {error}
247
  </div>
248
  )}
 
249
 
250
+ {/* Corner-anchored, near-opaque legend — never blurred over the model */}
251
+ {status === 'ready' && styleMode !== 'spectrum' && (
252
+ <HudLegend title="pLDDT confidence" className="absolute bottom-3 left-3 z-10 max-w-[calc(100%-1.5rem)]">
253
+ {CONFIDENCE_BANDS.map((band) => (
254
+ <LegendItem key={band.label} color={band.color} label={band.label} />
255
+ ))}
256
+ </HudLegend>
257
+ )}
258
+ </div>
 
 
259
  </div>
260
  );
261
  }
bioai-platform/frontend/src/components/DockingViewer.tsx CHANGED
@@ -2,6 +2,7 @@
2
 
3
  import { useCallback, useEffect, useRef, useState } from 'react';
4
  import type { DockingInteraction } from '@/lib/api';
 
5
  import {
6
  RotateCcw, RotateCw, Camera, FlipHorizontal, Palette,
7
  Box, Layers, Minus, Circle, Hexagon
@@ -362,10 +363,10 @@ export function DockingViewer({
362
  }, [spinning, status]);
363
 
364
  return (
365
- <div className="w-full rounded-lg border border-white/10 bg-[#0d1117] relative z-20">
366
- {/* Toolbar */}
367
- <div className="flex flex-wrap items-center gap-2 border-b border-white/10 px-3 py-2 relative z-20">
368
- <span className="font-mono text-xs text-white/60 mr-2">{pdbId}</span>
369
 
370
  {/* Representation */}
371
  <div className="flex items-center gap-1">
@@ -474,12 +475,12 @@ export function DockingViewer({
474
  >
475
  <Camera className="w-3.5 h-3.5" />
476
  </button>
477
- </div>
478
 
479
  {/* Interaction legend */}
480
  {status === 'ready' && interactions && (
481
- <div className="flex flex-wrap items-center gap-2 border-b border-white/10 px-3 py-2 text-[10px]">
482
- <span className="mr-1 text-white/40">Contacts</span>
483
  {INTERACTION_LAYERS.map(({ key, label, color }) => {
484
  const count = interactions[key]?.length || 0;
485
  if (!count) return null;
@@ -497,11 +498,11 @@ export function DockingViewer({
497
  </button>
498
  );
499
  })}
500
- </div>
501
  )}
502
 
503
  {(chains.length > 0 || ligands.length > 0) && (
504
- <div className="flex flex-wrap gap-x-4 gap-y-1 border-b border-white/10 px-3 py-2 text-[10px] text-white/50">
505
  {chains.length > 0 && <span>{chains.length} protein chain{chains.length === 1 ? '' : 's'}</span>}
506
  {ligands.length > 0 && <span>Deposited ligands: {ligands.map(ligand => `${ligand.id}:${ligand.chain}`).join(', ')}</span>}
507
  {ligandPdb && <span className="text-accent-cyan">Docked ligand loaded</span>}
 
2
 
3
  import { useCallback, useEffect, useRef, useState } from 'react';
4
  import type { DockingInteraction } from '@/lib/api';
5
+ import { HudPanel, HudLegend } from '@/components/ui';
6
  import {
7
  RotateCcw, RotateCw, Camera, FlipHorizontal, Palette,
8
  Box, Layers, Minus, Circle, Hexagon
 
363
  }, [spinning, status]);
364
 
365
  return (
366
+ <div className="relative z-20 w-full overflow-hidden rounded-xl border border-glass-border bg-[#0d1117]">
367
+ {/* HUD toolbar — spatial chrome for the viewer */}
368
+ <HudPanel className="flex flex-wrap items-center gap-2 border-b border-glass-border px-3 py-2">
369
+ <span className="mr-2 font-mono text-xs text-text-muted">{pdbId}</span>
370
 
371
  {/* Representation */}
372
  <div className="flex items-center gap-1">
 
475
  >
476
  <Camera className="w-3.5 h-3.5" />
477
  </button>
478
+ </HudPanel>
479
 
480
  {/* Interaction legend */}
481
  {status === 'ready' && interactions && (
482
+ <HudLegend className="flex flex-wrap items-center gap-2 border-b border-glass-border">
483
+ <span className="mr-1 text-[10px] text-text-muted">Contacts</span>
484
  {INTERACTION_LAYERS.map(({ key, label, color }) => {
485
  const count = interactions[key]?.length || 0;
486
  if (!count) return null;
 
498
  </button>
499
  );
500
  })}
501
+ </HudLegend>
502
  )}
503
 
504
  {(chains.length > 0 || ligands.length > 0) && (
505
+ <div className="flex flex-wrap gap-x-4 gap-y-1 border-b border-glass-border bg-[#0d1117]/60 px-3 py-2 text-[10px] text-text-muted">
506
  {chains.length > 0 && <span>{chains.length} protein chain{chains.length === 1 ? '' : 's'}</span>}
507
  {ligands.length > 0 && <span>Deposited ligands: {ligands.map(ligand => `${ligand.id}:${ligand.chain}`).join(', ')}</span>}
508
  {ligandPdb && <span className="text-accent-cyan">Docked ligand loaded</span>}
bioai-platform/frontend/src/components/phylo/PhyloTreeViewer.tsx CHANGED
@@ -2,6 +2,7 @@
2
 
3
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
4
  import { Search } from 'lucide-react'
 
5
 
6
  // ─── Types ────────────────────────────────────────────────────────────────────
7
 
@@ -559,7 +560,7 @@ function NodeInfoPanel({ node, allNodes }: { node: TreeNode; allNodes: TreeNode[
559
  const isValidAccession = leafName.length >= 4 && /^[A-Z0-9_]+$/.test(leafName)
560
 
561
  return (
562
- <div className="glass-card p-4 space-y-2 text-sm">
563
  <div className="flex items-center justify-between">
564
  <span className="text-text-primary font-medium">
565
  {isLeaf ? node.name || 'Leaf' : 'Internal Node'}
@@ -816,18 +817,15 @@ export default function PhyloTreeViewer({
816
  </span>
817
  )}
818
 
819
- <div className="flex gap-1 bg-surface-1 rounded-lg p-1 border border-glass-border">
820
- {(['rectangular', 'circular'] as Layout[]).map(l => (
821
- <button key={l} onClick={() => setLayout(l)}
822
- className={`text-xs px-3 py-1 rounded-md transition-colors capitalize ${
823
- layout === l
824
- ? 'bg-accent-cyan/20 text-accent-cyan'
825
- : 'text-text-secondary hover:text-text-primary'
826
- }`}>
827
- {l}
828
- </button>
829
- ))}
830
- </div>
831
 
832
  <button onClick={resetView}
833
  className="text-xs px-3 py-1.5 rounded-lg border border-glass-border
 
2
 
3
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
4
  import { Search } from 'lucide-react'
5
+ import { ClaySegmented } from '@/components/ui/ClaySegmented'
6
 
7
  // ─── Types ────────────────────────────────────────────────────────────────────
8
 
 
560
  const isValidAccession = leafName.length >= 4 && /^[A-Z0-9_]+$/.test(leafName)
561
 
562
  return (
563
+ <div className="data-card p-4 space-y-2 text-sm">
564
  <div className="flex items-center justify-between">
565
  <span className="text-text-primary font-medium">
566
  {isLeaf ? node.name || 'Leaf' : 'Internal Node'}
 
817
  </span>
818
  )}
819
 
820
+ <ClaySegmented
821
+ options={[
822
+ { value: 'rectangular', label: 'Rectangular' },
823
+ { value: 'circular', label: 'Circular' },
824
+ ]}
825
+ value={layout}
826
+ onChange={setLayout}
827
+ size="sm"
828
+ />
 
 
 
829
 
830
  <button onClick={resetView}
831
  className="text-xs px-3 py-1.5 rounded-lg border border-glass-border
bioai-platform/frontend/src/components/pipeline/JobProgress.tsx CHANGED
@@ -32,10 +32,10 @@ export function JobProgress({ stepsCompleted, status }: JobProgressProps) {
32
  const nextPendingIndex = stepsCompleted.length;
33
 
34
  return (
35
- <motion.div variants={fadeUp} className="bg-white rounded-2xl border border-gray-200 p-6">
36
  <div className="flex items-center justify-between mb-4">
37
- <h3 className="text-sm font-semibold text-gray-900">Pipeline progress</h3>
38
- <span className="text-xs text-gray-500">{pct}%</span>
39
  </div>
40
  <div className="w-full bg-gray-100 rounded-full h-1.5 mb-5">
41
  <div
 
32
  const nextPendingIndex = stepsCompleted.length;
33
 
34
  return (
35
+ <motion.div variants={fadeUp} className="glass-card p-6">
36
  <div className="flex items-center justify-between mb-4">
37
+ <h3 className="text-sm font-semibold text-text-primary">Pipeline progress</h3>
38
+ <span className="text-xs text-text-muted">{pct}%</span>
39
  </div>
40
  <div className="w-full bg-gray-100 rounded-full h-1.5 mb-5">
41
  <div
bioai-platform/frontend/src/components/pipeline/SequenceInput.tsx CHANGED
@@ -1,8 +1,8 @@
1
  'use client';
2
 
3
- import { useState } from 'react';
4
  import { motion } from 'framer-motion';
5
  import { fadeUp } from '@/lib/animations';
 
6
 
7
  const SAMPLES = [
8
  {
@@ -38,18 +38,18 @@ export function SequenceInput({ value, onChange, onSubmit, loading, error }: Seq
38
  .join('').length;
39
 
40
  return (
41
- <motion.div variants={fadeUp} className="bg-white rounded-2xl border border-gray-200 p-6">
42
- <label className="block text-sm font-medium text-gray-700 mb-2">
43
  Enter protein sequence (FASTA or plain)
44
  </label>
45
- <textarea
46
  value={value}
47
  onChange={(e) => onChange(e.target.value)}
48
- placeholder=">sp|P04637|P53_HUMAN&#10;MEEPQSDPSVEPPLSQETFSDLWKLLPENNVLSPLPSQ..."
49
- className="w-full h-40 px-4 py-3 rounded-xl border border-gray-300 focus:border-teal-500 focus:ring-2 focus:ring-teal-200 outline-none transition font-mono text-sm text-gray-900 resize-none"
50
  />
51
  {error && (
52
- <p className="mt-2 text-sm text-red-600">{error}</p>
53
  )}
54
  <div className="flex items-center justify-between mt-4">
55
  <div className="flex items-center gap-4">
@@ -58,22 +58,23 @@ export function SequenceInput({ value, onChange, onSubmit, loading, error }: Seq
58
  key={s.label}
59
  type="button"
60
  onClick={() => onChange(s.seq)}
61
- className="text-sm text-teal-600 hover:text-teal-700 underline"
62
  >
63
  Load {s.label}
64
  </button>
65
  ))}
66
- <span className="text-xs text-gray-400">
67
  {value ? `${aaCount} aa` : '0 aa'}
68
  </span>
69
  </div>
70
- <button
71
  onClick={onSubmit}
72
- disabled={loading || !value.trim()}
73
- className="px-6 py-2.5 bg-teal-600 text-white font-medium rounded-xl hover:bg-teal-700 transition disabled:opacity-50"
 
74
  >
75
- {loading ? 'Running pipeline...' : 'Run Pipeline'}
76
- </button>
77
  </div>
78
  </motion.div>
79
  );
 
1
  'use client';
2
 
 
3
  import { motion } from 'framer-motion';
4
  import { fadeUp } from '@/lib/animations';
5
+ import { CriticalButton, FlatTextarea } from '@/components/ui';
6
 
7
  const SAMPLES = [
8
  {
 
38
  .join('').length;
39
 
40
  return (
41
+ <motion.div variants={fadeUp} className="data-card p-6">
42
+ <label className="block text-sm font-medium text-text-secondary mb-2">
43
  Enter protein sequence (FASTA or plain)
44
  </label>
45
+ <FlatTextarea
46
  value={value}
47
  onChange={(e) => onChange(e.target.value)}
48
+ rows={10}
49
+ placeholder={">sp|P04637|P53_HUMAN\nMEEPQSDPSVEPPLSQETFSDLWKLLPENNVLSPLPSQ..."}
50
  />
51
  {error && (
52
+ <p className="mt-2 text-sm text-error">{error}</p>
53
  )}
54
  <div className="flex items-center justify-between mt-4">
55
  <div className="flex items-center gap-4">
 
58
  key={s.label}
59
  type="button"
60
  onClick={() => onChange(s.seq)}
61
+ className="text-sm text-accent-cyan hover:underline underline-offset-2"
62
  >
63
  Load {s.label}
64
  </button>
65
  ))}
66
+ <span className="text-xs text-text-muted">
67
  {value ? `${aaCount} aa` : '0 aa'}
68
  </span>
69
  </div>
70
+ <CriticalButton
71
  onClick={onSubmit}
72
+ disabled={!value.trim()}
73
+ loading={loading}
74
+ type="button"
75
  >
76
+ {loading ? 'Running pipeline…' : 'Run Pipeline'}
77
+ </CriticalButton>
78
  </div>
79
  </motion.div>
80
  );
bioai-platform/frontend/src/components/results/PipelineResults.tsx CHANGED
@@ -109,7 +109,7 @@ export function PipelineResults({ jobId, steps: enabledSteps, onComplete }: Pipe
109
  )}
110
 
111
  {steps.includes("msa") && data.steps?.msa?.status === "complete" && data.steps.msa.data?.aln_fasta && (
112
- <motion.div initial={{ opacity: 0, y: 16 }} animate={{ opacity: 1, y: 0 }} className="glass-card p-4">
113
  <h3 className="text-sm font-semibold text-text-primary mb-2">Multiple Sequence Alignment</h3>
114
  <p className="text-xs text-text-muted mb-2">{data.steps.msa.data.sequence_count} sequences aligned via Clustal Omega</p>
115
  <pre className="bg-surface-1 rounded-xl p-4 text-xs font-mono text-text-secondary leading-relaxed overflow-x-auto max-h-80 overflow-y-auto whitespace-pre">
@@ -119,21 +119,21 @@ export function PipelineResults({ jobId, steps: enabledSteps, onComplete }: Pipe
119
  )}
120
 
121
  {steps.includes("phylo") && data.steps?.phylo?.status === "complete" && data.steps.phylo.data?.phylotree_newick && (
122
- <motion.div initial={{ opacity: 0, y: 16 }} animate={{ opacity: 1, y: 0 }} className="glass-card p-4">
123
  <h3 className="text-sm font-semibold text-text-primary mb-2">Phylogenetic Tree</h3>
124
  <PhyloTreeViewer newick={data.steps.phylo.data.phylotree_newick} />
125
  </motion.div>
126
  )}
127
 
128
  {steps.includes("domains") && data.steps?.domains?.status === "complete" && data.steps.domains.data?.uniprot_accession && (
129
- <motion.div initial={{ opacity: 0, y: 16 }} animate={{ opacity: 1, y: 0 }} className="glass-card p-4">
130
  <h3 className="text-sm font-semibold text-text-primary mb-2">Domain Architecture</h3>
131
  <DomainSummary data={data.steps.domains.data} />
132
  </motion.div>
133
  )}
134
 
135
  {steps.includes("interpret") && data.steps?.interpret?.status === "complete" && data.steps.interpret.data?.interpretation && (
136
- <motion.div initial={{ opacity: 0, y: 16 }} animate={{ opacity: 1, y: 0 }} className="glass-card p-4">
137
  <h3 className="text-sm font-semibold text-text-primary mb-2">AI Interpretation</h3>
138
  <div className="prose prose-sm max-w-none text-text-secondary whitespace-pre-wrap font-mono text-sm leading-relaxed">
139
  {data.steps.interpret.data.interpretation}
 
109
  )}
110
 
111
  {steps.includes("msa") && data.steps?.msa?.status === "complete" && data.steps.msa.data?.aln_fasta && (
112
+ <motion.div initial={{ opacity: 0, y: 16 }} animate={{ opacity: 1, y: 0 }} className="data-card p-4">
113
  <h3 className="text-sm font-semibold text-text-primary mb-2">Multiple Sequence Alignment</h3>
114
  <p className="text-xs text-text-muted mb-2">{data.steps.msa.data.sequence_count} sequences aligned via Clustal Omega</p>
115
  <pre className="bg-surface-1 rounded-xl p-4 text-xs font-mono text-text-secondary leading-relaxed overflow-x-auto max-h-80 overflow-y-auto whitespace-pre">
 
119
  )}
120
 
121
  {steps.includes("phylo") && data.steps?.phylo?.status === "complete" && data.steps.phylo.data?.phylotree_newick && (
122
+ <motion.div initial={{ opacity: 0, y: 16 }} animate={{ opacity: 1, y: 0 }} className="data-card p-4">
123
  <h3 className="text-sm font-semibold text-text-primary mb-2">Phylogenetic Tree</h3>
124
  <PhyloTreeViewer newick={data.steps.phylo.data.phylotree_newick} />
125
  </motion.div>
126
  )}
127
 
128
  {steps.includes("domains") && data.steps?.domains?.status === "complete" && data.steps.domains.data?.uniprot_accession && (
129
+ <motion.div initial={{ opacity: 0, y: 16 }} animate={{ opacity: 1, y: 0 }} className="data-card p-4">
130
  <h3 className="text-sm font-semibold text-text-primary mb-2">Domain Architecture</h3>
131
  <DomainSummary data={data.steps.domains.data} />
132
  </motion.div>
133
  )}
134
 
135
  {steps.includes("interpret") && data.steps?.interpret?.status === "complete" && data.steps.interpret.data?.interpretation && (
136
+ <motion.div initial={{ opacity: 0, y: 16 }} animate={{ opacity: 1, y: 0 }} className="data-card p-4">
137
  <h3 className="text-sm font-semibold text-text-primary mb-2">AI Interpretation</h3>
138
  <div className="prose prose-sm max-w-none text-text-secondary whitespace-pre-wrap font-mono text-sm leading-relaxed">
139
  {data.steps.interpret.data.interpretation}
bioai-platform/frontend/src/components/results/ScoreBars.tsx CHANGED
@@ -31,7 +31,7 @@ export function ScoreBars({ hits }: ScoreBarsProps) {
31
  const maxScore = hits[0]?.bit_score || 1;
32
 
33
  return (
34
- <motion.div variants={fadeUp} whileHover={cardHover} className="glass-card p-6">
35
  <h2 className="text-lg font-semibold text-text-primary mb-4">Score Distribution</h2>
36
  <div className="space-y-2">
37
  {hits.slice(0, 15).map((hit, i) => {
 
31
  const maxScore = hits[0]?.bit_score || 1;
32
 
33
  return (
34
+ <motion.div variants={fadeUp} whileHover={cardHover} className="data-card p-6">
35
  <h2 className="text-lg font-semibold text-text-primary mb-4">Score Distribution</h2>
36
  <div className="space-y-2">
37
  {hits.slice(0, 15).map((hit, i) => {
bioai-platform/frontend/src/components/structure/RamachandranPlot.tsx CHANGED
@@ -57,7 +57,7 @@ export function RamachandranPlot({ pdbId, chain = "A" }: { pdbId: string | null;
57
  </div>
58
 
59
  <div className="flex flex-col lg:flex-row gap-6">
60
- <div className="glass-card relative">
61
  <svg viewBox={`0 0 ${W} ${H}`} className="w-80 h-80">
62
  <ellipse cx={toX(-57)} cy={toY(-47)} rx={30} ry={30}
63
  fill="#00F5D4" fillOpacity={0.06} stroke="#00F5D4" strokeOpacity={0.15} />
 
57
  </div>
58
 
59
  <div className="flex flex-col lg:flex-row gap-6">
60
+ <div className="data-card relative">
61
  <svg viewBox={`0 0 ${W} ${H}`} className="w-80 h-80">
62
  <ellipse cx={toX(-57)} cy={toY(-47)} rx={30} ry={30}
63
  fill="#00F5D4" fillOpacity={0.06} stroke="#00F5D4" strokeOpacity={0.15} />
bioai-platform/frontend/src/components/ui/ClaySegmented.tsx ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 'use client';
2
+
3
+ /**
4
+ * Claymorphism segmented control — a discrete picker between 2–4 modes
5
+ * (e.g. rectangular/circular tree layout). Low-stakes, tactile.
6
+ */
7
+
8
+ interface ClaySegmentedProps<T extends string> {
9
+ options: { value: T; label: string }[];
10
+ value: T;
11
+ onChange: (value: T) => void;
12
+ disabled?: boolean;
13
+ className?: string;
14
+ size?: 'sm' | 'md';
15
+ }
16
+
17
+ export function ClaySegmented<T extends string>({
18
+ options,
19
+ value,
20
+ onChange,
21
+ disabled,
22
+ className = '',
23
+ size = 'md',
24
+ }: ClaySegmentedProps<T>) {
25
+ return (
26
+ <div className={`clay inline-flex rounded-lg p-0.5 gap-0.5 ${disabled ? 'opacity-50' : ''} ${className}`}>
27
+ {options.map((opt) => {
28
+ const active = opt.value === value;
29
+ return (
30
+ <button
31
+ key={opt.value}
32
+ type="button"
33
+ onClick={() => onChange(opt.value)}
34
+ disabled={disabled}
35
+ className={`rounded-md capitalize font-medium transition-colors ${
36
+ size === 'sm' ? 'px-2.5 py-1 text-xs' : 'px-3 py-1.5 text-sm'
37
+ } ${
38
+ active
39
+ ? 'bg-accent-cyan/20 text-accent-cyan'
40
+ : 'text-text-secondary hover:text-text-primary'
41
+ }`}
42
+ >
43
+ {opt.label}
44
+ </button>
45
+ );
46
+ })}
47
+ </div>
48
+ );
49
+ }
bioai-platform/frontend/src/components/ui/ClaySlider.tsx ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 'use client';
2
+
3
+ import type { CSSProperties } from 'react';
4
+
5
+ /**
6
+ * Claymorphism slider — for numeric, isolated, non-critical inputs
7
+ * (MD run length, search hit count, bootstrap cutoff, etc.).
8
+ */
9
+
10
+ interface ClaySliderProps {
11
+ label?: string;
12
+ value: number;
13
+ min: number;
14
+ max: number;
15
+ step?: number;
16
+ unit?: string;
17
+ onChange: (value: number) => void;
18
+ disabled?: boolean;
19
+ className?: string;
20
+ }
21
+
22
+ export function ClaySlider({
23
+ label,
24
+ value,
25
+ min,
26
+ max,
27
+ step = 1,
28
+ unit,
29
+ onChange,
30
+ disabled,
31
+ className = '',
32
+ }: ClaySliderProps) {
33
+ const pct = ((value - min) / (max - min)) * 100;
34
+
35
+ return (
36
+ <div className={`flex flex-col gap-1.5 ${disabled ? 'opacity-40' : ''} ${className}`}>
37
+ <div className="flex items-center justify-between">
38
+ {label && <span className="text-sm text-text-primary">{label}</span>}
39
+ <span className="font-mono text-xs text-accent-cyan">
40
+ {value}
41
+ {unit ? ` ${unit}` : ''}
42
+ </span>
43
+ </div>
44
+
45
+ <input
46
+ type="range"
47
+ role="slider"
48
+ aria-label={label}
49
+ min={min}
50
+ max={max}
51
+ step={step}
52
+ value={value}
53
+ disabled={disabled}
54
+ onChange={(e) => onChange(Number(e.target.value))}
55
+ className="clay-slider w-full"
56
+ style={{ '--fill': `${pct}%` } as CSSProperties}
57
+ />
58
+ </div>
59
+ );
60
+ }
bioai-platform/frontend/src/components/ui/ClayToggle.tsx ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 'use client';
2
+
3
+ /**
4
+ * Claymorphism switch — for discrete, low-stakes, single-purpose choices
5
+ * (e.g. implicit vs explicit solvent, show/hide overlays).
6
+ *
7
+ * Signal: "this is a tactile, pressable object, not data."
8
+ * Never use this for critical actions (Run/Submit/Delete) — see CriticalButton.
9
+ */
10
+
11
+ interface ClayToggleProps {
12
+ checked: boolean;
13
+ onChange: (value: boolean) => void;
14
+ label?: string;
15
+ hint?: string;
16
+ disabled?: boolean;
17
+ className?: string;
18
+ }
19
+
20
+ export function ClayToggle({
21
+ checked,
22
+ onChange,
23
+ label,
24
+ hint,
25
+ disabled,
26
+ className = '',
27
+ }: ClayToggleProps) {
28
+ return (
29
+ <button
30
+ type="button"
31
+ role="switch"
32
+ aria-checked={checked}
33
+ disabled={disabled}
34
+ onClick={() => onChange(!checked)}
35
+ className={`group flex items-center gap-3 text-left disabled:opacity-40 ${className}`}
36
+ >
37
+ <span
38
+ className="clay-toggle-track relative h-6 w-11 shrink-0 rounded-full transition-colors"
39
+ style={{
40
+ background: checked
41
+ ? 'rgba(0,245,212,0.18)'
42
+ : 'linear-gradient(145deg, #181830 0%, #0D0D1A 100%)',
43
+ }}
44
+ >
45
+ <span
46
+ className="clay-toggle-thumb absolute top-[2px] h-5 w-5 rounded-full transition-[left] duration-200"
47
+ style={{ left: checked ? 'calc(100% - 1.375rem)' : '0.125rem' }}
48
+ />
49
+ </span>
50
+
51
+ {(label || hint) && (
52
+ <span className="flex flex-col">
53
+ {label && <span className="text-sm text-text-primary">{label}</span>}
54
+ {hint && <span className="text-[11px] text-text-muted">{hint}</span>}
55
+ </span>
56
+ )}
57
+ </button>
58
+ );
59
+ }
bioai-platform/frontend/src/components/ui/CriticalButton.tsx ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 'use client';
2
+
3
+ import { Loader2 } from 'lucide-react';
4
+
5
+ /**
6
+ * Solid, deliberate action button for irreversible / expensive actions
7
+ * (Run Pipeline, Submit Job, Delete). The hard flat shadow gives it real
8
+ * weight so it never feels as casual to click as a clay toggle.
9
+ */
10
+
11
+ interface CriticalButtonProps {
12
+ children: React.ReactNode;
13
+ onClick?: () => void;
14
+ type?: 'button' | 'submit';
15
+ disabled?: boolean;
16
+ loading?: boolean;
17
+ variant?: 'run' | 'danger' | 'submit';
18
+ className?: string;
19
+ }
20
+
21
+ export function CriticalButton({
22
+ children,
23
+ onClick,
24
+ type = 'button',
25
+ disabled,
26
+ loading,
27
+ variant = 'run',
28
+ className = '',
29
+ }: CriticalButtonProps) {
30
+ return (
31
+ <button
32
+ type={type}
33
+ onClick={onClick}
34
+ disabled={disabled || loading}
35
+ className={`btn-critical ${variant === 'danger' ? 'btn-critical-danger' : ''} ${className}`}
36
+ >
37
+ {loading && <Loader2 className="h-4 w-4 animate-spin" />}
38
+ {children}
39
+ </button>
40
+ );
41
+ }
bioai-platform/frontend/src/components/ui/DataCard.tsx ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 'use client';
2
+
3
+ /**
4
+ * Flat, near-opaque card for scientific output (charts, trees, scores).
5
+ * No blur, no tint, no extrusion — translucency hurts data readability.
6
+ */
7
+
8
+ interface DataCardProps {
9
+ title?: string;
10
+ subtitle?: string;
11
+ actions?: React.ReactNode;
12
+ children: React.ReactNode;
13
+ className?: string;
14
+ }
15
+
16
+ export function DataCard({ title, subtitle, actions, children, className = '' }: DataCardProps) {
17
+ return (
18
+ <section className={`data-card p-5 ${className}`}>
19
+ {(title || actions) && (
20
+ <header className="mb-4 flex items-center justify-between gap-3">
21
+ <div>
22
+ {title && (
23
+ <h2 className="text-base font-semibold tracking-tight text-text-primary">
24
+ {title}
25
+ </h2>
26
+ )}
27
+ {subtitle && <p className="mt-0.5 text-xs text-text-muted">{subtitle}</p>}
28
+ </div>
29
+ {actions}
30
+ </header>
31
+ )}
32
+ {children}
33
+ </section>
34
+ );
35
+ }
bioai-platform/frontend/src/components/ui/FlatInput.tsx ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 'use client';
2
+
3
+ /**
4
+ * Neutral, flat input for data entry (PDB IDs, accession numbers,
5
+ * FASTA sequences). Precision over decoration — visual noise here
6
+ * increases error rate. Expressive styling is for the buttons that
7
+ * submit these fields, not the fields themselves.
8
+ */
9
+
10
+ export function FlatInput(props: React.InputHTMLAttributes<HTMLInputElement>) {
11
+ const { className = '', ...rest } = props;
12
+ return <input {...rest} className={`input-flat ${className}`} />;
13
+ }
14
+
15
+ export function FlatTextarea(props: React.TextareaHTMLAttributes<HTMLTextAreaElement>) {
16
+ const { className = '', ...rest } = props;
17
+ return <textarea {...rest} className={`input-flat resize-none font-mono ${className}`} />;
18
+ }
bioai-platform/frontend/src/components/ui/GlassPanel.tsx ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 'use client';
2
+
3
+ /**
4
+ * Glassmorphism container for transient, layered UI — job status, toasts,
5
+ * panels floating over the 3D viewer. Communicates "temporary chrome,
6
+ * not permanent data."
7
+ */
8
+
9
+ interface GlassPanelProps {
10
+ children: React.ReactNode;
11
+ className?: string;
12
+ }
13
+
14
+ export function GlassPanel({ children, className = '' }: GlassPanelProps) {
15
+ return <div className={`glass-panel rounded-xl ${className}`}>{children}</div>;
16
+ }
bioai-platform/frontend/src/components/ui/HudLegend.tsx ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 'use client';
2
+
3
+ /**
4
+ * Near-opaque, corner-anchored legend for 3D viewer overlays
5
+ * (pLDDT key, interaction color key). Small, minimal, never obscuring
6
+ * the model.
7
+ */
8
+
9
+ interface HudLegendProps {
10
+ title?: string;
11
+ children: React.ReactNode;
12
+ className?: string;
13
+ }
14
+
15
+ export function HudLegend({ title, children, className = '' }: HudLegendProps) {
16
+ return (
17
+ <div className={`hud-legend px-3 py-2 ${className}`}>
18
+ {title && (
19
+ <p className="mb-1.5 font-mono text-[10px] uppercase tracking-wider text-text-muted">
20
+ {title}
21
+ </p>
22
+ )}
23
+ <div className="flex flex-wrap items-center gap-x-3 gap-y-1">{children}</div>
24
+ </div>
25
+ );
26
+ }
27
+
28
+ export function LegendItem({
29
+ color,
30
+ label,
31
+ }: {
32
+ color: string;
33
+ label: string;
34
+ }) {
35
+ return (
36
+ <span className="flex items-center gap-1.5 text-[11px] text-text-secondary">
37
+ <span className="inline-block h-2.5 w-2.5 shrink-0 rounded-sm" style={{ backgroundColor: color }} />
38
+ {label}
39
+ </span>
40
+ );
41
+ }
bioai-platform/frontend/src/components/ui/HudPanel.tsx ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 'use client';
2
+
3
+ /**
4
+ * Spatial HUD chrome — controls that sit at a fixed depth in the 3D
5
+ * viewer's scene, near-opaque so the model underneath stays readable.
6
+ * Never blurred glass over a structure people are trying to parse.
7
+ */
8
+
9
+ interface HudPanelProps {
10
+ children: React.ReactNode;
11
+ className?: string;
12
+ }
13
+
14
+ export function HudPanel({ children, className = '' }: HudPanelProps) {
15
+ return <div className={`hud ${className}`}>{children}</div>;
16
+ }
bioai-platform/frontend/src/components/ui/index.ts ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ export { ClayToggle } from './ClayToggle';
2
+ export { ClaySlider } from './ClaySlider';
3
+ export { ClaySegmented } from './ClaySegmented';
4
+ export { DataCard } from './DataCard';
5
+ export { CriticalButton } from './CriticalButton';
6
+ export { GlassPanel } from './GlassPanel';
7
+ export { HudPanel } from './HudPanel';
8
+ export { HudLegend, LegendItem } from './HudLegend';
9
+ export { FlatInput, FlatTextarea } from './FlatInput';
bioai-platform/frontend/src/components/wizard/AnalysisWizard.tsx CHANGED
@@ -2,6 +2,8 @@
2
  import { useState } from "react";
3
  import { motion, AnimatePresence } from "framer-motion";
4
  import { Dna, ArrowRight, LoaderCircle, FileText, CircleCheck, Circle } from "lucide-react";
 
 
5
  import { PipelineResults } from "@/components/results/PipelineResults";
6
 
7
  type WizardStep = "input" | "running";
@@ -103,32 +105,31 @@ export function AnalysisWizard() {
103
  className="w-full px-4 py-3 rounded-xl border border-glass-border focus:border-accent-cyan/40 focus:ring-2 focus:ring-accent-cyan/10 outline-none transition font-mono text-sm resize-none bg-surface-1 text-text-primary"
104
  />
105
 
106
- {/* Step checkboxes */}
107
- <div className="mt-4 space-y-2">
108
  <p className="text-xs font-semibold text-text-muted uppercase tracking-wider">Analysis Steps</p>
109
  {ALL_STEPS.map(s => (
110
- <label key={s.id} className="flex items-center gap-3 cursor-pointer group">
111
- <input
112
- type="checkbox"
113
- checked={enabledSteps.includes(s.id)}
114
- onChange={() => toggleStep(s.id)}
115
- disabled={s.essential}
116
- className="w-4 h-4 rounded border-glass-border bg-surface-1 accent-accent-cyan disabled:opacity-60"
117
- />
118
- <span className={`text-sm ${s.essential ? "text-text-primary" : "text-text-secondary group-hover:text-text-primary transition"}`}>
119
- {s.label}
120
- {s.essential && <span className="text-xs text-text-muted ml-1">(required)</span>}
121
- </span>
122
- </label>
123
  ))}
124
  </div>
125
 
126
  {error && <p className="text-error text-sm mt-3">{error}</p>}
127
 
128
- <button onClick={handleSubmit} disabled={loading}
129
- className="w-full btn-primary py-3 flex items-center justify-center gap-2 mt-4 disabled:opacity-40">
130
- {loading ? <><LoaderCircle className="w-4 h-4 animate-spin" /> Submitting&hellip;</> : <><ArrowRight className="w-4 h-4" /> Run Analysis</>}
131
- </button>
 
 
 
132
  </motion.div>
133
  ) : (
134
  <motion.div
 
2
  import { useState } from "react";
3
  import { motion, AnimatePresence } from "framer-motion";
4
  import { Dna, ArrowRight, LoaderCircle, FileText, CircleCheck, Circle } from "lucide-react";
5
+ import { ClayToggle } from "@/components/ui/ClayToggle";
6
+ import { CriticalButton } from "@/components/ui/CriticalButton";
7
  import { PipelineResults } from "@/components/results/PipelineResults";
8
 
9
  type WizardStep = "input" | "running";
 
105
  className="w-full px-4 py-3 rounded-xl border border-glass-border focus:border-accent-cyan/40 focus:ring-2 focus:ring-accent-cyan/10 outline-none transition font-mono text-sm resize-none bg-surface-1 text-text-primary"
106
  />
107
 
108
+ {/* Analysis step toggles — clay: discrete, low-stakes choices */}
109
+ <div className="mt-4 space-y-2.5">
110
  <p className="text-xs font-semibold text-text-muted uppercase tracking-wider">Analysis Steps</p>
111
  {ALL_STEPS.map(s => (
112
+ <ClayToggle
113
+ key={s.id}
114
+ checked={enabledSteps.includes(s.id)}
115
+ onChange={() => toggleStep(s.id)}
116
+ disabled={s.essential}
117
+ label={s.label}
118
+ hint={s.essential ? 'required' : undefined}
119
+ className="rounded-lg px-3 py-2 hover:bg-surface-1/60 transition-colors"
120
+ />
 
 
 
 
121
  ))}
122
  </div>
123
 
124
  {error && <p className="text-error text-sm mt-3">{error}</p>}
125
 
126
+ <CriticalButton
127
+ onClick={handleSubmit}
128
+ disabled={loading}
129
+ className="mt-4 w-full py-3"
130
+ >
131
+ {loading ? <>Submitting&hellip;</> : <><ArrowRight className="w-4 h-4" /> Run Analysis</>}
132
+ </CriticalButton>
133
  </motion.div>
134
  ) : (
135
  <motion.div
bioai-platform/frontend/tailwind.config.ts CHANGED
@@ -77,6 +77,10 @@ const config: Config = {
77
  'glass-md': '0 4px 32px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.04)',
78
  'glass-lg': '0 8px 48px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.05)',
79
  'nav-active': 'inset 2px 0 0 #00F5D4',
 
 
 
 
80
  },
81
  backgroundImage: {
82
  'grid-subtle':
 
77
  'glass-md': '0 4px 32px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.04)',
78
  'glass-lg': '0 8px 48px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.05)',
79
  'nav-active': 'inset 2px 0 0 #00F5D4',
80
+ 'clay': '5px 5px 12px rgba(0,0,0,0.5), -3px -3px 8px rgba(255,255,255,0.03), inset 0 1px 0 rgba(255,255,255,0.05)',
81
+ 'clay-press':'3px 3px 8px rgba(0,0,0,0.5), -2px -2px 6px rgba(255,255,255,0.02), inset 0 2px 6px rgba(0,0,0,0.35)',
82
+ 'critical': '0 2px 0 rgba(0,0,0,0.3), 0 6px 16px rgba(0,0,0,0.4)',
83
+ 'data-card': '0 1px 2px rgba(0,0,0,0.35)',
84
  },
85
  backgroundImage: {
86
  'grid-subtle':