/* ============================================================
   MOCR-DB app styles — app shell (navbar, home, tables, footer)
   Adapted from the BioFINDER genetic database reference app.
   ============================================================ */

/* ---------- Navbar: dark navy, bold brand ---------- */
nav.navbar {
  background-color: #222a35 !important;
  border-bottom: 1px solid #3d4a5c;
  min-height: 78px;
  margin-bottom: 0;
  --bs-navbar-color: rgba(255, 255, 255, 0.92);
  --bs-navbar-hover-color: #fff;
  --bs-navbar-active-color: #fff;
}

/* Flex layout so brand + links are vertically centered in the bar */
nav.navbar > .container-fluid {
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  max-width: 1200px;   /* match body content so brand aligns with page */
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

/* Constrain each top-level tab pane to the same centered 1200px as the navbar,
   so inner tabs (LDSC / Causality / SMR) line up with the header + home.
   Target the panes (not the container) so the full-width footer isn't clipped. */
body.bslib-page-navbar > .container-fluid > .tab-content > .tab-pane {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

nav.navbar .navbar-header {
  display: flex;
  align-items: center;
  float: none !important;
  margin-right: 1rem;
}

nav.navbar .navbar-brand,
nav.navbar a.navbar-brand {
  display: inline-flex !important;
  align-items: center;
  gap: 0.6rem;
  height: auto !important;
  margin-left: 0 !important;   /* cancel Bootstrap's -15px so logo aligns with body */
  padding: 0.5rem 0;
  font-size: 2.05rem !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  color: rgba(255, 255, 255, 0.96) !important;
  letter-spacing: 0.3px;
}

nav.navbar .navbar-brand img {
  display: block;
  height: 56px;
  width: auto;
}

@media (min-width: 768px) {
  nav.navbar > .container-fluid > .navbar-collapse {
    display: flex !important;
    align-items: center;
    margin-left: auto !important;
    flex-grow: 0 !important;
  }
}

nav.navbar .navbar-nav {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  float: none !important;
  margin: 0 !important;
}

nav.navbar .navbar-nav > li {
  float: none !important;
  display: flex;
  align-items: center;
}

nav.navbar .navbar-nav > li > a {
  display: flex !important;
  align-items: center;
  font-size: 1.62rem !important;
  font-weight: 600 !important;
  padding: 0.7rem 1.05rem;
  color: rgba(255, 255, 255, 0.9) !important;
  border-bottom: 2px solid transparent;
}

nav.navbar .navbar-nav > li > a:hover,
nav.navbar .navbar-nav > li > a:focus {
  color: #fff !important;
}

nav.navbar .navbar-nav > li.active > a,
nav.navbar .nav-link.active {
  background-color: transparent !important;
  color: #fff !important;
  border-bottom-color: #4aa3ff !important;
}

/* Hide Shiny's page-level "busy pulse" bar (the thin strip at the very top) */
.shiny-busy:after { display: none !important; }

/* ---------- Home tab ---------- */
.hero-container {
  max-width: none;   /* outer container already caps width; avoid double inset */
  margin: 32px 0 0;
  padding: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #333;
}

.home-hero-header {
  border-bottom: 1px solid #eee;
  padding-bottom: 18px;
  margin-bottom: 24px;
}

.home-title {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem);
  font-weight: 700;
  color: #000;
  margin: 0 0 14px;
}

.home-title .hl { color: #007bff; }

.intro-text {
  font-size: 1.42rem;
  color: #444;
  line-height: 1.8;
  font-weight: 300;
  max-width: 1000px;
}

/* Stat tiles (left column of the home overview) */
.stat-item {
  padding: 10px 0;
  border-bottom: 1px dashed #eee;
}
.stat-item:last-child { border-bottom: none; }

.stat-label {
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 3px;
  font-weight: 400;
}

.stat-value {
  font-size: 22px;
  color: #2c3e50;
  font-weight: 300;
  line-height: 1.2;
}

.stat-value-highlight { color: #007bff; }

/* Section headings on home / about */
.section-title {
  font-size: 27px;
  color: #2c3e50;
  margin: 8px 0 14px;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
  font-weight: 600;
}

/* ---------- DataTables polish ---------- */
table.dataTable thead th {
  background: #f4f6f8;
  color: #222a35;
  font-weight: 600;
  border-bottom: 2px solid #d7dee6 !important;
}
table.dataTable tbody tr:hover { background: #f2f8ff !important; }
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid #ccd3da;
  border-radius: 4px;
  padding: 3px 8px;
}

/* ---------- Well panels (control sidebars) ---------- */
.well {
  background: #fcfdfe;
  border: 1px solid #e7ecf1;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.control-label { font-weight: 500; }

/* ---------- Correlation and causality: controls above results ---------- */
.analysis-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
  padding-top: 18px;
}

.analysis-controls > .well {
  width: 100%;
  height: 100%;
  margin-bottom: 18px;
}

.analysis-results > .nav-tabs-custom {
  width: 100%;
}

@media (max-width: 991px) {
  .analysis-controls {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .analysis-controls > .well {
    height: auto;
  }
}

/* ---------- Functional Genes: top-to-bottom analysis workflow ---------- */
.functional-genes-workflow {
  padding-top: 18px;
}

.functional-workflow-row {
  margin-bottom: 20px;
}

.functional-workflow-row .box,
.functional-workflow-row .nav-tabs-custom {
  width: 100%;
  margin-bottom: 0;
}

.table-responsive-container {
  width: 100%;
  overflow-x: auto;
}

td.details-control {
  color: #2878d0;
  cursor: pointer;
  text-align: center;
  font-size: 1.25em;
  width: 30px;
}

/* ---------- Body spacing so fixed footer never overlaps ---------- */
body { padding-bottom: 4rem; box-sizing: border-box; }
