@font-face {
  font-family: Roboto;
  src: url(../static/fonts/Roboto-Light.ttf);
}

@font-face {
  font-family: openSans;
  src: url(../static/fonts/OpenSans-Light.ttf);
}

:root {
  --header-height: 0rem;
  --footer-height: 2rem;
  --logo-padding: 1rem;
  --main-height: calc(100% - var(--header-height) - var(--footer-height));
  --panel-height: var(--main-height);
  --panel-left: 0px;
  --panel-width: 47rem;
  --variable-card-width: 19rem;
  --legend-container-height: 13rem;
  --btn-top: 20px;
  --btn-left: 10px;

  --header-background: hsl(0, 0%, 100%);
  --panel-background: hsl(0, 0%, 20%);
  --panel-background-l1: hsl(0, 0%, 30%);
  --panel-background-l2: hsl(0, 0%, 40%);
  --panel-background-l3: hsl(0, 0%, 50%);
  --footer-background: hsl(0, 0%, 30%);

  --modal-header-height: 6rem;

  --blue-l1: hsl(209, 100%, 31%);
  --blue-l2: hsl(212, 44%, 47%);
  --blue-l3: hsl(210, 39%, 66%);

  /* From style guide dropper */
  --kstn-green-l1: hsl(175, 97%, 15%);
  --kstn-green-l2: hsl(178, 81%, 25%);
  --kstn-green-l3: hsl(178, 26%, 46%);
  --kstn-green-l4: hsl(177, 22%, 65%);
  --kstn-cmyk: hsl(150, 100%, 16%);

  --control-select-color: var(--kstn-green-l3);

  --text-light: hsl(0, 0%, 97%);
  --text-dark: hsl(0, 0%, 30%);
  --scrollbar-color: hsl(0, 0%, 41%);
}

::-webkit-scrollbar {
  -webkit-appearance: none;
  width: 0.75rem;
}

::-webkit-scrollbar-thumb {
  border-radius: 0.5rem;
  background: var(--scrollbar-color);
}

* {
  box-sizing: border-box;
  font-family: Roboto;
  line-height: normal;
  margin: 0;
  padding: 0;
}

html,
body {
  font-size: 1vmin;
  height: 100%;
  background-color: var(--panel-background-l1);
}

p {
  font-size: 1rem;
  font-weight: 200;
  color: var(--text-dark);
}

h6 {
  font-family: openSans, sans-serif;
  font-weight: 600;
}

h5 {
  font-family: openSans, sans-serif;
  font-weight: 500;
}

h4 {
  font-family: openSans, sans-serif;
  font-weight: 500;
}

a,
a * {
  display: inline-block;
  font-family: Georgia, "Times New Roman", Times, serif;
}

/* Loader Styles */

.loader-container {
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: var(--header-background);
  left: 0;
  top: var(--header-height);
  height: var(--main-height);
  width: 100%;
  z-index: 5;
}

.loader {
  border: 8px solid hsl(0, 0%, 77%);
  border-top: 8px solid var(--blue-l2);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  margin-bottom: 10px;
  animation: spin 2s linear infinite;
}

/* Primary Structure */

.main {
  position: absolute;
  background-color: var(--header-background);
  left: 0;
  top: var(--header-height);
  height: var(--main-height);
  width: 100%;
  opacity: 0;
  overflow: hidden;
  z-index: 0;
}

.side-panel {
  position: absolute;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: var(--panel-width);
  background-color: var(--panel-background);
  opacity: 1;
  z-index: 4;
}

.right-container {
  position: absolute;
  left: var(--panel-width);
  height: 100%;
  width: calc(100% - var(--panel-width));
}

.legend-container {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: black;
  height: var(--legend-container-height);
}

#map {
  height: calc(100% - var(--legend-container-height));
}

/* Side Panel Styles */

.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: hsl(0, 0%, 100%);
}

img.logo {
  height: calc(9rem - var(--logo-padding));
}

.panel-title {
  text-align: center;
  padding: 1rem;
}

.panel-title h6 {
  color: var(--text-light);
  font-size: 3rem;
  font-weight: 800;
}

.panel-title h5 {
  color: var(--text-light);
  font-size: 2.3rem;
  font-weight: 400;
  padding: 0.5rem;
}

.panel-title .subtitle {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Variable Cards */

.variables-container {
  margin: 0 0rem 0.4rem 0rem;
  padding: 0.5rem;
  overflow: auto;
}

.variables-container > h6,
.variables-container > h4 {
  color: var(--text-light);
  font-size: 1.6rem;
  font-weight: 600;
  padding: 0 1rem;
  text-align: center;
}

.variables-container > h4 {
  font-size: 2rem;
  font-weight: 400;
  margin-bottom: 0.3rem;
}

.variable-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.variable-cards .variable-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.6rem 0.9rem;
  background-color: var(--panel-background-l1);
  width: var(--variable-card-width);
  min-height: 11rem;
  border-radius: 1rem;
  margin: 0.7rem;
  box-shadow: 1px 1px 1px 0px hsla(0, 0%, 15%, 0.3);
}

.variable-cards .variable-card:hover {
  cursor: pointer;
  box-shadow: 0px 0px 5px 1px var(--control-select-color);
}

.variable-cards .variable-card h4 {
  color: var(--text-light);
  font-size: 1.5rem;
}

.variable-card h5 {
  color: hsl(194, 100%, 80%);
  font-weight: 600;
  font-size: 2.5rem;
}

h5.small-font {
  font-size: 1.9rem;
  color: hsl(43, 90%, 85%);
}

.variable-cards .selected {
  background-color: var(--control-select-color);
}

#info-button {
  height: 2.6rem;
  z-index: 5;
}

#info-button:hover {
  cursor: pointer;
  background-color: hsl(0, 0%, 40%);
  transform: scale(1.1);
  border-radius: 50%;
}

#center-map-button {
  position: absolute;
  background-color: white;
  padding: 2px;
  left: var(--btn-left);
  top: var(--btn-top);
  height: 25px;
  border-radius: 4px;
  z-index: 5;
}

#center-map-button:hover {
  cursor: pointer;
}

/* Filter Styles */

.filters-container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}

.filter {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  background-color: var(--panel-background-l1);
  width: 100%;
  padding: 0.5rem 0.6rem;
  margin: 0.6rem 0.2rem;
  border-radius: 1rem;
}

.filter h6 {
  color: var(--text-light);
  font-size: 1.8rem;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
}

.filter-buttons {
  width: 100%;
}

.filter-section {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  min-height: fit-content;
  max-width: 18rem;
  border: solid hsl(0, 0%, 50%) 1px;
  border-radius: 1rem;
  padding: 0.5rem;
  margin-top: 0.5rem;
}

.filter-button-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin: 0.5rem 0;
  min-width: 100%;
}

.filter-button {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--panel-background-l2);
  color: var(--text-light);
  text-align: center;
  font-weight: 100;
  font-size: 1.2rem;
  padding: 0.5rem;
  min-height: fit-content;
  border-radius: 0.5rem;
  margin: 0.2rem 0.25rem;
  box-shadow: 1px 1px 1px 0px hsla(0, 0%, 15%, 0.3);
}

.filter-button:hover {
  cursor: pointer;
  background-color: hsl(0, 0%, 70%);
  color: rgb(0, 61, 25);
}

.filter-section-container {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  min-width: 100%;
  padding: 0 2.5rem;
}

.filter-section h6 {
  font-size: 1.2rem;
  padding-bottom: 0.1rem;
  margin-bottom: 0;
}

.filter.district-settings .filter-button {
  max-width: 8rem;
  min-height: 5rem;
  padding: 0.5rem 1.5rem;
  font-size: 1.6rem;
}

.filter.grade .filter-button {
  width: 5rem;
  min-height: 1rem;
  font-size: 1.6rem;
}

.filter.content .filter-button {
  width: 14rem;
  min-height: 5rem;
  font-size: 1.6rem;
  padding: 0.7rem;
}

.filter-button.all-button {
  min-width: 99%;
  min-height: 2rem;
  font-size: 1.3rem;
  padding: 1rem;
}

.filter-button.selected {
  background-color: var(--control-select-color);
  color: var(--text-light);
  font-weight: 400;
}

.filters-container .population-slider {
  padding: 0.8rem 4rem;
  width: 100%;
  text-align: center;
  margin-left: 0rem;
  background-color: var(--panel-background-l1);
  border-radius: 1rem;
}

.filters-container label {
  font-size: 1.3rem;
  padding: 1rem;
  color: var(--text-light);
  font-weight: 600;
}

.population-slider {
  display: block;
}

/* Legend Styles */

.legend {
  display: flex;
  flex-direction: column;
  background-color: black;
  color: var(--text-light);
  height: fit-content;
  padding: 1rem 2.5rem 0 2.5rem;
  border-radius: 1rem;
  opacity: 1;
  z-index: 3;
}

.legend-title {
  text-align: center;
  color: var(--text-light);
  padding-bottom: 1.5rem;
  font-size: 1.8rem;
  font-weight: 600;
}

.legend-palette {
  background: linear-gradient(
    0.25turn,
    hsl(43, 40%, 50%),
    hsl(43, 40%, 20%),
    hsl(174, 90%, 15%),
    hsl(174, 90%, 30%),
    hsl(174, 90%, 50%)
  );
  border-radius: 0.5rem;
  padding: 1.2rem 30rem;
}

.legend-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0 0 0;
  font-size: 1.8rem;
}

.legend-labels p {
  color: var(--text-light);
  font-family: openSans;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Footer Styles */

.footer {
  position: absolute;
  display: flex;
  align-items: center;
  top: calc(var(--header-height) + var(--main-height));
  left: 0;
  height: var(--footer-height);
  width: 100%;
  background-color: var(--footer-background);
  z-index: 1;
}

.footer p {
  font-size: 1.2rem;
  font-weight: 200;
  padding-left: 2rem;
  color: hsl(0, 0%, 85%);
}

/* Modal Styles */

.modal {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 990;
  display: none;
}

.modal .overlay {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 995;
  background: rgba(129, 129, 129, 0.7);
  backdrop-filter: blur(4rem);
  -webkit-backdrop-filter: blur(4rem);
}

.modal .modal-content {
  position: absolute;
  font-size: 2rem;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: 70%;
  width: 60%;
  background: hsl(0, 0%, 98%);
  box-shadow: 1px 1px 3px rgba(15, 15, 15, 0.7);
  border-radius: 1rem;
  z-index: 999;
}

.modal .modal-content header {
  display: flex;
  justify-content: baseline;
  align-items: center;
  background-color: var(--kstn-green-l3);
  color: var(--text-light);
  height: var(--modal-header-height);
  padding: 1.5rem;
  border-radius: 1rem 1rem 0 0;
}

.modal .modal-content header .back-button {
  display: flex;
  justify-content: baseline;
  align-items: center;
}

.modal .modal-content header .back-button:hover {
  cursor: pointer;
}

.modal-body {
  margin: 0;
  padding: 3rem 3rem;
  height: calc(99% - var(--modal-header-height));
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}

.modal-body h6 {
  font-size: 3rem;
  color: hsl(0, 0%, 0%);
  font-family: Georgia, "Times New Roman", Times, serif;
}

.modal-body p {
  font-size: 2rem;
  color: var(--text-dark);
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 200;
}

.modal-body ul {
  font-size: 2rem;
  color: var(--text-dark);
  list-style-type: "-  ";
  margin-left: 2rem;
  padding-top: 1rem;
  font-family: Georgia, "Times New Roman", Times, serif;
}

.modal-body li {
  font-family: Georgia, "Times New Roman", Times, serif;
}

.modal-body img {
  margin-left: 2rem;
  width: 40%;
  padding: 2rem;
}

/* Slider Styles */

span.irs-grid {
  font-size: 1rem;
}

div.filter.slider > div > div > span > span.irs > span.irs-from,
div.filter.slider > div > div > span > span.irs > span.irs-to,
div.filter.slider > div > div > span > span.irs > span.irs-single {
  font-size: 1.6rem;
  background-color: var(--control-select-color);
}

div.filter.slider > div > div > span > span.irs > span.irs-min,
div.filters-container > div.filter.slider > div > div > span > span.irs > span.irs-max {
  font-size: 1.5rem;
}

div.filter.slider > div > div > span > span.irs-bar {
  /* position: relative; */
  height: 1.4rem;
  background-color: var(--control-select-color);
}

div.filter.slider > div > div > span > span.irs > span.irs-line {
  height: 1.4rem;
}

div.sliders > div > div > span > span.irs-grid > span.irs-grid-text {
  color: var(--text-light);
}

/* Popup Styles */

.mapboxgl-popup-close-button {
  display: none;
}

.mapboxgl-ctrl-group button {
  height: 25px !important;
  width: 25px !important;
}

.mapboxgl-popup-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: black !important;
  color: var(--text-light) !important;
  padding: 1rem 1rem !important;
  max-width: 60vw;
  max-height: fit-content;
  text-align: center;
  border-radius: 5px !important;
  border: 0.5rem solid hsl(0, 0%, 30%);
}

.mapboxgl-popup-content .header {
  padding: 0.5rem;
}

.mapboxgl-popup-content h6 {
  color: var(--text-light) !important;
  font-size: 1.8rem !important;
  font-weight: 800;
}

.mapboxgl-popup-content h4 {
  color: var(--text-light) !important;
  font-size: 1.5rem !important;
  font-weight: 600;
  margin-top: 1rem;
}

.mapboxgl-popup-tip {
  display: none !important;
}

#map > div.mapboxgl-control-container > div.mapboxgl-ctrl-bottom-right > div > div > a {
  font-family: Roboto, sans-serif;
  color: var(--text-light);
}

#map > div.mapboxgl-control-container > div.mapboxgl-ctrl-bottom-right > div {
  background-color: black !important;
  margin-right: 2px;
}

/* Display Styles */

.show {
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
}

.hide {
  opacity: 0.1;
  pointer-events: none;
  transition: opacity 0.3s ease-in-out;
}

.show-block {
  display: block !important;
}

.hide-block {
  display: none !important;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ----------- Mobile ----------- */

/* Portrait and Landscape */
@media screen and (pointer: coarse) and (orientation: portrait) and (max-width: 1394px) {
  * {
    font-size: 3vmin !important;
    --nav-height: 4rem;
  }

  .side-panel {
    left: 0;
    width: 100%;
    height: var(--main-height);
  }

  .filter-button {
    font-size: 1.3rem !important;
  }

  h6 {
    font-size: 1.8rem !important;
  }

  h5,
  h4 {
    font-size: 1.5rem !important;
  }

  .variable-card h5 {
    font-size: 2.8rem !important;
  }

  h5.small-font {
    font-size: 1.8rem !important;
  }

  img.logo {
    height: calc(7rem - var(--logo-padding));
  }

  img#info-button {
    height: 1.8rem;
  }

  .mobile-hide-block {
    display: none !important;
  }

  .full-screen-map {
    left: 0;
    width: 100% !important;
    height: 100% !important;
    background-color: black;
  }

  #map {
    height: calc(100% - var(--legend-container-height) + 0.5rem);
  }

  .legend {
    padding: 1rem 1rem 0.5rem 1rem;
  }

  .legend-container {
    padding: 0 !important;
    height: fit-content !important;
  }

  .legend-title {
    font-size: 1.4rem !important;
  }

  .legend-palette {
    padding: 0.6rem 15rem;
  }

  .nav-bar {
    position: absolute;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
    width: 100%;
    padding: 2px;
    bottom: var(--footer-height);
    background-color: var(--panel-background);
  }

  .nav-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 97%;
    height: 100%;
    text-align: center;
    padding: 1rem;
    color: var(--text-light);
    font-size: 1.4rem !important;
    background-color: var(--panel-background-l2);
    border-radius: 5px;
    margin: 0 2px;
  }

  .nav-button img {
    height: 1.8rem;
    padding: 0 0.5rem;
  }

  .nav-button.selected {
    background-color: var(--control-select-color);
  }

  .nav-button:hover {
    cursor: pointer;
  }

  .main {
    height: calc(100% - var(--header-height) - var(--nav-height));
    background-color: var(--panel-background-l1);
  }

  .mapboxgl-popup-content h6 {
    font-size: 1.1rem !important;
  }

  .mapboxgl-popup-content h4 {
    font-size: 1rem !important;
  }

  .modal {
    height: calc(100% - var(--footer-height));
  }

  .modal header .back-button {
    font-size: 2rem !important;
  }

  .modal header .back-button img {
    height: 3rem !important;
  }

  .modal .modal-content {
    height: 100%;
    width: 100%;
  }

  .modal-body {
    padding: 1rem 1.5rem;
  }

  .modal-body p {
    font-size: 1.7rem !important;
  }

  .modal-body img {
    margin-left: 2rem;
    width: 80%;
    padding: 2rem;
  }

  .modal-body li,
  .modal-body a {
    font-size: 1.6rem !important;
  }
}

@media screen and (pointer: coarse) and (orientation: landscape) and (max-width: 925px) {
  * {
    font-size: 3vmin !important;
    --nav-height: 4rem;
  }

  body {
    background-color: black;
  }

  .side-panel {
    display: none !important;
  }

  h6 {
    font-size: 1.8rem !important;
  }

  h5,
  h4 {
    font-size: 1.5rem !important;
  }

  .mobile-hide-block {
    display: none !important;
  }

  .full-screen-map {
    left: 0;
    width: 100% !important;
    height: 100% !important;
    background-color: black;
  }

  #map {
    height: calc(100% - var(--legend-container-height) + var(--nav-height) + 0.5rem);
    width: 100%;
  }

  .legend {
    padding: 1rem 1rem 0.5rem 1rem;
  }

  .legend-container {
    padding: 0 !important;
    height: fit-content !important;
  }

  .legend-title {
    font-size: 1.4rem !important;
  }

  .legend-palette {
    padding: 0.6rem 15rem;
  }

  .nav-bar {
    display: none !important;
  }

  .main {
    height: calc(100% - var(--header-height) - var(--nav-height));
    background-color: var(--panel-background-l1);
    z-index: 999;
  }

  .right-container {
    height: 100% !important;
    width: 100% !important;
    left: 0;
  }

  .mapboxgl-popup-content h6 {
    font-size: 1.1rem !important;
  }

  .mapboxgl-popup-content h4 {
    font-size: 1rem !important;
  }
}
