﻿:root {
  --detail-column-width: 50px;
  --general-padding: 2rem;
  --border-radius: 5px;
  --corporate-color: #004b87;
  --text-color-1: #222;
  --text-color-2: #666;
  --header-title-width: calc(100% - var(--header-logo-width));

  --band-color-good: rgb(80, 240, 230);
  --band-color-fair: rgb(80, 204, 170);
  --band-color-moderate: rgb(240, 230, 65);
  --band-color-poor: rgb(255, 80, 80);
  --band-color-veryPoor: rgb(150, 0, 50);
  --band-color-extremelyPoor: rgb(125, 33, 129);
  --band-color-nodata: #6f6f6f;

  --banner-width: 400px;
  --banner-height: 100vh;

  --map-width: calc(100vw - var(--banner-width));
  --map-height: 100vh;
  --absolute-width: calc(var(--map-width) - 20px);
}

@media (max-aspect-ratio: 1/1) {
  :root {
    --map-width: 100vw;
    --banner-width: calc(100vw - 1px);
    --banner-height: 450px;
    --map-height: calc(100vh - var(--banner-height) - 1px);
  }
}

html,
body {
  font-family: 'Open Sans', Verdana, Helvetica, Arial, sans-serif;
  font-size: 16px;
}

a {
  color: #004b87;
  text-decoration: none;
}

a:visited {
  color: #004b87;
}

button {
  border: 2px solid #004b87;
  background-color: #004b87;
  color: white;
  padding: 4px;
}

button:focus {
  outline: 0;
}

#header {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: transparent;
  z-index: 1;

  img {
    height: 3rem;
  }
}

#container {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  max-width: 100%;
}

@media (max-aspect-ratio: 1/1) {
  #container {
    flex-direction: column;
  }
}

#mapWrapper {
  display: flex;
  width: var(--map-width);
  height: var(--map-height);
  max-width: 100%;
}

#map {
  width: var(--map-width);
  height: var(--map-height);
  max-width: 100%;
}

#bottomMap {
  position: absolute;
  bottom: calc(100vh - var(--map-height) + 10px);
  max-width: var(--absolute-width);
  width: var(--absolute-width);
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 1rem;
  pointer-events: none;
}

#attributionWrapper {
  display: flex;
  align-items: end;
}

#attribution {
  border: 1px solid #ccc;
  background-color: white;
  color: #666;
  font-size: 0.7rem;
  padding: 1px 5px;
  pointer-events: visible;
}

#layer_control {
  display: flex;
  gap: 1rem;
  width: 11rem;
  max-width: 11rem;
  min-width: 11rem;
  margin-left: 10px;
  height: auto;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.7);
  -moz-box-shadow: 0px 10px 20px -13px rgba(0, 0, 0, 0.75);
  box-shadow: 0px 10px 20px -13px rgba(0, 0, 0, 0.75);
  padding: 1rem;
  border-radius: var(--border-radius);
  pointer-events: visible;
}

.layer_control_button button {
  background-color: transparent;
}

#layer_control button {
  display: flex;
  border: none;
  outline: none;
  width: 40px;
  height: 38px;
  font-size: 1.5rem;
  border-radius: var(--border-radius);
  z-index: 2000;

  color: var(--text-color-2);
  right: 0;
  top: 0;

  justify-content: center;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.75);
}

.layer_control_item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

.layer_control_item:last-of-type {
  margin-bottom: 0;
}

.layer_control_item p {
  font-size: 0.8rem;
  margin: 0;
  text-align: center;
}
.layer_control_item img {
  width: 40px;
}

#aboutInclude,
#legendHelpInclude {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 100%;
}

#footer {
  position: absolute;
  left: 0;
  width: var(--map-width);
  bottom: calc(100vh - var(--map-height));
  z-index: 2000;
  display: block;
}

#viewlet-cookiepolicy {
  position: fixed;
  bottom: 0;
  width: 100%;
  left: 0%;
  margin-right: auto;
  margin-left: auto;
  margin-bottom: 0;
  z-index: 100;
  padding: 0.9em;
  box-sizing: border-box;
}

.portalMessage {
  background-color: #f3f3f3;
}

#legend {
  padding: 1rem;
}

#legend h3 {
  padding: 0;
  margin: 0 0 1.8rem 0;
  font-size: 1.5rem;
}

#legend ul {
  padding: 0;
  list-style-type: none;
  margin: 0 1rem 0 0;
}

#legend li {
  margin: 0 0 0.5rem 0;
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  justify-content: flex-start;
  align-items: center;
}

#legend li:last-of-type {
  margin-bottom: 0px;
}

.legend-box {
  display: inline-block;
  width: 15px;
  height: 15px;
}

.legend_item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

#legend a {
  cursor: pointer;
  font-size: 0.8rem;
}

.legend-wrapper .legend {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  text-align: center;
}

#banner {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border: none;
  border-left: 1px solid #ccc;
  width: var(--banner-width);
  height: var(--banner-height);
}

@media (max-aspect-ratio: 1/1) {
  #banner {
    border: none;
    border-top: 1px solid #ccc;
  }
}

#bannerContent {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 2rem 1rem;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: var(--border-radius);
}

#mainPage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

#titleDate {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--text-color-2);
}

#bannerContent label {
  width: 100px;
}

#bannerContent select {
  width: 170px;
  font-size: 1rem;
}

#bannerContent input {
  width: 100%;
  vertical-align: middle;
}

#bannerContent a {
  cursor: pointer;
}

#bannerContent #tabs {
  text-align: center;
}

#bannerContent #tabs button {
  display: inline-block;
  margin: 0;
  width: 80px;
  background-color: white;
}

#bannerContent #tabs button.on {
  border-color: #999;
  color: #333;
  background-color: #eee;
}

#bannerContent .filterItem {
  margin-bottom: 1rem;
}

#bannerContent .buttonsWrapper {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: flex-start;
}

.buttonsWrapper .controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.buttonsWrapper .controls .buttons {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
}

.buttonsWrapper .control .buttons button {
  width: 35px;
  height: 35px;
}

.buttonsWrapper .controls .buttons button:nth-of-type(2) {
  margin: 0 1rem;
}

.buttonsWrapper .controls .slider {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  width: 200px;
}

#help,
#legend_help {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message {
  position: absolute;
  z-index: 1001;
  width: 260px;
  top: 33%;
  left: 50%;
  margin-left: -150px;
  background-color: rgba(255, 255, 255, 0.7);
  color: var(--text-color-2);
  -webkit-box-shadow: 0px 0px 10px 3px rgba(0, 0, 0, 0.2);
  -moz-box-shadow: 0px 0px 10px 3px rgba(0, 0, 0, 0.2);
  box-shadow: 0px 0px 10px 3px rgba(100, 100, 100, 0.2);
  font-size: 1rem;
  padding: 1rem;
  border-radius: var(--border-radius);
  text-align: center;
}

.aqiPopup h4 {
  font-size: 1rem;
  margin: 0 0 1.25rem 0;
}

.aqiPopup .aqi {
  font-size: 0.8rem;
  margin: 0 0 0.5rem;
}

.aqiPopup .aqiContainer {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
}

.aqiPopup .moreInfo {
  text-align: center;
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
}

.aqiPopup .moreInfo button {
  margin: auto;
  width: 100%;
}

.aqiPopup label {
  display: block;
  color: #555;
  margin: 0 0 0.5rem;
}

.aqiPopup span {
  font-weight: bold;
}

.aqiPopup button:hover {
  background-color: white;
  color: #555;
}

.aqiPopup button {
  background-color: #004b87;
  color: white;
}

.text h1,
.text h2,
.text h3,
.text h4,
.text h5 {
  color: var(--text-color-2);
}

#legend_help h3,
#legend_help h4,
#help h3,
#help h4 {
  color: var(--text-color-2);
}

#legend_help p,
#help p {
  color: var(--text-color-2);
}

#legend_help li,
#help li {
  color: var(--text-color-2);
}

.help table {
  width: 100%;
  border: none;
  margin-bottom: 5px;
}

.help td {
  padding: 3px 6px;
  border: none;
}

.help thead tr:first-of-type td {
  border-top: 1px solid #333;
}

.help thead td {
  border-color: #333;
  border-width: 1px 0 1px 0;
  text-align: center;
  font-weight: bold;
  width: 8%;
}

.help thead td span {
  font-weight: normal;
}

.help tbody {
  border-bottom: 1px solid #333;
  border-top: 1px solid #333;
}

.help tbody td:nth-child(2) {
  background-color: rgba(80, 240, 230, 1);
  color: #333;
}

.help tbody td:nth-child(3) {
  background-color: rgba(80, 204, 170, 1);
  color: white;
}

.help tbody td:nth-child(4) {
  background-color: rgba(240, 230, 65, 1);
  color: #333;
}

.help tbody td:nth-child(5) {
  background-color: rgba(255, 80, 80, 1);
  color: white;
}

.help tbody td:nth-child(6) {
  background-color: rgba(150, 0, 50, 1);
  color: white;
}

.help tbody td:nth-child(7) {
  background-color: rgba(125, 33, 129, 1);
  color: white;
}

.help ol {
  margin-top: 0;
}

#legend_help em {
  font-style: normal;
  font-weight: bold;
}

.buttonGroup {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 25px 0;
}

.buttonGroup button {
  border-color: #999;
  background-color: #999;
  color: white;
}

.close {
  font-size: 16pt;
  color: #999;
  padding: 4px 8px 8px 12px;
  cursor: pointer;
}

.panel .legend_help__content h3 {
  color: #666;
  font-size: 1.5rem;
  margin: 0;
}

.panel .legend_help__content p {
  color: #666;
  font-size: 1rem;
}

#detail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 1rem;
  width: calc(var(--banner-width) - 2rem);
}

#detail .detail-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;

  & .seven_days_footnote {
    font-size: 0.8rem;
  }
}

#detail h4 {
  margin: 0;
  font-size: 1.2rem;
}

#detail .bar_char_wrapper {
  width: calc(var(--banner-width) - 4rem);
  overflow-x: auto;
}

#detail table {
  font-size: 0.8rem;
}

#detail th,
#detail td {
  text-align: left;
  padding: 1px 3px;
  vertical-align: top;
}

#detail th {
  font-weight: 600;
  color: #555;
  padding-right: 1rem;
}

#detail td {
  font-weight: bold;
}

#detail .polu th {
  font-weight: bold;
  color: #333;
}

#detail .polu td {
  font-weight: normal;
}

#detail .details {
  * {
    margin: 0;
  }

  h3 {
    margin: 1rem 0 0.5rem 0;
  }
}

#station_table .details p {
  font-size: 0.8rem;
  margin: 0;
  color: #333;
}

#station_table .details h3 {
  font-size: 1.25rem;
  margin: 0;
  color: #333;
}

#lock {
  display: none;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.2);
  z-index: 20000;
}

.seven_days .current_date {
  position: absolute;
  width: 1px;
  border-left: 2px dashed #666;
  top: 32px;
  bottom: 72px;
}

.seven_days .current_date span {
  width: 120px;
  position: absolute;
  right: 0;
}

.country_facts {
  margin-top: 1rem;
}

#toggle-mobile-menu {
  display: none;
}

:root {
  --general-padding: 1rem;
  --header-logo-width: 30%;
}

#legend {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background-color: #eee;
  width: fit-content;
}

#help h3,
#legend_help h3 {
  font-size: 1rem;
}

#legend_tab.slideUpLegend {
  bottom: 39vh;
}

.table_wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

#legend.slideUpLegend {
  height: 39vh;
}

.maplibregl-popup {
  z-index: 2;
}

/* fix to make the mapbox popup look like leaflet's */
body .maplibregl-popup-content {
  border-radius: var(--border-radius);
  padding: 1rem;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4);
  font-family: 'Open Sans', Verdana, Helvetica, Arial, sans-serif;
}

body .leaflet-popup-pane {
  font-family: 'Open Sans', Verdana, Helvetica, Arial, sans-serif;
}

body .maplibregl-popup-close-button {
  font-size: 18pt;
  padding-right: 8px;
}

/* hide useless button */
.maplibregl-ctrl-attrib {
  display: none;
}

/* Timeslider styles */

.tsInfo #tsText {
  text-align: center;
  -moz-border-radius: 10px; /* for Firefox */
  -webkit-border-radius: 10px; /* for Webkit-Browsers */
  border-radius: 10px; /* regular */
  background-color: rgba(0, 75, 135, 0.2);
  font-size: small;
  padding: 5px;
}

.buttonsWrapper .buttons {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
}

.buttonsWrapper .toolButton {
  cursor: pointer;
  padding: 1rem;
  color: #fff;
  background-color: #004b87;
  border-radius: var(--border-radius);
}

.buttonsWrapper .toolButton:hover {
  background-color: #333;
}

.buttonsWrapper .toolButton:first-of-type,
.buttonsWrapper .toolButton:last-of-type {
  margin: 0px;
}

.infoLink {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
}

#zoom {
  position: absolute;
  right: calc(100vw - var(--map-width) + 10px);
  top: 10px;
  border-radius: var(--border-radius);
  border: 2px solid #cccccc;
}

#zoom button {
  display: block;
  margin: 0;
  height: 40px;
  width: 40px;
  border: none;
  overflow: hidden;
  background-color: white;
  color: #666;
}

#zoom button span {
  font-weight: bold;
  font-size: 21pt;
  position: relative;
  bottom: 4px;
}

#zoom .minus {
  border-top: 1px solid #ddd;
}

#loading_values {
  font-size: 0.8rem;
}

.header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(255, 255, 255);

  & h3 {
    margin: 0;
  }
}

.content {
  height: calc(100% - calc(var(--header-height) + var(--general-padding) * 2));
  overflow-y: auto;
}

.promoButtonGroup {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

th,
td {
  font-size: 0.9rem;
}

.titleText {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#fullWrapper {
  display: none;
}

@media (max-height: 500px) and (max-aspect-ratio: 1/1), (max-width: 600px) and (min-aspect-ratio: 1/1) {
  #fullWrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 1rem;
    height: 100vh;
    width: 100vw;
    box-sizing: border-box;
  }

  #container,
  #mapWrapper,
  #map,
  #banner {
    display: none;
  }
}
