/* Base typography */
body {
  font-family: Helvetica, Arial, sans-serif;
  color: #2f2f2f;
  background-color: #f8fbfe;
}

/* top navbar */
.navbar {
  background-color: #ffffff !important;
  border-bottom: 1px solid #e5e5e5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  margin-bottom: 0;
}

.navbar-brand,
.navbar-nav > li > a {
  font-family: Helvetica, Arial, sans-serif;
  color: #2f2f2f !important;
  font-weight: 400;
}

/* active tab */
.navbar-nav > .active > a,
.navbar-nav > .active > a:hover,
.navbar-nav > .active > a:focus {
  background-color: transparent !important;
  color: #0A9F9D !important;
  font-weight: 600;
  border-bottom: 2px solid #0A9F9D;
}

/* hover */
.navbar-nav > li > a:hover {
  color: #0A9F9D !important;
  background-color: transparent !important;
}

/* base links */
.nav-item > a {
  color: #2f2f2f !important;
  border-radius: 8px;
  padding: 8px 14px;
  transition: all 0.2s ease;
}

/* ACTIVE tab (your case) */
.nav-item.active > a,
.nav-item.active > a:hover,
.nav-item.active > a:focus {
  background-color: #0A9F9D !important;
  color: white !important;
  border-bottom: none !important;
}

/* hover (inactive tabs) */
.nav-item > a:hover {
  background-color: rgba(10, 159, 157, 0.1);
  color: #0A9F9D !important;
}


/* tab content area */
.tab-content {
  background: transparent;
}

/* home page section */

.home-container {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  margin: 0 auto;
}

.home-hero {
  width: 100%;
  min-height: 25vh; 
  margin-top: 80px;
  margin-bottom: 20px;
}

.home-hero h1 {
  font-size: 64px;
  font-weight: 800;
  margin-top: 20px;
  margin-bottom: 40px;
  text-transform: none;
  letter-spacing: 0;
  text-align: center;
}

.home-hero h1:before,
.home-hero h1:after {
  display: none;
}

.home-hero .lead {
  margin: 0 auto;
  text-align: center;
}

.home-subtitle {
  opacity: 0;
  transform: translateY(24px);
  animation: subtitleFlyIn 0.9s ease-out 0.2s forwards;
}

@keyframes subtitleFlyIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.home-section {
  border-radius: 5px;
  padding: 30px;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.home-section:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); 
  transform: translateY(-2px);               
}

.section-header {
  border-top: 3px solid #0A9F9D;
  border-bottom: 3px solid #0A9F9D;

  color: #2f2f2f;
  background: transparent;
  font-size: 28px;
  font-weight: 400;
  text-align: center;
  padding: 10px 20px;
  margin-bottom: 20px;
}

.section-text {
  text-align: left;
}


.home-buttons {
  text-align: center;
  margin-top: 30px;
}

.home-buttons .btn {
  margin: 0 8px 10px 8px;
}

.btn-primary {
  background-color: #0A9F9D !important;
  border-color: #0A9F9D !important;
}

.btn-primary:hover {
  background-color: #088785 !important;
  border-color: #088785 !important;
}


.doc-hero {
  width: 100%;
  min-height: 120px;

  background: linear-gradient(90deg, #153b63, #0A9F9D);

  display: flex;
  align-items: center;

  margin-bottom: 30px;
}

.doc-hero-content {
  width: 100%;
  max-width: 1200px;
  margin: 0;
  padding: 0 40px;
}

.doc-hero h2 {
  margin: 0;
  color: white;

  font-size: 52px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.doc-section {
  margin-left: 40px;
}

.doc-section h4 {
  font-weight: 700;
}

.doc-updated {
  margin: -8px 0 12px 0;
  font-size: 13px;
  color: #888;
}

.table-header {
  width: 100%;
  text-align: left;
  margin: 10px 0 20px 0;
}

.table-header h3 {
  font-size: 24px;
  font-weight: 600;
  color: #0b0f7a;  
  margin: 0;
}


/* Explore tab */

.tabbable {
  margin-top: 20px;
}

.filter-box {
  border: 2px solid #e3e7eb;
  border-radius: 14px;
  padding: 18px 18px 8px 18px;
  margin-bottom: 18px;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.filter-box:hover {
  border-color: #c7d0d9;
}

.filter-box.active {
  border-color: #0A9F9D;
  box-shadow: 0 0 0 3px rgba(10, 159, 157, 0.10);
}

.filter-box-header {
  align-items: left;
  gap: 10px;
  margin-bottom: 8px;
}

.filter-box-header h4 {
  margin: 0;
}

.filter-box .checkbox {
  margin: 0;
}

.filter-box .checkbox input[type="checkbox"] {
  margin-top: 0;
}

.info-icon {
  color:#0A9F9D; 
  cursor:pointer; 
  font-size:12px; 
  margin-bottom: 2px; 
  margin-left: 0
}

.action-button {
  margin-bottom: 10px;
}

/* Slider label (title text) */
.irs--shiny .irs-grid-text,
.irs--shiny .irs-single,
.irs--shiny .irs-from,
.irs--shiny .irs-to,
.irs--shiny .irs-min,
.irs--shiny .irs-max {
  font-size: 14px !important;
}

/* Shiny Radio */

#cryptic_bhp .shiny-options-group {
  display: flex;
  width: 100%;
}

#cryptic_bhp .radio-inline {
  flex: 1;
  text-align: center;
}

#cryptic_bhp .radio-inline {
  font-weight: 400 !important;
}

/* All plots */

.text-muted-explore {
  font-style: italic;
  color: #6c757d; 
}

.plot-container {
  margin-top: 20px;
}

.plot-header {
  width: 100%;
  text-align: center;
  margin: 10px 0 20px 0;
}

.plot-header h3 {
  font-size: 24px;
  font-weight: 600;
  color: #0b0f7a;  
  margin: 0;
}

.plot-main {
  position: relative;
  background: #ffffff;
  border-radius: 14px;
  padding: 10px;
  min-height: 400px;

  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  margin-bottom: 30px;
}

.plot-controls:hover,
.plot-main:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s ease;
}

/* Cluster buttons (shinyWidgets::checkboxGroupButtons, inputId "clustersToPlot").
   Bootstrap 3's .btn-default gives :hover/:focus the same grey as .active, so a
   just-deselected button (still hovered + focused after the click) kept looking
   selected until blurred. Pin the colour to the selection state only. */
#clustersToPlot .btn-default,
#clustersToPlot .btn-default:hover,
#clustersToPlot .btn-default:focus,
#clustersToPlot .btn-default.focus,
#clustersToPlot .btn-default:active,
#clustersToPlot .btn-default:active:focus,
#clustersToPlot .btn-default:active:hover {
  background-color: #fff !important;
  border-color: #ccc !important;
  color: #333;
  box-shadow: none !important;
  outline: none;
}

#clustersToPlot .btn-default.active,
#clustersToPlot .btn-default.active:hover,
#clustersToPlot .btn-default.active:focus,
#clustersToPlot .btn-default.active.focus,
#clustersToPlot .btn-default.active:active {
  background-color: #e6e6e6 !important;
  border-color: #adadad !important;
  color: #333;
  box-shadow: inset 0 3px 5px rgba(0,0,0,.125) !important;
}

/* Legend colour_by */

.cluster-legend {
  margin-top: 10px;
}

.cluster-legend-section {
  margin-top: 12px;
}

.cluster-legend-title {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 14px;
  color: #2f2f2f;
}

.cluster-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.cluster-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
  border: 1px solid rgba(0,0,0,0.2);
  flex: 0 0 14px;
}

.cluster-legend-label {
  font-size: 12px;
  color: #333;
}


#hoverCanvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 10;
}

/* Cluster plot */

#clusterWrap{
  position: relative;
  width: 100%;
  height: 85vh;

  overflow-y: auto;
  overflow-x: auto;
}

#clusterPlotWrap{
  position: relative;
  width: 100%;
}

.plot-empty-msg{
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 50;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.92);
  font-size: 16px;
  color: #2f2f2f;
}

#clusterPlot img{
  display: block;
  width: 100% !important;   
  height: auto !important;
  max-width: 100% !important;
}

/* Source heatmap + legend layout */
.hm-layout{
  display: flex;
  align-items: flex-start;
  gap: 8px;
  justify-content: flex-start;
}

/* Plot area */
.hm-plot{
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;

  position: relative;
  z-index: 1;

}

/* Legend column */
.hm-legend{
  flex: 0 0 300px;
  max-height: 85vh;
  overflow-y: auto;
  padding-top: 3rem;

  position: relative;
  z-index: 5;
  background: transparent;
}

/* Legend container */
.hm-legend-col{
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 12px 0;
}

.hm-legend-text {
  font-size: 14px;    
}

/* Legend buttons */

.hm-legend-btn {
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 0.85rem;
  line-height: 1.2;
  white-space: nowrap;
  width: fit-content;

  transition: 
    transform 80ms ease, 
    box-shadow 120ms ease, 
    opacity 120ms ease;

  /* OFF state */
  &.is-off {
    background: #fff;
    border: 1px solid #ddd;
    color: #333;
    opacity: 1;
    box-shadow: none;
  }

  /* ON state */
  &.is-on {
    background: var(--btncol);
    border: 1px solid rgba(0,0,0,0.15);
    color: #222;
    opacity: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);

    &:active {
      transform: scale(0.97);
    }

    .hm-legend-text {
      text-decoration: none;
    }
  }
}


/* Swatch always shows the real color */
.hm-legend-swatch{
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
  background: var(--swatch);
  border: 1px solid rgba(0,0,0,0.25);
}

/* Label layout inside button */
.hm-legend-btn-label{
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Heatmap card + Reset button */
.heatmap-card{
  position: relative;     
}

.heatmap-topbar{
  position: absolute;
  top: 12px;
  right: 16px;

  z-index: 10000;         
  pointer-events: auto;

  display: flex;
  align-items: center;
  gap: 8px;

  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(4px);

  /* ensure the box itself is clickable */
}

/* Force everything inside toolbar to accept clicks */
.heatmap-topbar,
.heatmap-topbar *{
  pointer-events: auto !important;
}

/* Keep plot layers below toolbar */
.heatmap-card .plot-center,
.heatmap-card .hm-layout,
.heatmap-card .hm-plot{
  position: relative;
  z-index: 1;
}

/* Download button */

.plot-controls-bottom-left {
  position: absolute;
  top: 12px;   
  left: 12px;

  display: flex;
  flex-direction: column;
  gap: 6px;

  z-index: 10;

  background: rgba(255,255,255,0.92);
  padding: 6px 8px;
  border-radius: 10px;
}

/* Footer */
html, body {
  min-height: 100vh;
  margin: 0;
}

body > .container-fluid {
  min-height: calc(100vh - 52px); /* navbar height */
  display: flex;
  flex-direction: column;
}

body > .container-fluid > .tab-content {
  flex: 1 0 auto;
}

.app-footer {
  margin-top: auto;
  flex-shrink: 0;
}


