/* licenced under EUPL, https://eupl.eu/1.2/nl/*/

/*native css nesting*/
/*& is a parent selector*/
/*> is a child combinator*/
/*starting nested selector w/ identifier (i.e. input) is invalid and must be replaced by :is(identifier)*/
/*https://www.w3.org/TR/css-nesting-1/*/

:root {
    /*colors */
    /*--default-blue-primary: #062a64;*/
    /*--default-blue-primary-tint-1: #3a5f99;*/
    /*--default-blue-primary-tint-2: #a7b7d2;*/
    /*--default-blue-primary-tint-3: #ced7e6;*/
    --color-grey-light: #ededed;
    --color-grey-mid: #c6c6c6;
    --color-grey-dark: #858585;
    --color-white: #ffffff;
    --color-bg-opacity: rgba(250, 250, 250, 0.7);
    --color-bg-opacity-strong: rgba(250, 250, 250, 0.8);
    --color-shadow: rgba(0, 0, 0, 0.2);
    --font-weight-normal: 400;
    --font-weight-semibold: 500;
    --font-weight-bold: 600;
    --font-weight-extra-bold: 700;

    /*sizes/font/space/padding/width/height*/
    --size-350: 350px;
    --size-50: 50px;
    --size-40: 40px;
    --size-25: 25px;
    --size-20: 20px;
    --size-15: 15px;
    --size-10: 10px;
    --size-5: 5px;
    --size-button: 40px;
    --size-button-small: 25px;
    --size-icon: 15px;
    --size-icon-small: 10px;
}

.flexmap{
    width: 100%;
    height: 100%;
    position: relative;
}

.flexmap_content {
    width: 100%;
    height: 100%;
}

button {
    background: transparent;
    border: none;
}

/*topbar*/
.topbar.wrapper {
    height: var(--size-50);
    width: 100%;
    top: 46px;
    position: fixed;
    background-color: var(--color-bg-opacity);
    backdrop-filter: saturate(200%) blur(10px);
}

/*nav container*/
nav {
    display: flex;
    flex-direction: row;
    width: 94%;
    height: 100%;
    justify-content: space-between;
    margin: 0 auto;

    & .left,
    & .center,
    & .right {
        display: flex;
        align-items: center;
    }

    & .left > ul,
    & .right > ul {
        display: flex;
        gap: var(--size-10);
    }

    & .left > ul > li,
    & .right > ul > li {
        list-style: none;
        width: var(--size-40);
        height: var(--size-40);
    }

    :is(button):not(.avatar-button) {
        width: var(--size-button);
        height: var(--size-button);
        background-color: transparent !important;
        border: none;
    }

    /*search bar*/
    & .center {
        position: relative;
        width: max-content;
        margin: 0 auto;
    }

    & .search {
        box-sizing: border-box;
        width: var(--size-350);
        height: 30px;
        border-radius: var(--size-20);
        border: 1px solid var(--clr-primary);
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;

        :is(div) {
            position: relative;
            width: 100%;
            padding: 0 10px 0 10px;
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: space-around;
            gap: 8px;
        }

        /*stop layout shift on click*/
        input#input, button#map-search, button#clear-search {
            vertical-align: middle;
            line-height: 1;
            border: none;
            outline: none;
        }

        button#clear-search {
            display: none;
        }

    }

    & button#map-search, button#clear-search {
        width: var(--size-icon);
        height: var(--size-icon);
        background-color: transparent !important;
        border: none;

        :is(svg) {
            height: var(--size-icon);
            width: var(--size-icon);
            fill: var(--clr-primary);
        }

        &::placeholder {
            color: var(--color-grey-light);
        }
    }

    /*clear button grey not blue*/
    & button#clear-search svg {
        fill: #b1b1b1 !important;

        &:hover {
            box-shadow: none !important;
        }

        &:active {
            fill: #e1e1e1 !important;
            box-shadow: none !important;
        }
    }

    & .center .search input#input {
        font-family: inherit;
        font-size: inherit;
        background-color: transparent !important;
        outline: none;
        border: none;
        color: var(--color-grey-dark) !important;
        width: 100%;
        transition: all ease-in-out 0.5s;
    }
}

.placeholder-border-bottom {
    &::after{
        content: "";
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 10px;
        border-left: 1px solid var(--clr-primary);
        border-right: 1px solid var(--clr-primary);
        box-sizing: border-box;
        pointer-events: none;
    }
}

/*search results*/
.search_results {
    display: none; /*javascript*/
    box-sizing: border-box;
    position: absolute;
    padding: 20px 0 20px 0;
    top: 100%;
    left: 0;
    width: var(--size-350); /*width of input, temporary fix*/
    max-height: 400px;
    overflow-y: auto;
    border-radius: 0;
    border: 1px solid var(--clr-primary);
    border-top: none;
    background-color: var(--color-bg-opacity-strong);


    > ul {
        position: relative;
        list-style: none;
        margin-top: -20px;
        display: flex;
        flex-direction: column;
        gap: 5px;
        /*overflow-y: auto;*/
        /*scrollbar-gutter: stable both-edges;*/

        /*border-top less wide than container*/
        &::before {
            display: block;
            content: "";
            position: sticky;
            top: -20px;
            left: 15px;
            width: calc(100% - 30px);
            border-top: 1px solid var(--clr-primary);
        }
    }
    
    > ul li {
        display: flex;
        width: 100%;
        text-indent: 15px;
        cursor: pointer;
        height: 25px;
        align-items: center;
        white-space: nowrap;
        text-overflow: ellipsis;/*not yet working*/
        transition: 700ms;

        &:hover {
            background-color: #e1e1e1;
        }
    }
}

/*search input states; !importants added for javascript state override*/
.full {
    border-radius: 15px 15px 0 0 !important;
    border-bottom: none !important;
    height: 30px !important;
}

.empty {
    border-radius: 20px;
    border-bottom: 1px solid var(--clr-primary);
    height: 30px;
}

/*all buttons except in widget header*/
/*:not(button.has_action svg) */
button svg.icon:not(svg.icon.header):not(svg.legend_layer_move){
    width: var(--size-button-small);
    height: var(--size-button-small);
    cursor: pointer;
    fill: var(--clr-primary);
    transition: fill 0.3s ease;
    /*all buttons except control buttons*/
    &:hover:not(button.control_button):not(button .disabled) {
        filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.20));
    }
    /*all buttons except control buttons*/
    &:active:not(button.control_button):not(button .disabled) {
        fill: #1A5DFF;
        filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.20));
    }

    &.disabled {
        fill: #a1a1a1;
        cursor: default;
    }
}

/*widgets general*/
.widget {
    will-change: width, height;
    z-index: 1000;
    color: var(--color-grey-dark);
    font-size: 12px;
    box-shadow: -1px 1px 6px var(--color-shadow);

    min-height: 45px;
    max-height: 50vh;
    min-width: 300px;
    width: fit-content;
    max-width: 50vw;

    position: absolute;
    resize: both;
    overflow: hidden;
    display: flex;
    flex-direction: column;

    & > .widget_content {
        flex: 1 1 auto;
        overflow-y: auto;
        overflow-x: hidden;
        padding-top: 15px;
        background-color: white;
    }
}

/*widget header*/
.widget_header {
    cursor: move;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: var(--size-15);
    padding: 15px 0;
    background-color: rgba(26, 26, 26, 0.5);

    /*glassy blur*/
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* Safari */
    color: var(--color-white);

    & > .title {
        display: flex;
        align-items: center;
        gap: var(--size-10);
        padding-left: var(--size-15);
        height: var(--size-15);

        & > p {
            font-weight: var(--font-weight-bold);
            font-size: 14px;
        }

        & > svg {
            width: var(--size-icon);
            height: var(--size-icon);
            cursor: move;
        }
    }

    & > ul.widget_btn {
        display: flex;
        flex-direction: row;
        gap: var(--size-5);
        height: var(--size-icon);
        padding-right: var(--size-15);
    }
}
aside.feature_info {
    font-size: 12px;
    color: var(--color-grey-dark);
    display: none;
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 180px;
    min-width: 150px;
    max-width: 600px;
    background: #fff;
    z-index: 1000;
    flex-direction: column;
    transition: width 0.2s ease;
    overflow: auto;
    resize: none;
    container-type: inline-size;


    > div.feature-header {
        display: flex;
        align-items: center;
        justify-content: space-between;

        h3 {
            cursor: default;
            margin: 10px;
            font-weight: var(--font-weight-bold);
        }

        .sluit_modal {
            margin: 10px;
        }
    }
}

/*draggable left edge */
.feature_info .drag-handle {
    pointer-events: auto;
    position: absolute;
    left: 0;
    top: 0;
    width: 6px;
    height: 100%;
    cursor: ew-resize;
    background: #ccc;
    z-index: 1001;
}

/*layout inside panel */
.feature_info dl {
    display: grid;
    grid-template-columns: 40% 60%;
    margin: 0;
    padding: 0;
}

.feature_info dt,
.feature_info dd {
    cursor: default;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 6px 8px;
    border-bottom: 1px solid #eee;
}

.feature_info dt {
    font-weight: var(--font-weight-semibold);
    background-color: #f9f9f9;
    /*tooltip overflow*/
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
    max-width: 100%;
}

.feature_info dd {
    background-color: #fff;
}

@container (max-width: 170px) {
    .feature_info dl {
        display: flex;
        flex-direction: column;
    }
}


/*widget header li > button styles*/
.widget_header ul.widget_btn > li {
    height: var(--size-15);
    list-style: none;
}

.widget_header ul.widget_btn > li > button {
    height: var(--size-icon);
    background-color: transparent !important;
    border: none;
}

.widget_header ul.widget_btn > li > button > div {
    width: var(--size-15);
    height: var(--size-15);
}

.widget_header svg.icon.header {
    width: var(--size-icon-small);
    height: var(--size-icon-small);
    cursor: pointer;
}

/*filter & layer widget*/
.layerswitcher_widget {
    left: 3%;
    top: 7%;
    width: var(--size-350);

    /*widget content*/
    .widget_content {
        flex-grow: 1;
        gap: var(--size-20);
        padding-bottom: var(--size-25);
        resize: both;
    }

   :is(fieldset) {
        border: none;
        padding: 0 15px 0 15px;
        margin-top: 15px;
    }

    :is(legend) {
        font-weight: var(--font-weight-bold);
        padding-bottom: var(--size-10);
    }

   :is(ul) {
        display: flex;
        flex-direction: column;
        gap: var(--size-5);

        > li {
            list-style: none;
            display: flex;
            gap: var(--size-10);
            justify-content: flex-start;
        }
    }
}

/*info widget*/
.info_widget{
    top: 7%;
    left: 77%;
    width: var(--size-350);

    /*widget content*/
    .widget_content {
        flex-grow: 1;
        gap: var(--size-15);

        & .top {
            font-size: var(--size-15);
            padding-left: var(--size-15);

            display: flex;
            flex-direction: column;
            justify-content: space-between;
            gap: var(--size-15);
        }

        & .mid {
            margin: 0 15px 0 15px;

           > ul {
                list-style: none;
                display: flex;
                flex-direction: column;
                gap: var(--size-5);
            }
        }

        & .bottom {
            > textarea {
                resize: both;
            }
            > .bodytekst {
                gap: var(--size-15);
                margin: 0 15px 15px 15px;
                display: flex;
                flex-direction: column;
            }
        }
    }
}

/*legend widget*/
.legend_widget{
    top: 50%;
    left: 77%; /*temporary*/
    width: var(--size-350); /*temporary*/


    & .widget_content {
        flex-grow: 1;
        padding: 15px;
        gap: var(--size-10);

       > fieldset.legendwidget_layer, .legendwidget_layer ul, ul.legendwidget_layer {
            border: none;
            display: flex;
            flex-direction: column;
            transition: background 0.3s ease;
        }


        > fieldset legend {
            font-weight: var(--font-weight-bold);
            margin-bottom: var(--size-10);
            cursor: grab;
            padding-top: var(--size-5);
        }


        > .legendwidget_layer li.legendwidget_data {
            list-style: none;
            display: flex;
            justify-content: flex-start;
            gap: var(--size-10);
            cursor: grab;
            transition: background 0.3s ease, transform 0.3s ease;
        }

        > .legendwidget_layer li.legendwidget_data:hover {
            background: #f1f1f1;
            transform: scale(1.02);
        }

        /*> fieldset:active {*/
        /*    border: 1px dotted var(--color-grey-dark);*/
        /*    padding: 5px;*/
        /*}*/

        > .legendwidget_data:active {
            font-weight: var(--font-weight-bold);
        }
    }

    .legendwidget_layer_legend {
        flex-shrink: 0;
        margin-left: auto;
    }

    svg.legend_objecttype_icon  {
        width: var(--size-20);
        height: var(--size-20);
    }

    svg.legend_layer_move {
        width: var(--size-icon);
        height: var(--size-icon);
        cursor: grab;
        fill: var(--clr-primary);
    }
}

/*edit widget assignment widget*/
.assignment_widget {
    top: 50%;
    left: 7%; /*temporary*/
    height: auto;
    width: var(--size-350); /*temporary*/
    display: flex;
    flex-direction: column;

    overflow: hidden;
    resize: both;
}

/*widget content*/
.assignment_widget .widget_content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
    gap: var(--size-25);
    width: 100%;

    & .top {
        display: flex;
        flex-direction: column;
        flex-grow: 1;
        overflow: hidden;

       :is(fieldset) {
            height: 100%;
            border: none;
            padding: 0 15px;
            display: flex;
        }

       :is(legend) {
            display: flex;
            font-weight: var(--font-weight-bold);
            padding-bottom: var(--size-10);
        }
       .scroll_wrapper {
            display: flex;
            flex-grow: 1;
            padding-right: var(--size-10);
        }

        :is(ul) {
            width: 100%;
            height: 100%;
            flex-grow: 1;
            display: flex;
            flex-direction: column;
            gap: var(--size-5);

            /*scrollbar*/
            padding-right: var(--size-10);
            overflow: auto;
        }

        :is(li) {
            min-height: 1.5em;
            list-style: none;
            display: flex;
            gap: var(--size-10);
            justify-content: space-between;

            :is(label) {
                flex: 1;
                display: flex;
                min-width: 0;
                overflow: hidden;
                text-overflow: ellipsis;
                align-items: center;
            }

            div.label, div.icons {
                display: flex;
                flex-direction: row;
                align-items: center;
                gap: var(--size-5);
            }
        }

        /*empty div push icon right*/
        div.divider {
            display: flex;
            flex: 1;
        }

        button#show, button#delete, button#hide {
            width: var(--size-icon);
            height: var(--size-icon);
            background: transparent;
            border: none;

        }

        button#show svg.icon, button#delete svg.icon, button#hide svg.icon {
            width: var(--size-icon);
            height: var(--size-icon);
        }
    }

    & .bottom {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        padding: 0 15px 15px 15px;

        .left, .right {
            width: fit-content;
        }

        /*px dimensions necessary?*/
        :is(ul) {
            height: var(--size-25);
            display: flex;
            align-items: center;
            gap: var(--size-15);
            list-style: none;
        }

        :is(li) {
            height: var(--size-25);
        }

        :is(button) {
            width: var(--size-button-small);
            height: var(--size-button-small);
            background: transparent;
            border: none;
        }

        .right ul li {
            display: flex;
            gap: var(--size-15);
            flex-direction: row;
        }
    }
}

/*control button row bottom left*/
.control_button_wrapper {
    left: 3%;
    top: 83%;
    position: fixed;
    height: 100px;/*for mouseenter, mouseover*/
    bottom: 200px;/*for mouseenter, mouseover*/
    display: flex;/*for mouseenter, mouseover*/
    align-items: flex-end;/*for mouseenter, mouseover*/

    :is(ul) {
        display: flex;
        gap: var(--size-25);
        list-style: none;

        :is(li) {
            background: transparent;
            max-height: var(--size-50); /*for mouseenter, mouseover*/
            max-width: var(--size-50);
        }
    }

    & button.control_button {
        background: var(--color-bg-opacity-strong);
        box-shadow: -1px 1px 6px var(--color-shadow);
        cursor: pointer;
        width: var(--size-50);
        height: var(--size-50);
        border: none;
    }
}

/*make drop-up list on click*/
/*buttons w/ dropdown extra buttons*/
.control_button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.control_button.dropup-btn {
    justify-content: flex-end;
    gap: 2px;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.control_button button, .control_button > div {
    width: var(--size-button-small);
    height: var(--size-button-small);
}

div.hint {
    width: var(--size-icon-small);
    height: var(--size-icon-small);

    :is(svg) {
        width: var(--size-icon-small);
        height: var(--size-icon-small);
    }
}

.hover-wrapper {
    display: flex;
    flex-direction: column-reverse;
    justify-content: space-between;
    background: var(--color-bg-opacity-strong);
    box-shadow: -1px 1px 6px var(--color-shadow);
    width: var(--size-50);
    height: auto;
    cursor: pointer;
    transition: margin-top 0.3s ease;
}

ul.dropup-sublist {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    background: transparent;
    height: auto;
    width: var(--size-50);
    /*animation*/
    opacity: 1;
    /*transform: translateY(10px);*/
    /*transition: opacity 0.1s ease;*/
    pointer-events: none;

    .item button.control_button {
        background: transparent;
        box-shadow: none !important;
        height: var(--size-50);
        width: var(--size-50);
    }
}

.hover-wrapper:hover .dropup-sublist {
    /*opacity: 1;*/
    /*transform: translateY(0);*/
    pointer-events: auto;
}

.control_button_wrapper .hint {
    transition: opacity 0.3s ease;
}

/*scale line*/
.flexmap .ol-scale-line {
    background: rgba(244, 128, 121, 0.9) !important; /*important for shared.css override*/
    border-radius: 4px;
    bottom: 60px;
    left: 85%;
    padding: 2px;
    position: fixed;

    .ol-scale-line-inner {
        border: 2px solid var(--color-white);
        border-top: none;
        color: var(--color-white);
        font-size: 11px;
        text-align: center;
        margin: 1px;
        will-change: contents,width;
    }
}

.flexmap .streetview {
    background: rgba(244, 128, 121, 0.9) !important; /*important for shared.css override*/
    border-radius: 4px;
    bottom: 60px;
    left: 95%;
    padding: 2px;
    position: fixed;
}





