﻿.combobox {
    height: var(--input-height);
    position: relative;
    display: flex;
    flex-flow: row nowrap;
    align-content: center;
    align-items: center;
}

.combobox input[type=text] {
    height: var(--input-height);
    border: 1px solid var(--input-border-color);
    border-radius: var(--input-border-radius) 0 0 var(--input-border-radius);
    padding: 0 10px;
}

.combobox-toggle {
    width: var(--input-height);
    height: var(--input-height);
    background-color: transparent;
    padding: 0;
    border-width: 1px 1px 1px 0;
    border-style: solid;
    border-color: var(--input-border-color);
    border-radius: 0 var(--input-border-radius) var(--input-border-radius) 0;
    display: flex;
    flex-flow: row nowrap;
    justify-content: center;
    align-content: center;
    align-items: center;
    cursor: pointer;
}

.combobox-toggle svg {
    width: 16px;
    height: 16px;
}

.combobox-list {
    border: 1px solid var(--input-border-color);
    border-radius: var(--input-border-radius);
    box-shadow: -7px 7px 16px 0 rgba(0,0,0,0.4);
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-flow: row wrap;
    position: absolute;
    top: 100%;
    z-index: 10;
    background-color: #ffffff;
    max-height: calc(var(--input-height) * 7);
    overflow-x: hidden;
    overflow-y: auto;
}

.combobox-list li {
    width: 100%;
    height: var(--input-height);
    padding: 0 5px;
    display: flex;
    flex-flow: row nowrap;
    align-content: center;
    align-items: center;
    gap: 5px;
}

.combobox-list li.active {
    background-color: #f5f5f5;
}

.combobox-list.use-nestinglevels li {
    display: grid;
    grid-template-columns: 24px max-content 1fr;
    grid-template-rows: var(--input-height);
    grid-template-areas: "checkbox nestinglevel description";
}

.combobox-list.use-nestinglevels li:not([data-nestinglevel="0"])::before {
    content: "";
    grid-area: nestinglevel;
    height: 8px;
    width: calc(var(--nesting-level) * 15px);
    border-left: 1px solid #000000;
    border-bottom: 1px solid #000000;
    margin-left: 5px;
    margin-right: 3px;
}

.combobox-list.use-nestinglevels .combobox-listitem-content {
    grid-area: description;
    height: 24px;
    display: flex;
    flex-flow: row nowrap;
    align-content: center;
    align-items: center;
}

/* combobox "checkbox" */
.combobox-checkbox-label {
    display: block;
    position: relative;
    font-size: 22px;
    line-height: 24px;
    height: 24px;
    width: 24px;
    clear: both;
}

.combobox-list.use-nestinglevels .combobox-checkbox-label {
    grid-area: checkbox;
}

.combobox-checkbox-custom {
    position: absolute;
    top: 0;
    left: 0;
    width: 24px;
    height: 24px;
    background-color: transparent;
    border-radius: var(--input-border-radius, 4px);
    transition: all 0.3s ease-out;
    border: 1px solid var(--input-border-color, #dfe2ec);
}

.combobox-checkbox-custom::after {
    position: absolute;
    content: "";
    left: 12px;
    top: 12px;
    width: 0;
    height: 0;
    border-radius: var(--input-border-radius, 4px);
    border: solid var(--font-dark, #273244);
    border-width: 0 3px 3px 0;
    transform: rotate(0deg) scale(0);
    opacity: 1;
    transition: all 0.3s ease-out;
}

.combobox-listitem.selected .combobox-checkbox-custom {
    background-color: var(--checkbox-checked-color, #2073fd);
    transform: rotate(0deg) scale(1);
    opacity: 1;
    border: 2px solid var(--checkbox-checked-color, #2073fd);
}

.combobox-listitem.selected .combobox-checkbox-custom::after {
    transform: rotate(45deg) scale(1);
    opacity: 1;
    left: 8px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid var(--font-light, #ffffff);
    border-width: 0 2px 2px 0;
    background-color: transparent;
    border-radius: 0;
}