:root {
    --djh-pink: #D7007F;
    --djh-grey: #E7E1DF;
    --selected: #e7e1df;
    --progress-color: #2E2E2E;
    --bs-border-radius: 8px;
}

section.backgroundcolor-grey {
    --selected: whitesmoke;
}

@font-face {
    font-display: swap;
    font-family: 'ITC Officina Sans';
    font-style: normal;
    font-weight: 400;
    src: url('../fonts/ITC Officina Sans/itc-officina-sans-regular.otf') format('opentype');
}

@font-face {
    font-display: swap;
    font-family: 'ITC Officina Sans';
    font-style: normal;
    font-weight: bold;
    src: url('../fonts/ITC Officina Sans/itc-officina-sans-bold.otf') format('opentype');
}

@font-face {
    font-display: swap;
    font-family: 'ITC Officina Sans';
    font-style: italic;
    font-weight: bold;
    src: url('../fonts/ITC Officina Sans/itc-officina-sans-bold-italic.otf') format('opentype');
}

/* dosis-200 - latin_latin-ext */
@font-face {
    font-display: swap;
    font-family: 'Dosis';
    font-style: normal;
    font-weight: 200;
    src: url('../fonts/Dosis/dosis-v34-latin_latin-ext-200.woff2') format('woff2');
}

/* dosis-300 - latin_latin-ext */
@font-face {
    font-display: swap;
    font-family: 'Dosis';
    font-style: normal;
    font-weight: 300;
    src: url('../fonts/Dosis/dosis-v34-latin_latin-ext-300.woff2') format('woff2');
}

/* dosis-regular - latin_latin-ext */
@font-face {
    font-display: swap;
    font-family: 'Dosis';
    font-style: normal;
    font-weight: 400;
    src: url('../fonts/Dosis/dosis-v34-latin_latin-ext-regular.woff2') format('woff2');
}

/* dosis-500 - latin_latin-ext */
@font-face {
    font-display: swap;
    font-family: 'Dosis';
    font-style: normal;
    font-weight: 500;
    src: url('../fonts/Dosis/dosis-v34-latin_latin-ext-500.woff2') format('woff2');
}

/* dosis-600 - latin_latin-ext */
@font-face {
    font-display: swap;
    font-family: 'Dosis';
    font-style: normal;
    font-weight: 600;
    src: url('../fonts/Dosis/dosis-v34-latin_latin-ext-600.woff2') format('woff2');
}

/* dosis-700 - latin_latin-ext */
@font-face {
    font-display: swap;
    font-family: 'Dosis';
    font-style: normal;
    font-weight: 700;
    src: url('../fonts/Dosis/dosis-v34-latin_latin-ext-700.woff2') format('woff2');
}

/* dosis-800 - latin_latin-ext */
@font-face {
    font-display: swap;
    font-family: 'Dosis';
    font-style: normal;
    font-weight: 800;
    src: url('../fonts/Dosis/dosis-v34-latin_latin-ext-800.woff2') format('woff2');
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

section.djh {
    font-family: 'ITC Officina Sans', sans-serif;

    h2 {
        font: normal normal bold 32px/1 'ITC Officina Sans';
    }

    h3 {
        font: normal normal 500 24px/1 'ITC Officina Sans';
    }

    h4 {
        font: normal normal 500 20px/1 'ITC Officina Sans';
    }

    li {
        font: normal normal 500 20px / 1 'ITC Officina Sans';
    }

    .djh-question label,
    p {
        font: normal normal 400 20px / 1 'ITC Officina Sans';
    }

    >* {
        font: normal normal 400 16px / 1 'ITC Officina Sans';
    }

    .visually-hidden {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border-width: 0;
    }

    /* These styles prevent the djh from hiding the dropdowns */
    overflow: initial !important;
    content-visibility: visible;

    .button {
        background-color: white;
        color: black;

        &.pink {
            background-color: var(--djh-pink);
            color: white;
        }

        border: none;
        border-radius: 8px;

        font: normal normal 500 20px / 1 'ITC Officina Sans';

        min-height: 60px;
        padding: 20px;

        text-align: start;

        transition: all 0.2s linear;

        width: 100%;

        &:hover {
            background-color: var(--selected);
            color: var(--djh-pink);
            transition: all 0.2s linear;

            /* background-color: black !important; */
            /* border-color: black !important; */
            /* color: white !important; */
        }

        &:has(input[type="radio"]:checked) {
            /* background-color: var(--selected); */
            /* color: var(--djh-pink); */

            background-color: black !important;
            color: white !important;
        }

        input[type="radio"] {
            display: none;
        }
    }

    .plugin-dropdown_input.focus .ts-dropdown .dropdown-input {
        /* border-radius: unset; */
        border: none;
        box-shadow: none;
    }

    .ts-wrapper.tom-select:hover .ts-control,
    div[role="listbox"] div.option.active {
        background-color: var(--selected);
        color: var(--djh-pink);

        /* background-color: black; */
        /* color: white; */

        transition: all 0.2s linear;
    }

    input,
    button,
    .button,
    button[type="submit"],
    textarea,
    li,
    label,
    div.selected,
    div[role="combobox"],
    .ts-wrapper.tom-select .ts-control {
        transition: all 0.2s linear;

        &:focus,
        &:focus-visible {
            transition: all 0.2s linear;

            outline: none;
            /* outline: 2px solid black; */
            /* outline-offset: -2px; */

            background-color: var(--selected);
            color: var(--djh-pink);
            /* background-color: black !important; */
            /* border-color: black !important; */
            /* color: white !important; */
        }
    }

    input[type=range] {
        -webkit-appearance: none;
        appearance: none;
        background: transparent;
        cursor: pointer;
        width: 40%;
        height: 12px;
        border-radius: 12px;

        &:focus {
            outline: none;

            &::-webkit-slider-thumb {
                border: 2px solid black;
                /* box-shadow: 0 0 0 4px rgba(var(--selected-rgb), 0.3); // für Fokus sichtbar */
            }

            &::-moz-range-thumb {
                border: 2px solid black;
                /* box-shadow: 0 0 0 4px rgba(var(--selected-rgb), 0.3); // für Fokus sichtbar */
            }
        }

        &::-webkit-slider-runnable-track {
            height: 12px;
            background: linear-gradient(to right,
                    var(--progress-color) 0%,
                    var(--progress-color) var(--progress, 50%),
                    var(--selected) var(--progress, 50%),
                    var(--selected) 100%);
            border: 1px solid var(--selected);
            border-radius: 12px;
        }

        &::-moz-range-track {
            height: 12px;
            background: linear-gradient(to right,
                    var(--progress-color) 0%,
                    var(--progress-color) var(--progress, 50%),
                    var(--selected) var(--progress, 50%),
                    var(--selected) 100%);
            border: 1px solid var(--selected);
            border-radius: 12px;
        }

        &::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            background-color: var(--djh-pink);
            border-radius: 50%;
            border: 1px solid var(--selected);
            height: 24px;
            width: 24px;
            margin-top: -6px;
        }

        &::-moz-range-thumb {
            -webkit-appearance: none;
            appearance: none;
            background-color: var(--djh-pink);
            border-radius: 50%;
            border: 1px solid var(--selected);
            height: 24px;
            width: 24px;
            margin-top: -6px;
        }
    }

    input[type=range]::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        background-color: var(--djh-pink);
        border-radius: 50%;
        border: 1px solid var(--selected);
        height: 24px;
        width: 24px;
        margin-top: -6px;
    }

    input[type=checkbox] {
        margin: auto 0 auto auto;

        appearance: none;
        border-radius: 4px;
        border: 1px solid black;
        background-color: white;
        color: var(--djh-pink);
        width: 20px;
        min-width: 20px;
        max-width: 20px;
        height: 20px;
        min-height: 20px;
        max-height: 20px;

        &:checked {
            &::after {
                content: '';
                border-bottom: 3px solid var(--djh-pink);
                border-right: 3px solid var(--djh-pink);
                width: 8px;
                height: 12px;
                display: block;
                transform: translate(5px, 1px) rotate(45deg);
            }
        }

        &:focus {
            &:checked {
                &::after {
                    border-bottom: 3px solid var(--djh-pink);
                    border-right: 3px solid var(--djh-pink);
                }
            }
        }
    }

    input[type=date] {
        appearance: none;
        background-color: white;
        border: 1px solid var(--selected);
        font: normal normal 500 20px / 1 'ITC Officina Sans';
        border-radius: 8px;
        padding: 18px;

        &::-webkit-calendar-picker-indicator {
            transform: scale(0.8);
            transform-origin: right center;
            cursor: pointer;
        }

        &:focus-within {
            background-color: var(--selected);
            color: var(--djh-pink);

            /* background-color: black; */
            /* color: white; */

            &::-webkit-calendar-picker-indicator {
                /* filter: invert(100%) brightness(200%); */
            }
        }
    }

    /* Safari special needs */
    input::-webkit-date-and-time-value {
        background-color: white;
        color: black;
        text-align: left;

        &::hover,
        &::focus,
        &::focus-visible {
            outline: none;
            /* outline: 2px solid black; */
            /* outline-offset: -2px; */
        }
    }

    input::-webkit-date-and-time-value:hover,
    input::-webkit-date-and-time-value:focus,
    input::-webkit-date-and-time-value:focus-visible {
        /* background-color: black !important; */
        /* border-color: black !important; */
        /* color: white !important; */
    }

    label {
        &:last-child {
            margin-bottom: 0;
        }
    }

    select.djh-select,
    input[type=text],
    input[type=date],
    input[type=datetime-local],
    input[type=submit],
    input[type=number],
    input[type=email],
    textarea {
        appearance: none;

        /* border: 1px solid var(--selected); */
        border: none;
        border-radius: 8px;

        color: black;
        font: normal normal 500 20px / 1 'ITC Officina Sans';

        &:not(textarea) {
            min-height: 60px;
        }

        padding: 18px 20px;

        &:hover:not([type="text"], [type="email"], textarea)::placeholder,
        &:focus::placeholder {
            /* color: white; */
            /* opacity: 0.75; */
        }
    }

    .loader {
        position: relative;

        min-height: 60px;
        min-width: 60px;
        grid-column: 1 / -1;

        &::after {
            content: "";
            position: absolute;
            top: 50%;
            left: 50%;
            width: 60px;
            height: 60px;
            border: 4px solid var(--djh-pink);
            border-top: 4px solid white;
            border-radius: 50%;
            animation: spin 1s ease-in-out infinite;
        }

        >* {
            visibility: hidden;
        }
    }

    .range-wrapper {
        details {
            list-style: none;
            margin: auto 0;
            border: 1px solid var(--selected);
            border-radius: 8px;
            font: normal normal 500 20px / 1 'ITC Officina Sans';
            /* padding: 20px; */

            .price-value {
                margin-left: 8px;
            }

            &:hover {
                summary {
                    background-color: var(--selected);
                    color: var(--djh-pink);

                    /* background-color: black; */
                    /* color: white; */

                    border-radius: 8px;
                }
            }

            &:focus {
                background-color: var(--selected);
                color: var(--djh-pink);
                /* background-color: black; */
                /* color: white; */

                +.wrapper {
                    /* background-color: black; */
                    /* color: white; */
                }
            }

            summary {
                display: block;

                padding: 20px;

                &::-webkit-details-marker {
                    display: none;
                }

                &:focus {
                    background-color: var(--selected);
                    color: var(--djh-pink);

                    /* background-color: black; */
                    /* color: white; */

                    border-radius: 8px;

                    outline: none;
                }
            }

            .wrapper {
                width: -webkit-fill-available;
                width: -moz-available;
                width: stretch;

                margin: 20px;

                display: flex;
                align-items: center;

                input[type="range"] {
                    flex: 1 1 0;
                }
            }
        }
    }

    .select-wrapper {
        width: 100%;

        select {
            display: none;
        }

        .djh-custom-select {
            position: relative;

            width: 100%;

            .selected {
                background-color: white;

                border: none;
                border-radius: 8px;

                color: black;

                font: normal normal 500 20px / 1 'ITC Officina Sans';

                min-height: 60px;
                padding: 20px;

                width: 100%;

                &::after {
                    content: '';
                    border-left: 2px solid black;
                    border-bottom: 2px solid black;

                    position: absolute;
                    right: 20px;
                    top: 50%;

                    transform: rotate(312deg) translateY(-50%);

                    transition: all 0.2s linear;

                    width: 10px;
                    height: 10px;
                }

                &:has(+ ul.options.open) {
                    &::after {
                        transform: rotate(135deg);
                        transition: all 0.2s linear;
                    }
                }
            }

            ul.options {
                &:not(.open) {
                    display: none;
                }

                &.open {
                    display: block;
                    z-index: 10;
                }

                border-radius: 8px;

                /* outline: 1px solid black; */

                list-style-type: none;

                margin-bottom: 0;

                max-height: 240px;

                overflow-y: scroll;

                padding: 0;

                position: absolute;

                width: 100%;

                li {
                    background-color: white;
                    color: black;

                    padding: 10px;

                    width: 100%;

                    &:first-child {
                        border-top-left-radius: 8px;
                        border-top-right-radius: 8px;
                    }

                    &:last-child {
                        border-bottom-left-radius: 8px;
                        border-bottom-right-radius: 8px;
                    }

                    &:hover {
                        background-color: var(--selected);
                        color: var(--djh-pink);
                    }
                }
            }
        }
    }

    .djh-select,
    .tom-select {

        * {
            font: normal normal 500 20px / 1 'ITC Officina Sans';
        }

        &.ts-wrapper {
            height: 60px;
            border-radius: 8px;
            background-color: white;
            color: black;

            .ts-control {
                background-color: white;
                color: black;
            }

            &.pink {
                background-color: var(--djh-pink);
                color: white;
                border-color: white;

                .ts-control {
                    background-color: var(--djh-pink);
                    color: white;
                    outline-color: black;

                    &::after {
                        border-color: white;
                    }
                }
            }

            .ts-dropdown {
                margin-top: 0;
            }
        }

        &.focus {
            .ts-control {
                border: none;
                box-shadow: none;
                border-radius: 8px;
            }
        }

        &.multi {
            .ts-control {
                padding: 0 12px;

                .item {
                    margin: auto 3px;
                    border-radius: 7px;
                    padding: 14px;
                }
            }
        }

        /* &.input-active {
            .ts-control {
                padding: 0 20px;
            }
        } */

        /* &.plugin-remove_button {
            .ts-control {
                .item {
                    padding: 20px;
                }
            }
        } */

        .ts-control {
            border: none;
            color: black;

            /* margin: auto 0 !important; */
            padding: 20px;

            position: relative;

            input[type="text"] {
                padding: 6px 7px !important;
                height: calc(60px - 12px);
            }

            &::after {
                content: '';
                width: 8px;
                height: 8px;

                border-bottom: 2px solid black;
                border-right: 2px solid black;

                position: absolute;
                top: 50%;
                right: 20px;

                transform: rotate(225deg);
                transition: all 0.2s linear;
            }
        }

        &.ts-wrapper.focus:not(.dropdown-active),
        &.ts-wrapper:hover {
            .ts-control::after {
                /* border-color: white; */
            }
        }

        &.ts-wrapper.dropdown-active {
            .ts-control::after {
                transform: rotate(45deg) translateY(-50%);
                transition: all 0.2s linear;
            }
        }

        .ts-dropdown {
            background-color: white;

            border-top-left-radius: 8px;
            border-top-right-radius: 8px;

            border: none;
        }
    }

    /* Used for the radiobutton notice text */
    .djh-visually-hidden {
        position: absolute;
        left: -9999px;
    }

    .hidden {
        display: none !important;
    }

    .show {
        display: block !important;
    }
}