/* general */

html,
body{
    margin: 0;
    padding: 0;
}

body{
    height: 100vh;
    width: 100vw;
}

*{
    box-sizing: border-box;
}

/* map */

#map{
    width: 100%;
    height: 100%;
    font-family: Arimo, Arial, Helvetica Neue, Helvetica, sans-serif;
}

/* languages */

.language-fr{
    display: inline;
}

.language-en{
    display: none;
}

/* location description */

.location-description-title{
    font-weight: bold;
}

.location-description-entity{
    margin-top: .5em;
}

.location-description-entity-status{
    font-size: .75rem;
    font-style: italic;
}

/* location search */

div #location-search{
    pointer-events: none;
}

#location-search{
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    margin-top: 10px;
    margin-bottom: 10px;
    pointer-events: none;
}

.location-search-plot-text{
    background-color: rgba(255, 143, 247, 0.6);
}

.location-search-address-text{
    background-color: rgba(252, 239, 53, 0.6);
}

#location-search-main-column{
    display: flex;
    flex-direction: column;
    width: min(325px, 40vw);
    max-height: calc(100vh - 20px - 1.5em); /* viewport height minus the element margins and the bottom-right scale height and margins */
    border: 1px solid rgba(0,0,0,0.2);
    background-color: white;
    pointer-events: auto;
}

#location-search-input{
    display: flex;
}

#location-search-input-field{
    flex-basis: 85px;
    flex-grow: 1;
    flex-shrink: 0;
    width: 100%;
    padding: 0.7em;
    border: none;
    background: transparent;
    z-index: 1;
}

#location-search-input-select-container{
    flex-shrink: 1;
    min-width: 0;
    z-index: 2;
}

#location-search-input-select-field{
    display: none;
    max-width: 100%;
    height: 100%;
    border: none;
    border-left: 1px solid rgba(0,0,0,0.2);
    border-right: 1px solid rgba(0,0,0,0.2);
    background: white;
}

#location-search-input-button{
    flex-shrink: 0;
    width: 40px;
    border: 0;
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' class='bi bi-search' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'%3E%3C/path%3E%3C/svg%3E") no-repeat center;
    opacity: 0.7;
    cursor: pointer;
}

#location-search-suggestions{
    display: none;
}

#location-search-suggestions{
    padding-top: 0.25em;
    border-top: 1px solid rgba(0,0,0,0.2);
    overflow-y: scroll;
}

.location-search-suggestions-title{
    padding-top: 0.25em;
    padding-bottom: 0.25em;
    padding-left: 0.7em;
    padding-right: 0.7em;
    color: #666666;
    font-style: italic;
}

.location-search-suggestions-content-suggestion{
    display: flex;
    justify-content: space-between;
    width: 100%;
    border: none;
    padding-top: 0.25em;
    padding-bottom: 0.25em;
    padding-left: 0.7em;
    padding-right: 0.7em;
    line-height: 1.1;
    background-color: white;
    cursor: pointer;
    text-align: left;
}

.location-search-suggestions-content-suggestion-numbers{
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding-left: 0.5em;
    color: #666666;
}

.location-search-suggestions-content-suggestion-number{
    padding-left: 0.3em;
    padding-right: 0.3em;
    padding-top: 0.1em;
    padding-bottom: 0.1em;
}

.location-search-suggestions-content-suggestion:last-of-type{
    padding-bottom: 0.5em;
}

.location-search-suggestions-content-suggestion:hover, .location-search-suggestions-content-suggestion:focus{
    background-color: #eeeeee;
    outline: none;
}

#location-search-status{
    display: none;
    max-width: min(325px, 40vw);
    margin-left: -1px;
    padding: 0.7em;
    padding-bottom: calc(0.7em - 1px); /* -1px to take into account some borders and have a better final result */
    border: 1px solid rgba(0,0,0,0.2);
    background-color: white;
    font-weight: bold;
    pointer-events: auto;
}

#location-search-zoom-warning{
    display: none;
    max-width: 15vw;
    margin-left: -1px;
    padding: 0.7em;
    padding-bottom: calc(0.7em - 1px); /* -1px to take into account some borders and have a better final result */
    border: 1px solid rgba(0,0,0,0.2);
    background-color: white;
    font-weight: bold;
    pointer-events: auto;
}

/* internal search link */

.internal-search-link{
    cursor: pointer;
    text-decoration: underline;
}

.internal-search-link:hover{
     color: #666666;
}

/* clusters */

.location-cluster-icon{
    width: auto !important;
    height: auto !important;
}

.location-cluster-icon-content{
    display: flex;
    flex-direction: row;
}

.location-cluster-icon-locations{
    padding-top: 0.2em;
    padding-bottom: 0.2em;
    padding-left: 0.4em;
    padding-right: 0.4em;
    border: 1px solid rgba(0,0,0,0.6);
    font-size: 1.2em;
}

.location-cluster-icon-plots{
    background-color: rgba(255, 143, 247, 0.8);
}

.location-cluster-icon-addresses{
    background-color: rgba(252, 239, 53, 0.8);
}

/* language switcher */

.language-switcher{
    display: flex;
    flex-direction: row;
    border: 1px solid rgba(0,0,0,0.2);
    color: #333333;
    background: #ffffff;
}

.language-switcher-button{
    padding-top: 6px;
    padding-bottom: 6px;
    padding-left: 8px;
    padding-right: 8px;
    border-left: 0.5px solid rgba(0,0,0,0.2);
    user-select: none;
}

.language-switcher-button:first-child{
    padding-left: 8px;
    border-left: 0;
}

.language-switcher-button:last-child{
    padding-right: 8px;
    border-right: 0;
}

.language-switcher-button-selected{
    background-color: #e5e5e5;
}

.language-switcher-button:not(.language-switcher-button-selected){
    cursor: pointer;
}

.language-switcher-button:not(.language-switcher-button-selected):hover{
    background-color: #f5f5f5;
}

/* bottom links */

#bottom-links{
    margin: 0;
    padding: 0.2em;
    background-color: rgba(255, 255, 255, 0.8);
    font-size: 1.2em;
}

/* popup windows */

#map .popup-window-container{
    display: none;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    z-index: 7000;
    background-color: rgba(0, 0, 0, 0.7);
}

.popup-window-window{
    position: relative;
    max-width: 50%;
    max-height: 80%;
    padding-left: 1em;
    padding-right: 1em;
    padding-bottom: 1em;
    color: #333333;
    background-color: #ffffff;
    border: 1px solid rgba(0,0,0,0.2);
    font-size: 1.3em;
    overflow: auto;
}

.popup-window-close-button{
    position: absolute;
    width: 30px;
    height: 30px;
    top: 0;
    right: 0;
    background: none;
    border: none;
    color: #757575;
    font: 20px Tahoma, Verdana, sans-serif;
    cursor: pointer;
}

.popup-window-close-button:hover{
    color: #555555;
}

.popup-window-link{
    background: none;
    border: none;
    padding: 0.3em;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.95em;
    color: #333333;
}

.popup-window-link:hover{
    color: #000000;
}

/* leaflet popup */

.leaflet-popup-content-wrapper{
    max-height: 70vh;
    overflow-y: scroll;
}

.leaflet-popup-content{
    width: min(320px, 70vw) !important; /* !important is required here because width is set by Leaflet in the element style property... */
}

/* leaflet control zoom */

#map .leaflet-control-zoom{
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 0;
}

#map .leaflet-control-zoom-in{
    border-bottom: 1px solid rgba(0,0,0,0.2);
    border-radius: 0;
}

#map .leaflet-control-zoom-out{
    border-top: 0;
    border-radius: 0;
}

/* leaflet control attribution */

#map .leaflet-control-attribution{
    margin-left: 100px;
}
