@import "../../styles/modules/importAll";

.MapVisualisation {
    position: relative;
    height: 100%;

    .mapContainer {
        position: relative;
    }

    .leaflet-container {
        width: 100%;
        height: 100%;
    }

    h2 {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        padding: 8px;

        span {
            text-align: center;
        }
    }

    .chartMeta {
        text-align: center;
        color: #aaa;
    }

    .PopupContent {
        position: relative;
        min-width: 12rem;
        margin-bottom: 0.5rem;

        .imageContainer {
            position: relative;
            width: 100%;
            min-height: 8rem;
            display: flex;
            flex-direction: column;
            justify-content: space-around;

            img {
                width: 100%;
                image-orientation: from-image;
            }

            .suppressImageContextMenu {
                position: absolute;
                left: 0;
                right: 0;
                bottom: 0;
                top: 0;
            }

        }

        ul,
        ol {
            list-style: none;
        }
    }

    .Legend {
        z-index: 999;
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
        max-height: 95%;
        max-height: calc(100% - 2rem);
        background-color: white;
        overflow-y: auto;
        width: 25%;
        max-width: 16rem;
        min-width: 10rem;
        background: rgb(245,245,245);
        border: 1px solid $lightGrey;

        > .container {
            position: relative;
            max-width: 100%;
        }

        .LegendEntry {
            margin: 0.25rem;
            display: flex;
            padding: 0.25rem;
            max-width: 100%;
            border: 1px solid $lightGrey;
            background: white;
            position: relative;

            h4, h5 {
                margin-bottom: 0.25em;
            }
        }

        .LegendEntry > .container {
            display: flex;
            flex-direction: column;
            position: relative;
            width: 100%;
            padding: 0.5rem;
        }

        .listContainer {
            margin-top: 0.5rem;
            display: flex;
            overflow-y: auto;
            overflow-x: hidden;
            position: relative;
            max-width: 100%;

            ul {
                display: flex;
                justify-content: flex-start;
                flex-direction: column;
                align-items: flex-start;
                flex: 1;
                position: relative;
                max-width: 100%;
                list-style: none;
            }

            li {
                display: flex;
                justify-content: flex-start;
                font-size: 0.9rem;
                align-items: center;
                margin-bottom: 0.5rem;
                &:last-child {
                    margin-bottom: 0;
                }

                .colorMarker {
                    display: block;
                    height: 12px;
                    width: 12px;
                    border-radius: 50%;
                    flex-shrink: 0;
                    margin-right: 4px;
                }
            }
        }
        .italic {
            font-style: italic;
        }
        .contents {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .gradientContainer {
            width: 100%;
            position: relative;
            margin: 0.5rem 0;
            height: 2rem;
        }
        .gradientDisplay {
            width: 100%;
            height: 1rem;
            margin-top: 0.75rem;
            border: 1px solid black;
        }
        .gradientLabel {
            position: absolute;
            font-size: 0.75rem;
            text-transform: uppercase;
            text-align: center;
            top: -0.25rem;

            &.min {
                left: 0;
            }
            &.max {
                right: 0;
            }
        }
    }
    .LoadingSpinner {
        z-index: 999;
        position: absolute;
        background: rgba(0, 0, 0, 0.1);
    }
    .failedIndicator {
        z-index: 999;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.1);

        &:after {
            position: absolute;
            height: 2rem;
            width: 2rem;
            display: flex;
            align-items: center;
            justify-content: center;
            content: '✖';
            left: calc(50% - 1rem);
            top: calc(50% - 1rem);
            color: rgba(0,0,0,0.2);
            font-size: 2rem;
        }
    }
}

@media print {
    .leaflet-control-container{
        display: none !important;
    }
}