.dropdown {
  padding-left: 16px;
  display: inline-block;
  position: relative;
  outline: none;
  margin: 10px 5px;
  text-rendering: optimizeLegibility;
}

.dropdown .title {
  display: inline-block;
  position: relative;
  outline: none;
  padding: 0px 0px 5px;
  font-size: 14px;
  font-weight: 600;
  font-family: Inter, sans-serif;
  color: #351c26;
}

.dropbtn,
.dropbtn-search {
  background-color: #ffffff;
  color: #351c26;
  font-weight: bold;
  padding: 16px;
  font-size: 14px;
  border: none;
  cursor: pointer;
  width: 100%;
  cursor: pointer;
  transition: 0.7s ease-out;
  background-image: url('../icons/dropdown.svg');
  background-position: calc(100% - 16px) 50%;
  background-repeat: no-repeat;
}

.dropdown-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.dropdown .button {
  background-color: #ffffff;
  border: none;
  color: #351c26;
  font-weight: bold;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 14px;
  margin: 4px 2px;
  cursor: pointer;
}

.dropdown .dropdown-content {
  position: absolute;
  padding: 16px;
  font-weight: bold;
  z-index: 1000;
  display: none;
  background-color: #ffffff;
  box-shadow: 0px 8px 8px 0px rgba(0, 0, 0, 0.2);
  left: 30px;
  width: 100%;
  max-width: 450px;
  max-height: 600px;
  display: column-reverse;
  flex-direction: column-reverse;
  overflow: auto;
}


.dropdown-content button {
  background: transparent;
  border: none;
  color: #351c26;
  font-weight: bold;
  padding: 15px 32px;
  text-align: left;
  text-decoration: none;
  display: block;
  font-size: 12px;
  margin: 4px 2px;
  cursor: pointer;
  border: none;
  width: 85%;

}



.dropdown-content button:hover {
  background-color: #f1f1f1
}

.legend-icon {
  width: 12px;
  height: auto;
  vertical-align: middle;
  margin-right: 6px;
}

/* Grouped university dropdown styles */
.dropdown-content button.uni-group-header {
  font-weight: bold;
  font-size: 13px;
  padding-left: 16px;
  padding-top: 10px;
  padding-bottom: 6px;
  color: #351c26;
  border-top: 1px solid #e8e0e3;
}

.dropdown-content button.uni-group-header:first-child {
  border-top: none;
}

.dropdown-content button.uni-group-member {
  font-weight: normal;
  font-size: 12px;
  padding-left: 28px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.uni-group-divider {
  border-top: 2px solid #351c26;
  margin: 8px 16px;
}


/* Show the dropdown content on click (using ts) */
.dropdown.active .dropdown-content {
  display: block;
}

/* Change background color of dropdown button on hover */
.dropdown:hover .dropbtn {
  transition: 0.7s ease;
  color: #ffffff;
  background-color: #351c26;
}

/* Search button */
/* Dropdown Content (Hidden by Default) */
.dropdown-search-content {
  display: none;
  position: absolute;
  background-color: #f6f6f6;
  min-width: 230px;
  border: 1px solid #ddd;
  z-index: 1;
}


/* Title label for the region search — matches .dropdown .title style but left-aligned */
#region-search-section .title {
  display: block;
  text-align: left;
  padding: 0 0 5px;
  font-size: 14px;
  font-weight: 600;
  font-family: Inter, sans-serif;
  color: #351c26;
}

/* Region search — sits inside .top-icon-row, fills the space left of the icon buttons */
#region-search-section {
  flex-grow: 1;
  max-width: 50%;
  align-self: flex-start;
  padding: 0 16px 0 0;
}

#region-search-wrapper {
  position: relative;
}

#region-search-results {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background-color: #ffffff;
  box-shadow: 0px 8px 8px 0px rgba(0, 0, 0, 0.2);
  z-index: 1100;
  max-height: 300px;
  overflow-y: auto;
  padding: 4px 0;
}

#region-search-results:empty {
  display: none;
}

#region-search-results button {
  background: transparent;
  border: none;
  color: #351c26;
  font-weight: bold;
  padding: 10px 16px;
  text-align: left;
  display: block;
  font-size: 12px;
  width: 100%;
  cursor: pointer;
}

#region-search-results button:hover {
  background-color: #f1f1f1;
}

/* Unbolded type prefix shown before each search result label */
#region-search-results .result-prefix {
  font-weight: normal;
  color: #888;
}

#region-search-results .uni-group-divider {
  display: none;
}

/* The search field */
#searchBtn {
  background-image: url('../icons/search.svg');
}

/* Shared styles for all search inputs */
#uni-search-input,
#region-search-input {
  box-sizing: border-box;
  background-image: url('../icons/search.svg');
  background-position: 14px 50%;
  background-repeat: no-repeat;
  background-size: 16px;
  font-size: 13px;
  padding: 10px 12px 10px 38px;
  border: 1px solid #ddd;
  border-radius: 4px;
  display: block;
  color: #351c26;
  font-family: inherit;
  font-weight: normal;
}

/* University search: fixed width inside dropdown */
#uni-search-input {
  width: 90%;
  margin: 4px 2px 8px;
}

/* Region search: fills the available top-bar width */
#region-search-input {
  width: 100%;
  margin: 0;
}

#uni-search-input:focus,
#region-search-input:focus {
  outline: 2px solid #351c26;
  border-color: #351c26;
}


#searchInput {
  box-sizing: border-box;
  background-image: url('../icons/search.svg');
  background-position: 14px 12px;
  background-repeat: no-repeat;
  font-size: 14px;
  padding: 14px 20px 12px 45px;
  border: none;
  border-bottom: 1px solid #ddd;
}

/* The search field when it gets focus/clicked on */
#searchInput:focus {
  outline: 3px solid #ddd;
}

.top-icon-row-icon {
  height: 72px;
  width: 72px;
  border-radius: 5px;
  display: inline-block;
  background-color: #ffffff;
  background-repeat: no-repeat;
  background-position: 50% 50%;
  /* -webkit-mask-size: contain;
  mask-size: contain; */
}

.top-icon-row-icon:hover {
  background-color: #76dad5;
}

#helpbox-button {
  background-image: url(../icons/info.svg);
}

#citationbox-button {
  background-image: url(../icons/quote.svg);
  /* -webkit-mask: url(icons/quote.svg) no-repeat 50% 50%;
  mask: url(icons/quote.svg) no-repeat 50% 50%; */
}


@media (max-width: 800px) {
  .dropdown .dropdown-content {
    max-height: 300px;
  }
}


/* ---- Comparison mode toggle + year strip ---- */
#comparison_section {
  padding: 0 16px;
  margin: 4px 5px 10px;
  text-align: left;
}

#comparison-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #351c26;
  cursor: pointer;
  margin-top: 8px;
}

#comparison-year-section.hidden {
  display: none;
}

#comparison-year-section .title {
  display: block;
  text-align: left;
  padding: 8px 0 5px;
  font-size: 14px;
  font-weight: 600;
  color: #351c26;
}

.year-strip {
  display: flex;
  width: 100%;
}

.year-strip-btn {
  flex: 1;
  padding: 8px 0;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  color: #351c26;
  background-color: #ffffff;
  border: 1px solid #ddd;
  border-right: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.year-strip-btn:first-child {
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

.year-strip-btn:last-child {
  border-right: 1px solid #ddd;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

.year-strip-btn:hover:not(.disabled):not(.anchor) {
  background-color: #f1f1f1;
}

/* Anchor: the year currently being viewed (set via the Year dropdown) */
.year-strip-btn.anchor.disabled,
.year-strip-btn.anchor {
  background-color: #08306b;  
  color: #ffffff;
  cursor: default;
}

/* Selected comparison year */
.year-strip-btn.selected {
  background-color: #d6e6f5;
  border-color: #2171b5;
  border-right: 1px solid #2171b5;
  color: #1e0e1a;
}

/* No data (or the anchor when disabling self-compare) */
.year-strip-btn.disabled {
  color: #bbb;
  background-color: #f7f7f7;
  cursor: default;
}

/* Locked Display Type while comparison is active */
#display_dropdown.locked {
  opacity: 0.5;
  pointer-events: none;
}