/* ═══════════════════════════════════════════════════════════════
   OmicsLab — Analysis Studio Styles
   ═══════════════════════════════════════════════════════════════ */

/* ── Tab bar ── */
.az-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border, #30363d);
}
.az-tab {
  padding: 0.45rem 0.9rem;
  background: var(--surface2, #161b22);
  border: 1px solid var(--border, #30363d);
  border-radius: 9999px;
  color: var(--text-muted, #8b949e);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.az-tab:hover { border-color: var(--success, #3fb950); color: var(--text, #e6edf3); }
.az-tab.active {
  background: rgba(63,185,80,0.12);
  border-color: var(--success, #3fb950);
  color: var(--success, #3fb950);
}

/* ── Panel ── */
.az-panel-content { display: none; }
.az-panel-content.active { display: block; }

/* ── Input area ── */
.az-input-area {
  background: var(--surface2, #161b22);
  border: 1px solid var(--border, #30363d);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.az-input-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.az-input-title { font-size: 0.95rem; font-weight: 600; color: var(--text, #e6edf3); }
.az-input-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.az-demo-btn, .az-file-btn {
  padding: 0.3rem 0.75rem;
  background: none;
  border: 1px solid var(--border, #30363d);
  border-radius: 6px;
  color: var(--text-muted, #8b949e);
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.az-demo-btn:hover, .az-file-btn:hover { border-color: var(--success, #3fb950); color: var(--success, #3fb950); }
.az-filename { font-size: 0.75rem; color: var(--success, #3fb950); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.az-textarea {
  width: 100%;
  background: var(--surface3, #1c2128);
  border: 1px solid var(--border-dim, #21262d);
  border-radius: 8px;
  color: var(--text, #e6edf3);
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 0.8rem;
  padding: 0.75rem;
  resize: vertical;
  min-height: 160px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s;
  line-height: 1.6;
}
.az-textarea:focus { outline: none; border-color: var(--success, #3fb950); }
.az-textarea::placeholder { color: var(--text-muted, #8b949e); opacity: 0.7; }

.az-run-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.55rem 1.25rem;
  background: var(--success, #3fb950);
  color: #0d1117;
  border: none;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.az-run-btn:hover { opacity: 0.88; }
.az-run-btn:active { transform: scale(0.97); }
.az-run-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Results ── */
.az-result-area { min-height: 2rem; }
.az-result { animation: azFadeIn 0.22s ease; }
@keyframes azFadeIn { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform:none; } }

.az-error {
  padding: 1rem 1.25rem;
  background: rgba(248,81,73,0.08);
  border: 1px solid rgba(248,81,73,0.3);
  border-radius: 8px;
  color: #f85149;
  font-size: 0.86rem;
  line-height: 1.5;
}
.az-notice {
  padding: 0.6rem 1rem;
  background: rgba(88,166,255,0.08);
  border: 1px solid rgba(88,166,255,0.25);
  border-radius: 6px;
  color: #58a6ff;
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

/* ── Stats grid ── */
.az-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.az-stat {
  background: var(--surface2, #161b22);
  border: 1px solid var(--border, #30363d);
  border-radius: 10px;
  padding: 0.85rem 0.75rem;
  text-align: center;
}
.az-stat-val {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text, #e6edf3);
  line-height: 1.2;
}
.az-stat-label { font-size: 0.72rem; color: var(--text-muted, #8b949e); margin-top: 0.2rem; }
.az-pass { color: var(--success, #3fb950) !important; }
.az-warn { color: #e3b341 !important; }
.az-fail { color: #f85149 !important; }

/* ── Charts ── */
.az-chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.az-chart-box {
  background: var(--surface2, #161b22);
  border: 1px solid var(--border, #30363d);
  border-radius: 10px;
  padding: 1rem;
}
.az-chart-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text, #e6edf3);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.az-chart-area { overflow-x: auto; }
.az-chart-xlab { font-size: 0.7rem; color: var(--text-muted, #8b949e); margin-top: 0.35rem; }
.az-legend { display: flex; align-items: center; gap: 0.25rem; font-size: 0.72rem; color: var(--text-muted, #8b949e); }
.az-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ── QC table ── */
.az-qc-table { display: flex; flex-direction: column; gap: 0.35rem; }
.az-qc-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border-dim, #21262d);
  font-size: 0.8rem;
}
.az-qc-key { flex: 1; color: var(--text-muted, #8b949e); }
.az-qc-val { font-weight: 600; color: var(--text, #e6edf3); min-width: 60px; text-align: right; }
.az-badge {
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.az-badge-pass { background: rgba(63,185,80,0.15); color: var(--success, #3fb950); }
.az-badge-warn { background: rgba(227,179,65,0.15); color: #e3b341; }
.az-badge-fail { background: rgba(248,81,73,0.15); color: #f85149; }
.az-badge-mod  { background: rgba(227,179,65,0.15); color: #e3b341; }
.az-badge-high { background: rgba(63,185,80,0.15); color: var(--success, #3fb950); }
.az-badge-low  { background: rgba(248,81,73,0.15); color: #f85149; }

/* ── Two-column panels ── */
.az-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.az-panel {
  background: var(--surface2, #161b22);
  border: 1px solid var(--border, #30363d);
  border-radius: 10px;
  padding: 1rem;
}
.az-panel-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text, #e6edf3);
  margin-bottom: 0.75rem;
}
.az-empty-state { font-size: 0.8rem; color: var(--text-muted, #8b949e); padding: 0.5rem 0; }

/* ── Sequence display ── */
.az-seq-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--success, #3fb950);
  margin-bottom: 1rem;
  font-family: monospace;
}
.az-sequence-box {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text, #e6edf3);
  background: var(--surface3, #1c2128);
  border: 1px solid var(--border-dim, #21262d);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  word-break: break-all;
  line-height: 1.8;
  letter-spacing: 0.02em;
}
.az-protein-box { color: #bc8cff; }

/* ── ORF rows ── */
.az-orf-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border-dim, #21262d);
  font-size: 0.8rem;
}
.az-orf-frame {
  background: rgba(63,185,80,0.15);
  color: var(--success, #3fb950);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.az-orf-pos { color: var(--text-muted, #8b949e); font-family: monospace; font-size: 0.75rem; }
.az-orf-len { color: var(--text, #e6edf3); font-weight: 600; }
.az-orf-prot { color: #58a6ff; font-size: 0.75rem; }

/* ── RE site rows ── */
.az-re-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border-dim, #21262d);
  font-size: 0.8rem;
}
.az-re-name { font-weight: 600; color: var(--text, #e6edf3); min-width: 65px; }
.az-re-cut { background: var(--surface3, #1c2128); padding: 0.1rem 0.35rem; border-radius: 4px; font-size: 0.72rem; color: #f97316; }
.az-re-count { color: var(--success, #3fb950); font-weight: 600; min-width: 25px; }
.az-re-pos { color: var(--text-muted, #8b949e); font-size: 0.72rem; font-family: monospace; }

/* ── Bar charts (chrom/qual/gene) ── */
.az-chrom-row, .az-qd-row, .az-gene-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
}
.az-chrom-name, .az-qd-label, .az-gene-name {
  width: 70px;
  min-width: 70px;
  color: var(--text-muted, #8b949e);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.az-gene-name { width: 100px; min-width: 100px; }
.az-chrom-bar-track { flex: 1; background: var(--surface3, #1c2128); border-radius: 4px; height: 14px; overflow: hidden; }
.az-chrom-bar { height: 100%; background: #58a6ff; border-radius: 4px; transition: width 0.4s ease; min-width: 2px; }
.az-chrom-count { min-width: 50px; text-align: right; color: var(--text, #e6edf3); font-weight: 600; }

/* ── Alignment viewer ── */
.az-aln-container {
  overflow-x: auto;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.75rem;
}
.az-aln-block { margin-bottom: 1.25rem; }
.az-aln-ruler {
  display: flex;
  align-items: center;
  color: var(--text-muted, #8b949e);
  font-size: 0.7rem;
  margin-bottom: 0.2rem;
}
.az-aln-namecol { min-width: 130px; display: inline-block; }
.az-aln-pos { font-size: 0.65rem; }
.az-aln-row {
  display: flex;
  align-items: center;
  margin-bottom: 0.15rem;
}
.az-aln-name {
  min-width: 130px;
  color: var(--text-muted, #8b949e);
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 0.5rem;
}
.az-cons-row .az-aln-name { color: var(--success, #3fb950); font-weight: 600; }
.az-aln-seq { display: flex; flex-wrap: nowrap; }
.az-base {
  display: inline-block;
  width: 10px;
  text-align: center;
  font-weight: 600;
  border-radius: 2px;
  line-height: 1.5;
}
.az-cons-base { font-weight: 700; background: none !important; }

/* ── Analysis section wrapper ── */
.analysis-section {
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .az-chart-row { grid-template-columns: 1fr; }
  .az-two-col { grid-template-columns: 1fr; }
  .az-stats-grid { grid-template-columns: repeat(3, 1fr); }
  .az-tabs { gap: 0.25rem; }
  .az-tab { font-size: 0.78rem; padding: 0.4rem 0.7rem; }
}
@media (max-width: 480px) {
  .az-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .az-input-header { flex-direction: column; align-items: flex-start; }
}
