html, body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    font-family: "Arial", sans-serif;
}

body {
    --header-height: 80px;
    --footer-height: 80px;
}

header, footer {
    position: fixed;
    left: 0;
    width: 100%;
    color: white;
    text-align: center;
    z-index: 1000;
    font-size: 1em;
}

header {
    display: flex;
    top: 0;
    height: var(--header-height);
    line-height: var(--header-height);
    align-items: center;
    justify-content: center;
    background-color: #333;
}

footer {
    display: flex;
    bottom: 0;
    height: var(--footer-height);
    line-height: var(--footer-height);
    background-color: #333;
    justify-content: space-evenly;
    align-items: center;
}

main {
    position: absolute;
    top: var(--header-height);
    bottom: var(--footer-height);
    left: 0;
    right: 0;
    overflow: hidden;
}

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

#infobox {
    position: absolute;
    top: 10px;
    right: 10px;
    width: clamp(150px, 20vw, 300px);
    bottom: 25px;
    word-wrap: break-word;
    background: white;
    padding: 10px;
    border: 1px solid #333;
    z-index: 1000;
    overflow-y: auto;
    box-sizing: border-box;
    box-shadow: 2px 2px 5px;
}

.race-ethnicity {
    background-color: palevioletred;
}
.household-type {
    background-color: paleturquoise;
}
.industry {
    background-color: palegoldenrod;
}
.educational-attainment {
    background-color: palegreen;
}

#reset-button {
    height: minmax(max-content, 5%);
    background: #333;
    color: white;
    cursor: pointer;
}

#reset-button:hover {
    background: #555;
}

#profile:link, #profile:visited {
    color: white;
}

#controls {
    position: absolute;
    top: 10px;
    left: 50px;
    display: flex;
    border-radius: 4px;
    gap: 10px;
    z-index: 1000;
    align-items: center;
}

@media (max-width: 1200px) {
    #controls {
        flex-direction: column;
        left: 10px;
        right: 10px;
        top: 10px;
        gap: 6px;
    }

    #controls select,
    #controls button,
    #controls form {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }

    .leaflet-control-zoom {
        top: 210px;
        left: 0;
    }

    #map {
        width: 100%;
        height: 80%;
        position: relative;
    }

    #infobox {
        position: absolute;
        top: 80%;
        left: 0;
        right: 0;
        margin: 0;
        height: 1400px;
        margin: 0;
        border-top: 1px solid #333;
        border-left: none;
        border-right: none;
        box-shadow: 0 -2px 5px rgba(0,0,0,0.2);
        width: 100%;
        padding: 15px 20px;
        overflow-y: auto;

        column-count: 2;
        column-gap: 20px;

        column-fill: auto;
        white-space: normal;
        box-sizing: border-box;
    }

    .suggestions {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        background: white;
        border: 1px solid #ccc;
        max-height: 200px;
        overflow-y: auto;
        display: none;
        z-index: 1100;
    }

    main {
        top: var(--header-height);
        bottom: var(--footer-height);
        overflow-y: auto;
    }

    #search-form {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        position: relative;
    }
    #search-input {
        width: 100%;
        height: 3vh;
        box-sizing: border-box;
        text-align: center;
    }
    #search-input:focus {
        text-align: left;
    }
    #search-form button {
        align-self: center;
    }
}

@media (max-width: 480px) {
    body {
        --header-height: 60px;
        --footer-height: 60px;
    }
    header h1 {
        font-size: 1rem;
    }
}

#controls select, #controls button, #controls form {
    background-color: white;
    padding: 6px 12px;
    border: 1px solid black;
    border-radius: 4px;
    font-size: clamp(0.8rem, 2vw, 1rem);
    box-shadow: 2px 2px 5px;
}
#controls>button {
    background-color: black;
}

.suggestions { 
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    max-height: 200px;
    overflow-y: auto;
    width: 200px;
    display: none;
    z-index: 1000;
}

.suggestions * {
    border: 1px solid #ccc;
    cursor: pointer;
}

.info.legend {
  padding: 6px 8px;
  font: 14px/16px Arial, Helvetica, sans-serif;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 15px rgba(0,0,0,0.2);
  border-radius: 5px;
  line-height: 18px;
  color: #333;
  z-index: 1100; /* above infobox/buttons */
}

.info.legend i {
  width: 18px;
  height: 18px;
  float: left;
  margin-right: 8px;
  opacity: 0.7;
}