/* ═══════════════════════════════════════════════════════════════
   OmicsLab — RNA Expression Atlas
   ═══════════════════════════════════════════════════════════════ */

.ra-page { max-width: 1280px; margin: 0 auto; padding: 2.5rem 1.5rem 5rem; }

/* Header */
.ra-header { text-align: center; margin-bottom: 1.75rem; }
.ra-title {
  font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800;
  background: linear-gradient(135deg, #f85149, #f97316, #e3b341);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin: 0 0 0.4rem;
}
.ra-subtitle { font-size: 0.86rem; color: #8b949e; max-width: 660px; margin: 0 auto; }

/* Study tabs */
.ra-study-tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.ra-study-btn {
  padding: 0.45rem 0.85rem; border-radius: 8px; border: 1px solid #30363d;
  background: var(--bg-card, #161b22); color: #8b949e;
  font-size: 0.76rem; font-weight: 600; cursor: pointer; transition: all 0.18s;
  text-align: left; flex: 1; min-width: 200px;
}
.ra-study-btn:hover { border-color: #58a6ff; color: #c9d1d9; }
.ra-study-btn.active { background: rgba(255,255,255,0.04); }

/* Study info bar */
.ra-study-info {
  display: flex; gap: 1.25rem; margin-bottom: 1.25rem;
  background: var(--bg-card, #161b22); border: 1px solid #21262d;
  border-radius: 10px; padding: 1rem 1.25rem; align-items: flex-start; flex-wrap: wrap;
}
.ra-study-meta { flex: 1; min-width: 260px; }
.ra-meta-row { display: flex; gap: 0.5rem; margin-bottom: 0.25rem; align-items: baseline; font-size: 0.78rem; }
.ra-meta-label { color: #8b949e; font-weight: 600; min-width: 60px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; }
.ra-meta-val { color: #c9d1d9; }

/* DEG counts */
.ra-counts-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.ra-count-box {
  display: flex; flex-direction: column; align-items: center;
  background: #0d1117; border: 1px solid #21262d; border-radius: 8px;
  padding: 0.6rem 0.9rem; min-width: 80px;
}
.ra-count-n { font-size: 1.4rem; font-weight: 800; font-family: monospace; }
.ra-count-l { font-size: 0.62rem; color: #8b949e; margin-top: 0.1rem; }

/* Threshold controls */
.ra-threshold-row {
  display: flex; gap: 1.25rem; align-items: center; margin-bottom: 1rem;
  padding: 0.5rem 0.85rem; background: var(--bg-card,#161b22);
  border: 1px solid #21262d; border-radius: 8px; flex-wrap: wrap;
}
.ra-thresh-label { font-size: 0.72rem; font-weight: 700; color: #8b949e; text-transform: uppercase; letter-spacing: 0.05em; }
.ra-thresh-item { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: #c9d1d9; }
.ra-thresh-select {
  background: #0d1117; border: 1px solid #30363d; color: #c9d1d9;
  border-radius: 5px; padding: 0.2rem 0.4rem; font-size: 0.78rem; cursor: pointer;
}

/* View tabs */
.ra-view-tabs { display: flex; gap: 0; margin-bottom: 1.25rem; border-radius: 8px; overflow: hidden; border: 1px solid #21262d; width: fit-content; }
.ra-view-btn {
  padding: 0.5rem 1.1rem; background: var(--bg-card,#161b22); border: none;
  color: #8b949e; font-size: 0.78rem; font-weight: 600; cursor: pointer;
  border-right: 1px solid #21262d; transition: all 0.18s;
}
.ra-view-btn:last-child { border-right: none; }
.ra-view-btn:hover { background: #21262d; color: #c9d1d9; }
.ra-view-btn.active { background: rgba(88,166,255,0.1); color: #58a6ff; }

/* Workspace */
.ra-workspace { display: grid; grid-template-columns: 1fr 280px; gap: 1.25rem; }

/* Viz area */
.ra-viz {
  background: #0d1117; border: 1px solid #21262d; border-radius: 10px;
  overflow: auto; min-height: 420px; display: flex; align-items: flex-start;
}
.ra-viz svg { max-width: 100%; display: block; }

/* Gene grid */
.ra-gene-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.75rem; padding: 1rem; width: 100%; }
.ra-gene-card {
  background: var(--bg-card, #161b22); border: 1px solid #21262d;
  border-radius: 8px; padding: 0.85rem;
}
.ra-gene-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; }
.ra-gene-symbol { font-size: 1rem; font-weight: 800; font-family: monospace; }
.ra-gene-dir { padding: 0.12rem 0.5rem; border-radius: 10px; font-size: 0.62rem; font-weight: 700; }
.ra-gene-stats { display: flex; gap: 0.6rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.ra-stat { display: flex; flex-direction: column; gap: 0.05rem; }
.ra-stat-label { font-size: 0.6rem; color: #8b949e; text-transform: uppercase; letter-spacing: 0.04em; }
.ra-stat-val { font-size: 0.8rem; font-weight: 700; font-family: monospace; color: #c9d1d9; }
.ra-gene-note { font-size: 0.75rem; color: #8b949e; line-height: 1.5; margin: 0; }

/* Sidebar */
.ra-sidebar { display: flex; flex-direction: column; gap: 1rem; }
.ra-context-box, .ra-gene-detail {
  background: var(--bg-card, #161b22); border: 1px solid #21262d;
  border-radius: 10px; padding: 1rem;
}
.ra-sidebar-title {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: #8b949e; margin-bottom: 0.6rem;
}
.ra-context-text { font-size: 0.79rem; color: #8b949e; line-height: 1.65; margin: 0; }
.ra-doi { font-size: 0.72rem; color: #58a6ff; font-family: monospace; margin: 0; }
.ra-gene-hint { font-size: 0.78rem; color: #8b949e; line-height: 1.6; margin: 0; }
.ra-gene-detail-stats { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.8rem; }
.ra-gene-detail-stats div { display: flex; justify-content: space-between; padding: 0.2rem 0; border-bottom: 1px solid #21262d; }

/* Vol dot interactivity */
.vol-dot { cursor: pointer; transition: r 0.1s; }
.vol-dot:hover { r: 7; }

/* Responsive */
@media (max-width: 980px) {
  .ra-workspace { grid-template-columns: 1fr; }
  .ra-sidebar { flex-direction: row; flex-wrap: wrap; }
  .ra-context-box, .ra-gene-detail { flex: 1; min-width: 240px; }
}
@media (max-width: 640px) {
  .ra-page { padding: 1.25rem 0.75rem 3rem; }
  .ra-study-btn { min-width: 100%; }
  .ra-view-btn { padding: 0.4rem 0.7rem; font-size: 0.72rem; }
}
