﻿/* ═══════════════════════════════════════════════════════════
   BioFoldX — Design System & Component Styles
   ═══════════════════════════════════════════════════════════ */

:root {
  --navy:    #0B132B;
  --navy-2:  #0d1a36;
  --navy-3:  #0f2040;
  --cyber:   #00F0FF;
  --emerald: #00D68F;
  --violet:  #7B61FF;
  --amber:   #F59E0B;
  --rose:    #FF4D6D;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--navy);
  color: #fff;
  overflow: hidden;
}

/* ─── Scrollbar ─── */
.custom-scroll::-webkit-scrollbar { width: 4px; }
.custom-scroll::-webkit-scrollbar-track { background: transparent; }
.custom-scroll::-webkit-scrollbar-thumb { background: rgba(0,240,255,0.15); border-radius: 2px; }
.custom-scroll::-webkit-scrollbar-thumb:hover { background: rgba(0,240,255,0.35); }

/* ─── Header ─── */
.header-glow {
  background: rgba(13,26,54,0.95);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06), 0 4px 24px rgba(0,0,0,0.3);
}

.helix-container {
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0,240,255,0.15), rgba(123,97,255,0.15));
  border: 1px solid rgba(0,240,255,0.25);
  box-shadow: 0 0 20px rgba(0,240,255,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
  animation: helixPulse 3s ease-in-out infinite;
}

@keyframes helixPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(0,240,255,0.2), inset 0 1px 0 rgba(255,255,255,0.1); }
  50%       { box-shadow: 0 0 32px rgba(0,240,255,0.4), inset 0 1px 0 rgba(255,255,255,0.15); }
}

.logo-text {
  background: linear-gradient(90deg, #fff 0%, rgba(0,240,255,0.8) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Workflow Steps ─── */
.wf-step {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.03);
  transition: all 0.3s ease;
  white-space: nowrap;
}
.wf-step.active { border-color: rgba(0,240,255,0.5); color: #00F0FF; background: rgba(0,240,255,0.08); box-shadow: 0 0 12px rgba(0,240,255,0.15); }
.wf-step.done   { border-color: rgba(0,214,143,0.4); color: #00D68F; background: rgba(0,214,143,0.06); }
.wf-connector { width: 24px; height: 1px; background: rgba(255,255,255,0.1); margin: 0 2px; }
.wf-connector.done-conn { background: rgba(0,214,143,0.4); }

/* ─── PDPA Badge ─── */
.pdpa-badge {
  background: rgba(0,214,143,0.08);
  border: 1px solid rgba(0,214,143,0.2);
  border-radius: 8px;
  cursor: default;
}

/* ─── Export Button ─── */
.export-btn {
  background: rgba(0,240,255,0.1);
  border: 1px solid rgba(0,240,255,0.25);
  color: #00F0FF;
  transition: all 0.2s ease;
}
.export-btn:hover {
  background: rgba(0,240,255,0.2);
  border-color: rgba(0,240,255,0.6);
  box-shadow: 0 0 18px rgba(0,240,255,0.25);
}

/* ─── Sidebar ─── */
.sidebar {
  background: rgba(13,26,54,0.7);
  backdrop-filter: blur(16px);
}

.sidebar-section-title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: rgba(255,255,255,0.75);
}

/* ─── Step Badges ─── */
.step-badge {
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 6px;
  font-size: 10px; font-weight: 800; letter-spacing: 0;
  flex-shrink: 0;
}
.step-cyan   { background: rgba(0,240,255,0.12); border: 1px solid rgba(0,240,255,0.35); color: #00F0FF; }
.step-violet { background: rgba(123,97,255,0.12); border: 1px solid rgba(123,97,255,0.35); color: #7B61FF; }
.step-emerald { background: rgba(0,214,143,0.12); border: 1px solid rgba(0,214,143,0.35); color: #00D68F; }
.step-rose   { background: rgba(255,77,109,0.12); border: 1px solid rgba(255,77,109,0.35); color: #FF4D6D; }

/* ─── Drop Zone ─── */
.drop-zone {
  border: 2px dashed rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.015);
}
.drop-zone:hover, .drop-zone-active {
  border-color: rgba(0,240,255,0.5) !important;
  background: rgba(0,240,255,0.04) !important;
}
.drop-icon {
  background: rgba(0,240,255,0.08);
  border: 1px solid rgba(0,240,255,0.15);
}

/* ─── Sequence Textarea ─── */
.seq-textarea {
  background: rgba(19,37,72,0.6);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(0,240,255,0.85);
  font-family: 'JetBrains Mono', monospace;
}
.seq-textarea::placeholder { color: rgba(255,255,255,0.15); }
.seq-textarea:hover  { border-color: rgba(255,255,255,0.15); }
.seq-textarea:focus  { border-color: rgba(0,240,255,0.45); box-shadow: 0 0 0 3px rgba(0,240,255,0.06); }

/* ─── Process Button ─── */
.process-btn {
  background: linear-gradient(135deg, rgba(0,240,255,0.85), rgba(123,97,255,0.7));
  color: #0B132B;
  border: 1px solid rgba(0,240,255,0.4);
  font-weight: 700;
}
.process-btn:hover {
  background: linear-gradient(135deg, #00F0FF, #7B61FF);
  box-shadow: 0 0 28px rgba(0,240,255,0.35), 0 0 60px rgba(123,97,255,0.15);
  transform: translateY(-1px);
}

/* ─── Progress Bar ─── */
.progress-track { background: rgba(255,255,255,0.06); }
.progress-bar { background: linear-gradient(90deg, #00F0FF, #7B61FF); position: relative; overflow: hidden; }
.progress-bar::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* ─── Status Pill ─── */
.status-pill {
  font-size: 9px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.35);
}
.status-pill.running { background: rgba(0,240,255,0.1); border-color: rgba(0,240,255,0.3); color: #00F0FF; }
.status-pill.done    { background: rgba(0,214,143,0.1); border-color: rgba(0,214,143,0.3); color: #00D68F; }

/* ─── Metric Cards ─── */
.metric-card {
  display: flex; flex-direction: column; gap: 4px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 10px 12px;
}
.metric-label { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.35); }
.metric-value { font-family: 'JetBrains Mono', monospace; font-size: 18px; font-weight: 700; line-height: 1; }

/* ─── Candidate Items ─── */
.candidate-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  transition: all 0.2s ease;
}
.candidate-item:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.12); }
.candidate-active { background: rgba(0,240,255,0.08) !important; border-color: rgba(0,240,255,0.35) !important; }

/* ─── View Mode Sidebar Buttons ─── */
.view-sidebar-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 11px; font-weight: 600;
  color: rgba(255,255,255,0.45);
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  cursor: pointer; transition: all 0.2s ease;
}
.view-sidebar-btn:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.75); }
.active-view-btn { background: rgba(0,240,255,0.1) !important; border-color: rgba(0,240,255,0.3) !important; color: #00F0FF !important; }

/* ─── Toggle ─── */
.toggle-track {
  width: 38px; height: 20px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  position: relative; transition: background 0.3s ease;
}
.toggle-on { background: rgba(0,214,143,0.4) !important; border-color: rgba(0,214,143,0.5) !important; }
.toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: all 0.3s ease;
}

/* ─── Range Sliders ─── */
.range-slider {
  -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 2px; outline: none; cursor: pointer;
}
.range-cyan  { background: linear-gradient(to right, #00F0FF var(--v, 21%), rgba(255,255,255,0.1) var(--v, 21%)); }
.range-amber { background: linear-gradient(to right, #F59E0B var(--v, 35%), rgba(255,255,255,0.1) var(--v, 35%)); }
.range-violet { background: linear-gradient(to right, #7B61FF var(--v, 53%), rgba(255,255,255,0.1) var(--v, 53%)); }
.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(0,0,0,0.4);
  cursor: pointer; transition: transform 0.2s ease;
}
.range-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* ─── AA Select ─── */
.aa-select {
  background: rgba(19,37,72,0.7);
  border: 1px solid rgba(255,255,255,0.08);
  transition: border-color 0.2s ease;
}
.aa-select:focus { border-color: rgba(0,240,255,0.4); }
.aa-select option { background: #0d1a36; }

/* ─── Mutation Apply Button ─── */
.mut-apply-btn {
  background: rgba(0,214,143,0.1);
  border: 1px solid rgba(0,214,143,0.25);
  color: #00D68F;
}
.mut-apply-btn:hover {
  background: rgba(0,214,143,0.2);
  border-color: rgba(0,214,143,0.55);
  box-shadow: 0 0 16px rgba(0,214,143,0.2);
}

/* ─── Live Metrics Box ─── */
.live-metrics-box {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
}

/* ─── Viewport Overlays ─── */
.scanline-overlay {
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,240,255,0.008) 2px, rgba(0,240,255,0.008) 4px);
  pointer-events: none;
}
.corner-grid {
  background-image:
    linear-gradient(rgba(0,240,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,240,255,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 80%);
}

/* ─── View Mode Buttons (Viewport) ─── */
.view-mode-group {
  background: rgba(11,19,43,0.85);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}
.view-mode-btn {
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 11px; font-weight: 600;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}
.view-mode-btn:hover { color: rgba(255,255,255,0.75); background: rgba(255,255,255,0.06); }
.vm-active { color: #00F0FF !important; background: rgba(0,240,255,0.1) !important; border-color: rgba(0,240,255,0.3) !important; }

/* ─── Viewport Buttons ─── */
.viewport-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}
.viewport-btn:hover { color: #00F0FF; background: rgba(0,240,255,0.1); border-color: rgba(0,240,255,0.25); }
.viewport-btn.rotating { color: #00F0FF; background: rgba(0,240,255,0.12); border-color: rgba(0,240,255,0.35); }

/* ─── Glass Panel ─── */
.glass-panel {
  background: rgba(11,19,43,0.8);
  border: 1px solid rgba(255,255,255,0.07);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

/* ─── Atom Tooltip ─── */
.atom-tooltip {
  background: rgba(11,19,43,0.95);
  border: 1px solid rgba(0,240,255,0.3);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 12px rgba(0,240,255,0.15);
}

/* ─── Toast ─── */
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px;
  background: rgba(11,19,43,0.95);
  border: 1px solid rgba(0,240,255,0.25);
  border-radius: 12px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 16px rgba(0,240,255,0.1);
  font-size: 12px;
  animation: toastSlide 0.35s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: auto;
  width: 100%;
}
.toast.toast-success { border-color: rgba(0,214,143,0.3); box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 16px rgba(0,214,143,0.1); }
.toast.toast-warning { border-color: rgba(245,158,11,0.3); }
.toast.toast-error   { border-color: rgba(255,77,109,0.3); }
@keyframes toastSlide {
  from { opacity: 0; transform: translateX(100%) scale(0.9); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
.toast-exit { animation: toastFade 0.3s ease forwards; }
@keyframes toastFade {
  to { opacity: 0; transform: translateX(40px); max-height: 0; margin: 0; padding: 0; }
}

/* ─── Status Bar ─── */
.status-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px;
  color: rgba(255,255,255,0.35);
}
.status-item strong { font-weight: 600; }

/* ─── Utility: Pulse Glow ─── */
@keyframes pulseGlow {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; }
}
.pulse-glow { animation: pulseGlow 2s ease-in-out infinite; }

/* ─── Mutation panel disabled state ─── */
#mutation-panel.enabled {
  opacity: 1 !important;
  pointer-events: auto !important;
}
