/* DAS revamp shared page styles */
.btn-tabs,
.btn-tabs:visited {
  text-wrap: balance;
  width: 180px;
  box-sizing: border-box;
  min-height: 106px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: normal;
  text-align: center;
}

.tabNav .list-inline {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
}
.tabNav .list-inline > li {
  display: flex;
  padding-left: 0;
  padding-right: 0;
  vertical-align: top;
  align-items: stretch;
}
.tabNav .list-inline > li > .btn-tabs {
  height: 100%;
  align-self: stretch;
}

.btn-tabs-mobile,
.btn-tabs-mobile:visited {
  display: block;
  width: 100%;
  text-align: left;
  white-space: normal;
}

.btn-tabs.active,
.btn-tabs-mobile.active {
  cursor: default;
}

#menuContainer .section-header,
.expandable-menu.section-header {
  display: block;
  width: 100%;
  padding: 12px 16px;
  font-weight: 700;
  cursor: default;
  border-radius: 4px;
  margin-bottom: 10px;
}
#menuContainer .menu-section,
#menuContainer .menu-subsection,
.menu-section {
  margin-bottom: 20px;
}
.sub-tabs,
.sub-tabs:visited {
  display: block;
  padding: 12px 14px;
  margin: 0 6px 6px 0;
  border: 1px solid #d6d6d6;
  border-radius: 4px;
  color: #000 !important;
  text-decoration: none;
  font-weight: 600;
  min-height: 48px;
}
.sub-tabs:hover,
.sub-tabs:focus {
  color: #000 !important;
  text-decoration: underline;
  box-shadow: 0 0 0 2px #0535d2;
  outline: 0;
}
.das-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.75rem;
  margin: 2.5rem 0;
}
.das-card,
.das-card:visited,
.das-card h3,
.das-card h3:visited,
.das-card p,
.das-card p:visited {
  color: inherit;
}
.das-card {
  display: block;
  border: 2px solid #dcdcdc;
  border-radius: 14px;
  padding: 1.75rem;
  background: #fff;
  text-decoration: none;
  color: #000 !important;
  min-height: 180px;
  transition: box-shadow 0.25s ease, transform 0.15s ease;
}
.das-card:hover:not(.active),
.das-card:focus:not(.active) {
  box-shadow: 0 4px 18px rgba(0,0,0,0.13);
  transform: translateY(-3px);
  text-decoration: none;
}
.das-card.active,
.das-card.active:hover,
.das-card.active:focus {
  background: #26374A;
  border-color: #26374A;
  color: #fff !important;
  box-shadow: none;
  transform: none;
  cursor: default;
}
.das-card.active h3,
.das-card.active p,
.das-card.active .das-card-header i {
  color: #fff !important;
}
.das-card.coming-soon {
  opacity: 0.5;
  pointer-events: none;
  cursor: default;
}
.das-card-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}
.das-card-header i {
  font-size: 2.4rem;
  min-width: 2.8rem;
  text-align: center;
  color: #26374A;
}
.das-card h3 {
  margin-top: 0;
  margin-bottom: 0;
}
.pub-toolbar {
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 15px;
  margin: 20px 0;
}
.pub-filter-buttons .btn {
  margin-right: 6px;
  margin-bottom: 6px;
}
.pub-filter-buttons .active-filter {
  background: #26374A;
  color: #fff;
  border-color: #26374A;
}
.pub-results-note {
  margin: 0;
  font-weight: 700;
}
.compact-pub-table .pub-title {
  margin-top: 0;
}
.pub-thumb-cell {
  width: 95px;
}
.pub-thumb-link img {
  max-width: 78px;
  height: auto;
  border: 1px solid #ddd;
}
.pub-meta {
  margin-top: 8px;
}
.pub-chip {
  display: inline-block;
  font-size: 0.85em;
  background: #eee;
  border-radius: 2px;
  padding: 2px 6px;
  margin: 0 4px 4px 0;
}
.pub-chip-new {
  background: #dff0d8;
  color: #2b542c;
}
.pub-link-cell {
  white-space: nowrap;
}
.pub-row-hidden,
.pub-empty {
  display: none;
}

@media (min-width: 768px) {
  .das-chart-scroll svg {
    max-width: none;
  }
}

@media (max-width: 767px) {
  .das-card-grid { grid-template-columns: 1fr; }
  .pub-thumb-cell { display: none; }
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}

.btn-tabs.active[aria-current="page"],
.btn-tabs-mobile.active[aria-current="page"] {
  cursor: default;
}

/* v17-v19 mobile responsiveness: DAS trend controls and chart containers */
.das-toggle-row {
  align-items: center;
  display: none;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0 1.25rem;
}
.das-toggle-button {
  white-space: normal;
  text-align: left;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  font-weight: 700;
  line-height: 1.35;
}
.das-toggle-parenthetical {
  font-weight: 700;
}
.das-trend-layout {
  display: grid;
  grid-template-columns: minmax(330px, 0.95fr) minmax(0, 3fr);
  gap: 4rem;
}
#lineGraphContainer {
  position: relative;
  min-width: 0;
  overflow: visible;
}
#lineGraphContainer .line-tooltip {
  box-sizing: border-box;
  max-width: min(440px, calc(100% - 16px));
  white-space: normal !important;
  line-height: 1.25;
  z-index: 20;
}

#lineGraphContainer .line-tooltip-year {
  margin-bottom: 0.35rem;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}

#lineGraphContainer .line-tooltip-series {
  display: grid;
  gap: 0.22rem;
}

#lineGraphContainer .line-tooltip-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 0.28rem;
  text-align: left;
  font-size: 14px;
}

#lineGraphContainer .line-tooltip-dot {
  line-height: 1;
}

#lineGraphContainer .line-tooltip-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

#lineGraphContainer .line-tooltip-value {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

#lineGraphContainer .line-tooltip-total {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem;
  margin-top: 0.4rem;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
}
.das-chart-scroll,
#heatmap {
  max-width: 100%;
  overflow-x: visible;
  overflow-y: visible;
}

.das-chart-scroll svg {
  height: auto;
}

#heatmap {
  width: 100%;
  margin-bottom: 0.25rem;
}

#heatmap svg {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
}

#checkboxRawTotals input[type="checkbox"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}


@media (min-width: 768px) {
  .das-chart-scroll svg {
    max-width: none;
  }
}

@media (max-width: 767px) {
  .tabNav .list-inline {
    flex-wrap: wrap;
  }
  .btn-tabs,
  .btn-tabs:visited {
    width: calc(50vw - 15px);
    min-height: 82px;
    padding-left: 8px;
    padding-right: 8px;
  }
  .das-trend-title,
  #heatmapTitle,
  #heatmapTitle + span {
    line-height: 1.45;
  }
  .das-trend-title select,
  #heatmapTitle select,
  #heatmapTitle + span select,
  #trendInd,
  #trendProv,
  #trendStartYr,
  #trendEndYr,
  #trendPharm,
  #trendSubclass,
  #trendSubstance,
  #heatPharmDrop,
  #heatSubDrop,
  #heatDrugDrop,
  #heatStartYr,
  #heatEndYr {
    max-width: 100% !important;
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
  }
  .das-trend-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .das-trend-layout > div {
    min-width: 0;
  }
  #trendPharm,
  #trendSubclass,
  #trendSubstance,
  #heatPharmDrop,
  #heatSubDrop,
  #heatDrugDrop {
    width: 100% !important;
  }
  .das-toggle-row {
    align-items: flex-start;
    gap: 0.5rem;
  }
  .das-toggle-button {
    max-width: 100%;
  }
  .das-chart-scroll svg {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
  }

  #heatmap svg text {
    font-size: 12px !important;
  }

  #heatmap svg .provtitle,
  #heatmap svg .yeartitle {
    font-size: 13px !important;
  }

  #heatmap svg .legend text {
    font-size: 12px !important;
  }
}

@media (max-width: 480px) {
  .btn-tabs,
  .btn-tabs:visited {
    width: 100%;
  }
  .das-toggle-button {
    width: 100%;
  }
  #heatmap svg text {
    font-size: 10px !important;
  }
}


/* v23: stack Drug Trends controls above the line graph on narrow/tablet widths. */
@media (max-width: 1199px) {
  .das-trend-layout {
    grid-template-columns: 1fr !important;
    gap: 1.25rem;
  }
  .das-trend-layout > div {
    min-width: 0;
  }
  #lineGraphContainer {
    clear: both;
    margin-top: 0.75rem;
  }
}

/* v25 validation pass: expand summary cards and support disabled/coming soon sub-tabs */
#menuContainer [style*="grid-template-columns"] {
  gap: 0.75rem;
}
#menuContainer .sub-tabs {
  min-height: 64px;
}
#menuContainer .sub-tabs.coming-soon,
#menuContainer .sub-tabs[aria-disabled="true"] {
  opacity: 0.65;
  cursor: default;
  pointer-events: none;
}

/* Keep the analyzed-report filter checkboxes aligned with their labels. */
.pharm-sub-filter-option {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin-top: 0.65rem;
}

.pharm-sub-filter-option-first {
    margin-top: 1.5rem;
}

.pharm-sub-filter-option input[type="checkbox"] {
    flex: 0 0 auto;
    margin: 0.4rem 0 0;
}

.pharm-sub-filter-option label {
    flex: 1 1 auto;
    margin: 0;
}

/* Hover/focus outline around the national Canada value and label. */
#pt_map .canadaHoverOutline {
  fill: transparent;
  stroke: transparent;
  stroke-width: 3px;
  vector-effect: non-scaling-stroke;
  pointer-events: all;
  cursor: pointer;
}

#pt_map .canadaHoverOutline:hover,
#pt_map .canadaHoverOutline:focus,
#pt_map .canadaHoverOutline.is-active {
  stroke: #000;
  outline: none;
}

/* Keep generated graph-note lists compact and hide empty placeholders. */
ul.otherNote,
ul.panCanGraphNotes,
ul.panCanCanGraphNotes {
  margin-top: 10px;
  padding-left: 24px;
}
ul.otherNote:empty,
ul.panCanGraphNotes:empty,
ul.panCanCanGraphNotes:empty {
  display: none;
}
