/* ===========================================
Overall CSS settings and
light CSS settings for simple modules

CSS for complex modules, see other files

@auther: Jie Li
@Date: 12/07/2022
============================================== */

/* --- Overall settings ---- */

:root {
  --hero-reg: #353795;
  --hero-faded: #c8b7d9;
  --primary-reg: #ef8872;
  --primary-faded: #fec7ba;
  --highlight-reg: #fdd310;
  --text-gray: #999;
  --light-gray: #ccc;
  --fade-gray: #eee;
  --nav-height: 6vh;
  --phone-ht-reduction: 10vh; /* On phones height of main body should be reduced */
  --main-padding: 2rem; /* padding outside of the entire page */
  --light-border: 1px solid var(--light-gray);
  --shadow-layer-1: 0.05rem 0.1rem 0.1rem 0.02rem rgba(0 0 0 / 20%);
  --shadow-layer-2: 0.15rem 0.2rem 0.2rem 0.02rem rgba(0 0 0 / 20%);
  --slider-height: 1.2rem;
  --toggle-display-panel-height: 7.5rem;
  --map-legend-panel-height: 3rem;
  --column-total-height: 41rem;
  --dashboard-panel-height: auto;
}

@media only screen and (max-width: 500px) {
  :root {
    --main-padding: 2rem 1rem;
  }
}

* {
  font-family: "JetBrains Mono", Hack, sans-serif;
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
}

button {
  border: var(--light-border);
  cursor: pointer;
  background-color: var(--fade-gray);
  border-radius: 0.2rem;
}

button:hover {
  background-color: var(--light-gray);
}

.italic {
  font-style: italic;
}

.strong {
  font-weight: 600;
}

/* ====== Navigation bar ====== */

nav {
  position: fixed;
  background-color: var(--hero-reg);
  width: 100%; /* If width is 100%, padding will add width */
  height: var(--nav-height);
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
  color: white;
}

nav * {
  cursor: pointer;
}

.nav-left {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 1rem;
}

.nav-title {
  line-height: 0.7;
  margin: 0;
}

.nav-phila-icon {
  height: 4vh;
}

.nav-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
}

.nav-subtitle {
  font-size: 1rem;
}

/* ------ Nav bar settings on smaller screens ------ */

@media only screen and (max-width: 768px) {
  .nav-subtitle {
    display: none;
  }
}

/* -------- map -------- */

.map {
  height: 100vh;
  width: 100vw;
  position: fixed;
  z-index: 0;
}

.leaflet-control-attribution {
  z-index: 999;
}

/* -------- Main section -------- */

/* -----
Main section is 100% width and the height is 100vh minus navbar
Main section is a flexbox containing two columns of panels
On larger screens the columns should be spread out left and right
On smaller screens the columns should be stacked vertically
------ */

.main-section {
  position: relative;
  top: var(--nav-height);
  width: 100%;
  height: calc(100vh - var(--nav-height));
  display: flex;
  justify-content: space-between;
  padding: var(--main-padding);
  gap: 0.5rem;
  overflow: auto;
  pointer-events: none;
}

@media only screen and (max-width: 1200px) {
  .main-section {
    height: calc(100vh - var(--phone-ht-reduction) - var(--nav-height));
    justify-content: flex-start;
    flex-direction: column;
  }
}

@media only screen and (max-width: 500px) {
  .main-section {
    align-items: center;
    padding-top: 1rem;
  }
}

/* Column is at least 25% of screen, preferrably 20rem,
and when screen is smaller than 20rem, go for 100% */

.column {
  width: clamp(20%, 20rem, 100%);
  display: flex;
  gap: 0.5rem;
  flex-direction: column;
  pointer-events: auto;
}

.right-column {
  overflow: auto;
}

/* ------- Main panels --------- */

.panel {
  width: 100%;
  background-color: white;
  border: 1px solid var(--light-gray);
  border-radius: 0.25rem;
  z-index: 1;
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  box-shadow: var(--shadow-layer-1);
}

.panel-title {
  color: var(--hero-reg);
  font-size: 1.1rem;
  line-height: 0.9;
  margin: 0;
}

.toggle-display-panel {
  z-index: 3;
  height: var(--toggle-display-panel-height);
}

.map-legend-panel {
  height: var(--map-legend-panel-height);
}

.dashboard-panel {
  height: var(--dashboard-panel-height);
}

/* ------ Panel tab ------- */

.panel-select-tabs {
  flex-direction: row;
  padding: 0.25rem 0;
  gap: 0;
  justify-content: space-between;
  border-width: 0;
  display: none;
  height: 2rem;
}

.panel-tab {
  flex-grow: 1;
  background-color: white;
  border-width: 0;
  border-radius: 0.15rem;
  border-right: 1px solid var(--light-gray);
  color: var(--primary-reg);
}

.panel-tab-selected {
  background-color: var(--primary-reg);
  color: white;
  font-weight: 800;
  border-color: var(--primary-reg);
}

.panel-tab-selected:hover {
  background-color: var(--primary-reg);
}

@media only screen and (max-width: 1200px) {
  .panel-select-tabs {
    display: flex;
  }

  .dashboard-panel {
    display: none;
  }

  .filter-panel {
    display: none;
  }

  .confirm-button {
    display: none;
  }
}

/* -------- Map loading overlay ----------- */

.map-loading-overlay {
  height: 100vh;
  width: 100vw;
  background-color: white;
  position: fixed;
  opacity: 0.82;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hero-reg);
  padding: 0 clamp(1rem, 30%, 40%);
}

/* --------- Information overlay ------------- */

.information-overlay {
  height: 100vh;
  width: 100vw;
  position: fixed;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--hero-reg);
}

.information-overlay-white {
  height: 100vh;
  width: 100vw;
  background-color: black;
  position: fixed;
  z-index: 20;
  display: flex;
  opacity: 0.5;
  align-items: center;
  justify-content: center;
  color: var(--hero-reg);
}

.information-window {
  width: clamp(20%, 20rem, 100%);
  background-color: white;
  border-radius: 0.3rem;
  box-shadow: var(--shadow-layer-2);
  font-size: 0.85rem;
  padding: 0.7rem;
  z-index: 30;
}

.information-window a {
  color: var(--hero-reg);
}