/* ═══════════════════════════════════════════════
   NGEP – Global Styles
   ═══════════════════════════════════════════════ */

:root {
  --ngep-primary:   #0d6efd;
  --ngep-success:   #198754;
  --ngep-danger:    #dc3545;
  --ngep-warning:   #ffc107;
  --ngep-surface:   #f8fafc;
  --ngep-border:    #e2e8f0;
  --ngep-text:      #1e293b;
  --ngep-muted:     #64748b;
}

/* ── Base ─────────────────────────────────────── */
body {
  background-color: var(--ngep-surface);
  color: var(--ngep-text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

/* ── Navbar ───────────────────────────────────── */
.bg-primary-gradient {
  background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
}

.navbar-brand .brand-icon {
  font-size: 1.4rem;
}

.navbar-nav .nav-link {
  color: rgba(255,255,255,0.85) !important;
  transition: background 0.2s, color 0.2s;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  background: rgba(255,255,255,0.15);
  color: #fff !important;
}

/* ── Index Bar ────────────────────────────────── */
.index-bar {
  background: rgba(13, 110, 253, 0.9);
  backdrop-filter: blur(4px);
  transition: opacity 0.5s;
}

.index-bar.done {
  background: rgba(25, 135, 84, 0.9);
}

/* ── Hero Section ─────────────────────────────── */
.hero-section {
  background: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%);
  position: relative;
  min-height: 340px;
  display: flex;
  align-items: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.08) 0%, transparent 50%),
                    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.06) 0%, transparent 40%);
}

.text-white-75 { color: rgba(255,255,255,0.75) !important; }

/* ── Stat Cards ───────────────────────────────── */
.stat-card {
  transition: transform 0.2s, box-shadow 0.2s;
  border-radius: 12px;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.12) !important;
}

.stat-value { line-height: 1; }
.stat-label { font-size: 0.75rem; letter-spacing: 0.03em; }

/* ── Step Badge ───────────────────────────────── */
.step-badge {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
}

/* ── Feature Icon ─────────────────────────────── */
.feature-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 12px;
}

/* ── Autocomplete ─────────────────────────────── */
.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--ngep-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 1050;
  max-height: 260px;
  overflow-y: auto;
}

.autocomplete-item {
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--ngep-border);
  transition: background 0.1s;
}

.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: #f0f4ff; color: var(--ngep-primary); }

/* ── Mini Stat ────────────────────────────────── */
.mini-stat .fw-bold { font-size: 1.1rem; }
.tiny-label { font-size: 0.68rem; color: var(--ngep-muted); }

/* ── Essentiality Gauge ───────────────────────── */
.essentiality-gauge .progress { border-radius: 8px; overflow: visible; }

/* ── Legend Dot ───────────────────────────────── */
.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Confusion Matrix ─────────────────────────── */
.cm-grid {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  grid-template-rows: auto 1fr 1fr;
  gap: 4px;
}

.cm-header, .cm-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
}

.cm-cell {
  border-radius: 8px;
  transition: transform 0.2s;
}

.cm-cell:hover { transform: scale(1.03); }

/* ── Cards ────────────────────────────────────── */
.card { border-radius: 12px; }
.card-header { border-radius: 12px 12px 0 0 !important; }

/* ── Table Tweaks ─────────────────────────────── */
.table > :not(caption) > * > * {
  padding: 0.5rem 0.75rem;
  vertical-align: middle;
}

/* ── DataTables override ──────────────────────── */
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid var(--ngep-border);
  border-radius: 8px;
  padding: 4px 10px;
}

/* ── Footer ───────────────────────────────────── */
.footer { background: #fff; }

/* ── Cytoscape container ──────────────────────── */
#cy {
  border: 1px solid var(--ngep-border);
}

/* ── Progress bar ─────────────────────────────── */
.progress { border-radius: 99px; }
.progress-bar { border-radius: 99px; }

/* ── Source Cards ─────────────────────────────── */
.source-card-wp {
  border-left: 4px solid #0d6efd !important;
}
.source-card-reactome {
  border-left: 4px solid #ffc107 !important;
}
.source-badge-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 768px) {
  .hero-section { min-height: 280px; padding: 2rem !important; }
  .display-5 { font-size: 1.6rem; }
}

/* ── Dark mode support ────────────────────────── */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #0f172a;
    color: #e2e8f0;
  }
  .card, .footer { background: #1e293b !important; color: #e2e8f0; }
  .card-header { background: #1e293b; }
  .table { color: #e2e8f0; }
  .table-light { background: #334155; }
  .table-light th { color: #94a3b8; }
  .table-hover > tbody > tr:hover { background: rgba(255,255,255,0.05); }
  .autocomplete-list { background: #1e293b; border-color: #334155; }
  .autocomplete-item:hover { background: #334155; }
  .form-control, .form-select {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #334155;
  }
  #cy { background: #1e293b !important; }
  .bg-light { background: #334155 !important; }
  .text-muted { color: #94a3b8 !important; }
  .border-top { border-color: #334155 !important; }
}
