/* rvatBrowser stylesheet for R/rvatBrowser.R, R/browserMutationPlotModule.R, and
   R/browserTableModule.R. Loaded once in R/rvatBrowser.R */

/* -navbar and sidebar */

@media (max-width: 992px) {
  .navbar-brand {
    padding-top: 0;
    padding-bottom: 0;
  }
}

.navbar {
  background-color: #ffffffff !important;
}

.selectize-input,
.selectize-dropdown-content .option {
  white-space: normal !important;
  word-break: break-word !important;
}

/* Hides the sidebar on pages with class .rvat-hide-sidebar, toggled via the
   "toggleSidebar" custom message handler in rvatBrowser.js */
.rvat-hide-sidebar .bslib-sidebar-layout {
  grid-template-columns: minmax(0, 1fr) !important;
}

.rvat-hide-sidebar .bslib-sidebar-layout > .sidebar {
  display: none !important;
}

.rvat-hide-sidebar .bslib-sidebar-layout > .main {
  grid-column: 1 / -1 !important;
}

/* Compact inputs (from R/browserMutationPlotModule.R) */

.shiny-input-container {
  width: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.checkbox {
  margin: 0 !important;
}

/* Filter chips (Call Rate Filter / Ultra Rare Variants Filter) on the Gene Mutation Plot page */

.rvat-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 6px 10px;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fafafa;
  flex: 0 0 auto;
}

.rvat-filter-chip-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rvat-filter-chip-info {
  color: #6c757d;
  cursor: help;
  font-size: 0.75em;
  margin-left: -7px;
  position: relative;
  top: -4px;
}

/* layout for the association tables */

.rvat-sticky-dt {
  max-width: 100%;
  min-width: 0;
  position: relative;
}

.rvat-sticky-dt .dataTables_scrollHead {
  position: sticky !important;
  top: -30px;
  z-index: 100;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
  max-width: 100%;
  width: 100% !important;
  overflow: hidden;
}

.rvat-sticky-dt .dataTables_scrollHeadInner,
.rvat-sticky-dt .dataTables_scrollHead table,
.rvat-sticky-dt table.dataTable thead,
.rvat-sticky-dt table.dataTable thead th {
  background: #fff;
}

.rvat-sticky-dt table.dataTable:not(.no-footer) thead th {
  position: sticky;
  top: 0;
  z-index: 100;
}

.rvat-sticky-dt .dataTables_wrapper,
.rvat-sticky-dt .dataTables_scroll {
  max-width: 100%;
  min-width: 0;
}

.rvat-sticky-dt .dataTables_scrollBody {
  max-width: 100%;
  overflow-x: auto !important;
}

.rvat-sticky-dt table.dataTable {
  table-layout: fixed;
  width: 100% !important;
  min-width: 0 !important;
}

.rvat-sticky-dt table.dataTable th,
.rvat-sticky-dt table.dataTable td {
  max-width: 130px;
  padding-left: 4px;
  padding-right: 4px;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: normal;
}

.rvat-sticky-dt table.dataTable th {
  line-height: 1.15;
}

.rvat-sticky-dt table.dataTable th.dt-zygosity,
.rvat-sticky-dt table.dataTable td.dt-zygosity {
  width: 125px !important;
  min-width: 125px !important;
  max-width: 125px !important;
  line-height: 1.1;
}

.rvat-sticky-dt table.dataTable th.dt-count,
.rvat-sticky-dt table.dataTable td.dt-count {
  width: 105px !important;
  min-width: 105px !important;
  max-width: 105px !important;
}

/* style the header row of the tables */

.dt-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.dt-buttons {
  float: left !important;
}

.dataTables_filter {
  float: right !important;
  text-align: right !important;
}

/* Smooth in-page scrolling */
html {
  scroll-behavior: smooth;
}

/* Temporary highlight flash applied by rvatBrowserGoToSection() and rvatBrowserHighlightInfoSection() in
   rvatBrowser.js: the highlight stays for 5 seconds and then slowly fades out in 3 seconds */
.rvat-highlight-flash {
  animation: highlight-animation 8s ease-in-out;
  border-radius: 8px;
}

@keyframes highlight-animation {
  0%,
  62.5% {
    background-color: #fff3cd;
    box-shadow: 0 0 0 6px #fff3cd;
  }
  100% {
    background-color: transparent;
    box-shadow: 0 0 0 6px transparent;
  }
}

/* the .rvat-cross class links the ◆ and ◇ markers to their explanation above the table Click handling is in rvatBrowser.js */
.rvat-cross {
  cursor: pointer;
  font-weight: 700;
  color: #111827;
  padding: 0 3px;
  border-radius: 3px;
}

.rvat-cross:hover,
.rvat-cross:focus {
  background-color: #e5e7eb;
  outline: none;
}

/* the ◆ and ◇ symbols in the explanation text (not clickable, unlike .rvat-cross in the table) */
.rvat-cross-symbol {
  font-weight: 700;
  color: #111827;
}

/* Brand colors (kept in sync with PROJECT_MINE_COLORS in R/rvatBrowser_helpers.R) */

.rvat-brand-blue {
  background-color: #021b99;
}

.rvat-brand-red {
  background-color: #eb160d;
}

.rvat-brand-turquoise {
  background-color: #00a39e;
}

.rvat-brand-orange {
  background-color: #f5712e;
}

/* External resource buttons and in-page table-navigation buttons on the Gene Mutation Plot page */

.rvat-resource-link {
  display: flex;
  align-items: center;
  width: 100%;
  font-size: 14px;
  padding: 9px 10px;
  color: white;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.rvat-resource-link:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.rvat-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  font-size: 14px;
  padding: 9px 10px;
  color: white;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.5);
}

/* Home page cards  */

.feature-card-link {
  text-decoration: none;
  color: inherit;
}

.feature-card {
  background-color: #ffffff;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
  height: 100%;
  transition: all 0.2s ease;
  box-shadow: none;
}

.feature-card:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.feature-card img {
  width: 200%;
  max-width: 350px;
  display: block;
  margin: auto;
  margin-bottom: 10px;
}
