/* shinydashboard "skin-blue" look to match the original R app:
   dark navy top navbar, dark sidebar (pill list), blue box headers. */

/* ---- top navbar (navbarPage, dark navy) ---- */
.navbar {
  background-color: #2c3e50 !important;
  border: none;
  min-height: 50px;
}
.navbar .navbar-brand {
  color: #fff !important;
  font-weight: 700;
  font-size: 20px;
}
.navbar .nav-link {
  color: #cfd8dc !important;
}
.navbar .nav-link:hover {
  color: #fff !important;
  background-color: #1d2b38 !important;
}
.navbar .nav-link.active,
.navbar .show > .nav-link {
  color: #fff !important;
  background-color: #1d2b38 !important;
}

/* ---- left sidebar (navset_pill_list) ---- */
.nav-pills {
  background-color: #222d32;
  padding: 6px 0;
  border-radius: 0;
  min-height: calc(100vh - 120px);
}
.nav-pills .nav-link {
  color: #b8c7ce;
  border-radius: 3px;
  margin: 1px 6px;
  padding: 11px 12px;
  font-weight: 600;
  font-size: 14px;
}
.nav-pills .nav-link:hover {
  color: #fff;
  background-color: #1e282c;
}
.nav-pills .nav-link.active {
  color: #fff !important;
  background-color: #3c8dbc !important;
}

/* ---- box headers (cards): solid blue, white text ---- */
.card > .card-header {
  background-color: #3c8dbc;
  color: #fff;
  font-weight: 400;
  font-size: 18px;
  border-bottom: 1px solid #2e6d92;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ---- collapsible box toggle (box(collapsible = TRUE)) ---- */
.scibd-collapse-btn {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
  margin-left: 8px;
  cursor: pointer;
  opacity: 0.85;
}
.scibd-collapse-btn:hover {
  opacity: 1;
}
.card.scibd-collapsed > .card-body,
.card.scibd-collapsed > .card-footer {
  display: none !important;
}

/* ---- embedded info icon in input labels (shinyInput_label_embed) ---- */
.scibd-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.scibd-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #18bc9c;
  color: #fff;
  font-family: "Times New Roman", Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

/* ---- download footer: circular blue gear + minimal blue Download link ----
   matches R dropdownButton(circle=TRUE, status="info", icon=cog) +
   downloadBttn(style="minimal", color="primary"). */
.scibd-card-footer {
  display: flex;
  align-items: center;
  gap: 12px;
}
.scibd-gear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background-color: #3498db;
  color: #fff;
  cursor: pointer;
}
.scibd-gear-btn:hover {
  background-color: #2c81ba;
}
.scibd-dl-btn,
.scibd-dl-btn:hover,
.scibd-dl-btn:focus,
.scibd-dl-btn:active {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  color: #2196f3;
  background: transparent;
  border: none;
  box-shadow: none;
  font-weight: 600;
}
.scibd-dl-btn:hover {
  border-bottom: 1px solid #2196f3;
}

/* ---- taller rows in the FDA approved-drugs table ---- */
.scibd-fda-table td,
.scibd-fda-table th {
  padding-top: 9px;
  padding-bottom: 9px;
  vertical-align: middle;
}

/* ---- dropdowns must not be clipped by the card's overflow ---- */
.bslib-card:has(.selectize-control),
.bslib-card:has(.selectize-control) .card-body,
.bslib-card:has(.bootstrap-select),
.bslib-card:has(.bootstrap-select) .card-body {
  overflow: visible !important;
}
.selectize-dropdown {
  z-index: 9999;
}
.bootstrap-select .dropdown-menu {
  z-index: 9999;
}

/* ---- DataTables tables rendered through itables ---- */
table.scibd-dt {
  width: 100% !important;
}
table.scibd-dt tfoot {
  display: table-header-group !important;
}
table.scibd-dt tfoot th,
table.scibd-dt thead tr.scibd-dt-filter-row th {
  padding: 8px 10px;
  border-bottom: 1px solid #ddd;
}
table.scibd-dt tfoot input,
table.scibd-dt thead tr.scibd-dt-filter-row input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d2d6de;
  border-radius: 3px;
  padding: 6px 10px;
  color: #555;
}

/* ---- Shiny native DataTable sizing ---- */
shiny-data-frame,
shiny-data-frame .shiny-data-grid {
  width: 100% !important;
  max-width: 100% !important;
}
shiny-data-frame .shiny-data-grid > table {
  width: 100% !important;
  table-layout: fixed;
}
shiny-data-frame .shiny-data-grid > table > thead > tr > th {
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  vertical-align: middle;
}
shiny-data-frame .shiny-data-grid > table > tbody > tr > td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
shiny-data-frame .shiny-data-grid > table.filtering > thead > tr.filters > th > input {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
