html, body, #mapDiv {
    margin: 0;
    padding: 0;
    height: 100dvh;
    width: 100vw;
}
body {
    --usa-banner-height: 65px;
    --usa-banner-expanded-height: 180px;
}

#mapDiv {
    height: calc(100dvh - var(--usa-banner-height));
}
body.banner-expanded #mapDiv {
    height: calc(100dvh - var(--usa-banner-expanded-height));
}

.btn.btn-primary {
    background-color: #15396c;
    border-color: #15396c;
}
    .btn.btn-primary:hover {
        opacity: .95;
    }

.modal .modal-header {
    border-bottom: none;
    padding-bottom: 0;
}
.modal .modal-body {
    padding-bottom: 0;
}
.modal.show .modal-dialog {
    display: flex;
    align-items: center;
    height: 100%;
    margin-top: 0;
    margin-bottom: 0;
}

.esri-ui-top-left .esri-search {
    width: 300px;
}
.esri-search__input::placeholder {
    color: #585858;
}
.esri-icon-search:before, .esri-icon-locate:before {
    color: #585858;
}

#gradeToggleContainer {
    position: absolute;
    bottom: 2rem;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 0;
}
    #gradeToggleContainer .btn-outline-secondary {
        padding: .375rem 4rem;
    }
    #gradeToggleContainer .btn-check:checked + .btn-outline-secondary,
    #selectBasemapContainer .btn-check:checked + .btn-outline-secondary {
        background-color: #15396c;
        border-color: #15396c;
    }
        #gradeToggleContainer .btn-check:checked + .btn-outline-secondary:focus,
        #gradeToggleGroup .btn-check:focus + .btn-outline-secondary,
        #selectBasemapContainer .btn-check:checked + .btn-outline-secondary:focus,
        #selectBasemapGroup .btn-check:focus + .btn-outline-secondary {
            box-shadow: 0 0 0 0.15rem rgb(21 57 108 / 50%);
        }
    #gradeToggleContainer .btn-check:not(:checked) + .btn-outline-secondary,
    #selectBasemapContainer .btn-check:not(:checked) + .btn-outline-secondary {
        background-color: rgb(255 255 255 / 90%);
        border-color: #15396c;
        color: #383838;
    }
        #gradeToggleContainer .btn-check:not(:checked) + .btn-outline-secondary:hover,
        #selectBasemapContainer .btn-check:not(:checked) + .btn-outline-secondary:hover {
            z-index: 0;
            background-color: #f0f0f0;
        }

#additionalActionsContainer {
    position: absolute;
    top: calc(65px + 1rem);
    right: 0;
    display: flex;
    z-index: 0;
    border-radius: 4px;
    padding: 0 0.5rem;
}
    #additionalActionsContainer a {
        color: #15396c;
        background: white;
        font-size: 1.4rem;
        margin: 0 0.66rem;
        padding: 0.2rem 0.5rem;
        border-radius: 4px;
        border: 1px solid #15396c;
    }
        #additionalActionsContainer a:hover {
            background-color: #f0f0f0;
        }
body.banner-expanded #additionalActionsContainer {
    top: calc(180px + 1rem);
}

.popup-container {
    position: absolute;
    top: calc(65px + 4rem);
    right: 1.11rem;
    background: white;
    border-radius: 4px;
    border: 1px solid #15396c;
    padding: 0.5rem;
}

#selectBasemapContainer {
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #15396c;
    border-bottom: none;
    padding: 0;
}
    #selectBasemapContainer h4 {
        font-weight: 400;
        font-size: 1.35rem;
        margin: 0;
        padding: 0.5rem 0;
    }

#selectBasemapGroup {
    width: 100%;
}
    #selectBasemapGroup .btn-outline-secondary:first-of-type {
        border-left: none;
        border-top-left-radius: 0;
        margin-left: 0;
    }
    #selectBasemapGroup .btn-outline-secondary:last-of-type {
        border-right: none;
        border-top-right-radius: 0;
    }

#infoContainer {
    max-width: 50%;
}
    #infoContainer p {
        margin-bottom: 0;
    }

#advancedSearchContainer {
    flex-direction: column;
}
    #advancedSearchContainer label {
        font-weight: 500;
    }
    #advancedSearchContainer .hover-info {
        color: #15396c;
        margin-left: 5px;
        cursor: pointer;
        outline: none;
        font-size: 18px;
    }

#crossingsListContainer {
    flex-direction: column;
    max-height: 50dvh;
    overflow-y: scroll;
}
    #crossingsListContainer > div:not(:last-of-type) {
        padding-bottom: 5px;
        margin-bottom: 5px;
        border-bottom: 1px solid #afafaf;
    }
    #crossingsListContainer .crossing {
        cursor: pointer;
    }

.crossing-details-link {
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
}
    .crossing-details-link:hover {
        color: #000;
    }

#crossingDetailsContainer {
    padding: 0.5rem 0.75rem;
    max-height: 60dvh;
    overflow-y: auto;
}
    #crossingDetailsContainer > div {
        display: flex;
        flex-direction: column;
    }
    #crossingDetailsContainer h5 {
        font-size: 1.25rem;
        font-weight: 500;
    }
    #crossingDetailsContainer h6 {
        font-size: 1.1rem;
    }
    #crossingDetailsContainer a, #ens {
        color: #000;
        text-decoration: none;
        font-weight: 600;
        font-size: 1.1rem;
    }
        #crossingDetailsContainer a:hover {
            text-decoration: underline;
        }
    #crossingDetailsContainer a, .crossing-attribute, #ens {
        background: rgb(21 57 108 / 20%);
        padding: 0.2rem 0.5rem;
        margin-bottom: 5px;
        border-radius: 4px;
        border: 1px solid #15396c;
    }
#attributesContainer {
    border-right: 1px solid #15396c;
    padding-right: 1.5rem;
    min-width: 250px;
}
#resourcesContainer {
    padding-left: 1.5rem;
}
    #resourcesContainer > div {
        display: flex;
        flex-direction: column;
    }
    #resourcesContainer > div:not(:first-of-type) {
        margin-top: 1rem;
    }
.crossing-attribute {
    display: flex;
    flex-direction: column;
}
b.attribute-name {
    font-size: 1.1rem;
}
#closeCrossingDetails {
    display: none;
    background: none;
    border: none;
    padding: 0;
    font-size: 1.1rem;
    color: #222;
}

@media (max-width: 600px) {
    body {
        --usa-banner-height: 90px;
        --usa-banner-expanded-height: 330px;
    }
    #gradeToggleContainer {
        bottom: 5rem;
    }

        #gradeToggleContainer .btn-outline-secondary {
            padding: .375rem 0;
            font-size: 1.2rem;
        }

    #gradeToggleGroup {
        width: 90%;
    }

    .esri-ui-top-left {
        width: 100%;
    }

        .esri-ui-top-left .esri-search {
            width: 100%;
        }

    #additionalActionsContainer {
        width: 100%;
        background: white;
        right: 0;
        bottom: 0;
        top: unset !important;
        height: 60px;
        align-items: center;
        justify-content: space-around;
        border-top: 1px solid #15396c;
        border-radius: 0;
    }

        #additionalActionsContainer a {
            border: none;
            padding: 0 0.5rem;
            font-size: 1.8rem;
        }

            #additionalActionsContainer a.active {
                border: 1px solid #15396c;
            }

        #additionalActionsContainer.expanded {
            border-top: none;
        }

    .popup-container {
        top: unset;
        bottom: 60px;
        right: 0;
        width: 100%;
        z-index: 1;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    #infoContainer {
        max-width: 100%;
    }

    #advancedSearchContainer .hover-info {
        font-size: 20px;
        margin-top: 2px;
    }

    #crossingDetailsContainer {
        flex-direction: column;
    }

    #attributesContainer {
        border-right: none;
        padding-right: 0;
    }

    #resourcesContainer {
        padding-left: 0;
        margin-top: 0.5rem;
    }

        #resourcesContainer > div:not(:first-of-type) {
            margin-top: 0.5rem;
        }

    #closeCrossingDetails {
        display: block;
    }
    .esri-search__input-container, .esri-search__container .esri-search__input, .esri-search__container .esri-widget--button {
        height: 40px;
    }
    .esri-widget--button {
        width: 36px;
        height: 36px;
    }
        .esri-widget--button [class*=esri-icon] {
            font-size: 18px;
        }
}

/* Hide search source selection */
.esri-search__sources-button {
    display: none !important;
}

/* Loading spinner */
#loaderOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    background: rgb(0, 0, 0, 40%);
}

#loader {
    width: 48px;
    height: 48px;
    border: 5px solid #FFF;
    border-bottom-color: #15396c;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    position: absolute;
    top: calc(50% - 24px);
    left: calc(50% - 24px);
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
} 