html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-size: 14px;
  font-family: 'Lato', sans-serif;
}

#container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

#header {
  width: 100%;
  background-color: #226089;
  color: white;
  display: flex;
  align-items: center;
}

#header p {
  font-size: 18px;
  line-height: 24px;
  font-weight: bold;
  padding: 0;
  margin: 10px 0px;
}

#title {
  flex: 1;
  padding: 5px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

#title img {
  height: 55px;
  object-fit: cover;
  margin-left: 10px;
}

#control {
  flex: none;
  padding: 10px 20px;
}

.view-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: system-ui, sans-serif;
}

.label {
  color: white;
}

.toggle {
  position: relative;
  width: 40px;
  height: 26px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  border-radius: 24px;
  border: 1px solid white;
  cursor: pointer;
  transition: background-color 0.3s;
}

.slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s;
}

input:checked + .slider {
  background-color: #34c759;
}

input:checked + .slider::before {
  transform: translateX(14px);
}

#content {
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
  overflow: hidden;
}

#filter_container {
  width: 300px;
  display: flex;
  flex-direction: column;
}

#filters {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
}

#filter_result {
  background-color: #226089;
  padding: 15px 20px;
  color: white;
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #eee;
  padding: 8px 15px;
  cursor: pointer;
  border-radius: 4px;
  color: #304E9D;
  font-weight: bold;
}

.filter-header:hover {
  background: #ddd;
}

#challenges_header {
  background-color: #E3EDE0;
}

#challenges_header:hover {
  background-color: #D4E0CF;
}

#applications_header {
  background-color: #F1EEE8;
}

#applications_header:hover {
  background-color: #E6E1DA;
}

#researches_header {
  background-color: #D5DFE6;
}

#researches_header:hover {
  background-color: #C2CFD7;
}

.toggleIcon {
  font-size: 20px;
  transition: transform 0.2s ease;
}

.filter-content {
  overflow: hidden;
  max-height: 750px;
  transition: max-height 0.4s ease;
}

.filter-content.hidden {
  max-height: 0;
}

table.filter-item {
  width: 100%;
  margin: 10px 0px;
}

table.filter-item tr:hover {
  background-color: #eee;
}

table.filter-item td {
  padding: 3px 0px;
  padding-left: 20px;
}

table.filter-item td.cb {
  text-align: end;
  padding-left: 10px;
  padding-right: 15px;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

#data {
  flex: 1;
  height: 100%;
}

#instruction {
  padding: 10px 10px;
  background-color: #f3f2c3;
}

#instruction_content {
  font-size: 16px;
  padding: 5px 10px;
  font-weight: bold;;
  border: 1px dashed #226089;
  color: #226089;
}

#map_container {
  width: 100%;
  height: 100%;
  position: relative;
}

#map_region {
  min-width: 300px;
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  border: 2px solid #304E9DCC;
  border-radius: 10px;;
  background-color: #fffe;
  display: flex;
  align-items: center;
  padding: 10px;
  display: flex;
  flex-direction: column;
}

#map_region_pin {
  display: flex;
  align-items: center;
  font-weight: bold;
  font-size: 16px;
  gap: 5px;
}

#map_region_pin img {
  height: 20px;
}

#map_region_info_div {
  margin-top: 2px;
  padding-top: 6px;
  border-top: 1px solid #226089;
  font-size: 14px;
}

#map {
  width: 100%;
  height: 100%;
}

.map-marker {
  font-size: 22px;
  color: #007aff;
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.map-marker img {
  width: 22px;
}

.map-marker-popup {
  margin-top: -10px;
  margin-bottom: -10px;
}

.map-marker-popup h3 {
  margin: 0;
  font-size: 12px;
  color: #304E9D;
}

.map-marker-popup a {
  color: black;
  text-decoration: none;
}

.map-marker-popup a:hover {
  color: #304E9D;
  text-decoration: underline;
}

.map-marker-popup .fixed-height {
  max-height: 200px;
  overflow-y: auto;
}

.map-marker-popup table, .map-marker-popup table td {
  border-collapse: collapse;
  border: 1px solid #ccc;
  padding: 0px 3px;
  vertical-align: top;
}

.map-marker-popup img {
  width: 15px;
  margin: 3px 0px;
}

#list_container {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

#grouped_list {
  min-height: 100%;
  background-color: #f0f0f0;
}

#center_list_header, #project_list_header {
  background-color: #dddddd;
  padding: 15px 20px;
  font-size: 18px;
  color: #304E9D;
  font-weight: bold;
}

#center_list, #project_list {
  background: linear-gradient(to bottom, #dddddd, #f0f0f0);
  padding: 10px 20px;
  padding-top: 0px;
}

#center_list {
  margin-bottom: 20px;
}

.card-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 16px;
  box-sizing: border-box;
}

.card {
  position: relative;
  background: white;
  border: 2px solid #ccc;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
  color: #555;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.card .title {
  color: #226089;
  font-size: 16px;
  font-weight: bold;
}

.card img {
  height: 15px;
}

.card span img {
  vertical-align: middle;
}

.card .sub-info {
  display: flex;
  gap: 10px;
}

.card .sub-info .region-info {
  display: flex;
  align-items: center;
  gap: 2px;
}

.card .sub-info a {
  text-decoration: none;
  color: #555;
}

.card .sub-info a:hover {
  text-decoration: underline;
}

.card:hover {
  transform: translateY(-4px);
}

.card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-top: 15px solid transparent;
  border-left: 15px solid transparent;
  border-top-right-radius: 6px;
}

.E12000001::after { border-top-color: #304E9D; } /* North East (England) */
.E12000002::after { border-top-color: #ff6554; } /* North West (England) */
.E12000003::after { border-top-color: #52be7f; } /* Yorkshire and The Humber */
.E12000004::after { border-top-color: #F39C12; } /* East Midlands */
.E12000005::after { border-top-color: #8E44AD; } /* West Midlands */
.E12000006::after { border-top-color: #006551; } /* East of England */
.E12000007::after { border-top-color: #a62617; } /* London */
.E12000008::after { border-top-color: #2980B9; } /* South East (England) */
.E12000009::after { border-top-color: #6a3a00; } /* South West (England) */
.N92000002::after { border-top-color: #2eff23; } /* Northern Ireland */
.S92000003::after { border-top-color: #bd99cc; } /* Scotland */
.W92000004::after { border-top-color: #fbff00; } /* Wales */