.dropdown {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    width: 100%;
    flex-grow: 1;

    .dropdown-trigger {
        position: relative;
        width: 100%;
        height: 2.75rem;
        border-radius: 6.25rem;
        border: .0625rem solid var(--gray-25);
        background-color: var(--gray-0);
        padding: .75rem 1rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        transition: border-color .2s;
        outline: none;

        input {
            font-family: "Onest", sans-serif;
            font-weight: 400;
            font-size: 1rem;
            color: var(--gray-800);
            border: none;
            background-color: transparent;
            padding: 0;
            width: 100%;
            transition: color .2s;
            outline: none;

            &::placeholder {
                transition: color .2s;
                color: var(--gray-400);
            }
        }

        svg {
            color: var(--gray-400);
            transition-property: color transform;
            transition-duration: .2s;
        }

        &:focus-within {
            border-color: var(--orange);

            input {
                &::placeholder {
                    color: var(--gray-600);
                }
            }

            svg {
                color: var(--gray-600);
            }
        }
    }

    &.active {
        .dropdown-trigger {
            border-color: var(--gray-600);

            input {
                &::placeholder {
                    color: var(--gray-800);
                }
            }

            svg {
                transform: rotate(180deg);
                color: var(--gray-800);
            }
        }

        .dropdown-menu {
            display: block;
        }
    }

    .dropdown-menu {
        display: none;
        position: absolute;
        top: 0;
        left: 0;
        width: max-content;
        max-height: 21.375rem;
        overflow-y: auto;
        background-color: var(--gray-0);
        box-shadow: 0 .1869rem .6544rem 0 #14142B1A;
        z-index: 10;
        border-radius: .75rem;
        border: .0625rem solid #E4E7EC;
        max-width: 70vw;

        &::-webkit-scrollbar {
            width: .25rem;
        }

        &::-webkit-scrollbar-track {
            background: transparent;
        }

        &::-webkit-scrollbar-thumb {
            background: var(--gray-25);
            border-radius: .125rem;
        }
    }

    .dropdown-item {
        padding: .625rem 1rem;
        font-family: "Onest", sans-serif;
        font-size: 1rem;
        color: var(--gray-800);
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        transition: background-color .15s;

        &:hover {
            background-color: var(--gray-15);
        }

        &.selected {
            background-color: var(--gray-15);
        }

        &.disabled {
            color: var(--gray-300);
            pointer-events: none;
        }
    }

    &.error {
        .dropdown-trigger {
            border-color: var(--action-red);
        }

        .hint {
            display: block;
        }
    }

    &.success {
        .dropdown-trigger {
            border-color: var(--action-green);
        }
    }
}


.button-fill {
    background-color: #F85628;
    border-radius: 6.25rem;
    color: var(--gray-0);
    font-family: "Onest", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
    font-weight: 500;
    font-size: 1rem;
    padding: .75rem 1rem;
    display: flex;
    gap: .5rem;
    justify-content: center;
    align-items: center;
    border: none;
    cursor: pointer;
    width: 100%;
    height: 2.75rem;
    flex-grow: 1;
    transition: 0.4s ease;

    &:disabled {
        opacity: 0.3;
        pointer-events: none;
    }

    &:hover {
        background-color: #C7360D;
    }

    &.icon {
        max-width: fit-content;
        height: 100%;
        aspect-ratio: 1/1;
        padding: .625rem;
    }
}

.button-outline {
    background-color: var(--gray-0);
    border-radius: 6.25rem;
    color: #F85628;
    font-family: "Onest", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
    font-weight: 500;
    font-size: 1rem;
    padding: calc(.75rem - .0625rem) 1rem;
    display: flex;
    gap: .5rem;
    justify-content: center;
    align-items: center;
    border: .0625rem solid var(--gray-25);
    cursor: pointer;
    width: 100%;
    height: 2.75rem;
    flex-grow: 1;
    transition-property: border, color;
    transition-duration: .2s;
    transition-timing-function: ease-in-out;

    &:hover {
        border: .0625rem solid #C7360D;
        color: #C7360D;
    }

    &:disabled {
        opacity: 0.5;
        pointer-events: none;
    }

    &.icon {
        width: 2.75rem;
        height: 2.75rem;
        aspect-ratio: 1/1;
        padding: .625rem;
        flex-grow: 0;
    }
}




.exercises-option {
    max-width: 77.875rem;
    margin: 0 auto;
    box-sizing: content-box;

    .header:not(.exercise-header) {
        display: flex;
        align-items: end;
        justify-content: space-between;
        margin-bottom: 1.5rem;
        gap: 1rem;

        .title {
            font-size: 2rem;
            font-weight: 700;
            color: #2A1C14;
            font-family: "Source Serif 4", serif;
            min-width: 0;
        }

        .top-bar {
            max-width: 31.875rem;
            width: 100%;
            height: 5.75rem;
            flex-grow: 1;
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-direction: row;
            gap: 1.5rem;

            .button-prev {
                color: #919292;
                padding: .875rem;

                &:hover {
                    color: #C7360D;
                }
            }

            .box {
                display: flex;
                align-items: center;
                gap: 1.625rem;

                .counter {
                    color: #000000;
                    font-size: 1.125rem;
                    font-weight: 600;
                    white-space: nowrap;

                    .current {
                        color: #F85628;
                    }
                }

                .button-check {
                    width: 10.6875rem;
                    flex-grow: 0;
                }

                .button-repeat {
                    display: none;
                    max-width: 9.125rem;
                    width: 100%;
                    flex-grow: 1;
                }

                .button-next {
                    display: none;
                    flex-grow: 1;
                    width: 100%;
                    max-width: 15rem;
                }
            }
        }
    }

    .exercises-explanation {
        background-color: var(--gray-15);
        border-radius: 1.5rem;
        padding: .75rem 1.5rem;
        margin-bottom: 1.5rem;
        font-size: .875rem;
        font-weight: 400;

        .explanation {
            color: var(--gray-600);

            &:not(:last-child) {
                margin-bottom: .5rem;
            }
        }

        .statistics {
            color: #F85628;
        }
    }

    .task-wrapper {
        display: flex;
        flex-direction: column;
        gap: 3rem;

        .flex-box {
            display: flex;
            gap: 1rem;
        }

        .task {
            padding: 1.5rem 1.5rem 1.5rem 1.5rem;
            height: 36.25rem;
            position: relative;

            &::after {
                content: "";
                position: absolute;
                bottom: 0;
                left: 0;
                width: calc(100% - .875rem);
                height: 100%;
                pointer-events: none;
                box-shadow: inset 0rem -5rem 1.6875rem -2rem #fff;
            }

            form {
                height: 100%;

                .scroll-container {
                    height: 100%;
                    overflow-y: scroll;
                    padding: 0 .5rem 1.875rem 0;

                    &::-webkit-scrollbar {
                        width: .25rem;
                        background-color: transparent;
                        border-radius: .1875rem;
                    }

                    &::-webkit-scrollbar-thumb {
                        width: .25rem;
                        background-color: var(--gray-100);
                        border-radius: .1875rem;
                    }

                    p,
                    .p {
                        font-size: 1.25rem;
                        color: #2A1C14;
                        font-weight: 400;
                        line-height: 2.25rem;
                    }

                    span {
                        font-weight: 600;
                    }

                    .divider {
                        width: 100%;
                        height: .0625rem;
                        background-color: var(--gray-25);
                        margin: 1rem 0;
                    }

                    .pb-big {
                        padding-bottom: 1.25rem;
                    }

                    .p + .p {
                        margin-top: 1.25rem;
                    }

                    .pb-small {
                        padding-bottom: .25rem;
                    }

                    .pl-big {
                        padding-left: 5rem;
                    }

                    .blank {
                        display: inline-block;
                        border: .0625rem solid #F85628;
                        padding: .25rem;
                        border-radius: 62.4375rem;
                        width: 8.75rem;

                        .dropdown {
                            .dropdown-trigger {
                                border: none;
                                pointer-events: none;
                                padding: 0;
                                height: 100%;

                                .number {
                                    display: flex;
                                    align-items: center;
                                    justify-content: center;
                                    width: 1.75rem;
                                    height: 1.75rem;
                                    background-color: #F85628;
                                    color: #FFFFFF;
                                    font-size: .875rem;
                                    font-weight: 500;
                                    border-radius: 62.4375rem;
                                    flex-shrink: 0;
                                    margin-right: .25rem;
                                }

                                svg {
                                    display: none;
                                }
                            }

                            &.active {
                                .dropdown-menu {
                                    display: none;
                                }
                            }
                        }

                        &.success {
                            border-color: var(--action-green);

                            .dropdown {
                                .dropdown-trigger {
                                    .number {
                                        background-color: var(--action-green);
                                    }
                                }
                            }
                        }

                        &.error {
                            border-color: var(--action-red);

                            .dropdown {
                                .dropdown-trigger {
                                    .number {
                                        background-color: var(--action-red);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }

        .answer {
            max-width: 31.875rem;
            flex-grow: 1;
            height: 36.25rem;
            padding: 0;
            overflow: hidden;
            padding: 1.5rem 1.5rem 1.5rem 1.5rem;
            position: relative;

            &::after {
                content: "";
                position: absolute;
                bottom: 0;
                left: 0;
                width: calc(100% - .875rem);
                height: 100%;
                pointer-events: none;
                box-shadow: inset 0rem -5rem 1.6875rem -2rem #fff;
            }

            .correct-answers {
                display: none;
                position: absolute;
                left: -1rem;
                top: 0;
                padding: 1rem 0 0 2rem;
                width: 100%;
                z-index: 1;
                background-image: linear-gradient(#ffffff 50%, #FFFFFF00 100%);


}

            .scroll-container {
                height: 100%;
                overflow: auto;
                padding: 0 .5rem;

                &::-webkit-scrollbar {
                    width: .25rem;
                    background-color: transparent;
                    border-radius: .1875rem;
                }

                &::-webkit-scrollbar-thumb {
                    width: .25rem;
                    background-color: var(--gray-100);
                    border-radius: .1875rem;
                }

                .questions-title {
                    color: #000000;
                    font-size: 1.125rem;
                    font-weight: 600;
                    margin-bottom: 1rem;
                }

                .explanation {
                    display: none;

                    p {
                        color: #F85628;
                        font-size: .875rem;
                        font-weight: 400;
                        margin-top: 1rem;
                        margin-bottom: 1.5rem;
                    }

                    pre {
                        font-family: var(--font-onest);
                        font-weight: 400;
                        font-size: .875rem;
                        white-space: pre-wrap;
                        word-break: break-all;
                        color: #000000;
                    }
                }

                .questions {
                    display: grid;
                    grid-template-columns: repeat(2, 1fr);
                    gap: .5rem 1rem;
                    height: fit-content;
                    flex-shrink: 0;

                    .question-wrapper {
                        margin-bottom: .75rem;

                        .question {
                            display: flex;
                            flex-direction: column;
                            gap: .5rem;

                            .question-title {
                                color: #000000;
                                font-size: 1rem;
                                font-weight: 500;
                            }

                            .question-content {
                                width: 100%;
                                display: flex;
                                gap: .5rem;
                                align-items: center;

                                .question-number {
                                    background-color: #F85628;
                                    border-radius: .875rem;
                                    width: 1.75rem;
                                    height: 1.75rem;
                                    display: flex;
                                    align-items: center;
                                    justify-content: center;
                                    color: #FFFFFF;
                                    font-size: .875rem;
                                    font-weight: 500;
                                    flex-shrink: 0;
                                }
                            }
                        }
                    }

                    .auch {
                        .question {
                            .question-content {
                                gap: 1rem;

                                .question-number {
                                    width: 1.5rem;
                                    height: 1.5rem;
                                }
                            }
                        }

                        &.disabled {
                            .question {
                                .question-content {
                                    .question-number {
                                        background-color: var(--gray-50);
                                    }

                                    p {
                                        color: var(--gray-300);
                                        text-decoration: line-through;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }    }}

.result {
    .header:not(.exercise-header) {
        .top-bar {
            .box {
                width: 100%;
                gap: .5rem;

                .counter {
                    display: none;
                }

                .button-check {
                    display: none;
                }

                .button-repeat {
                    display: flex;
                }

                .button-next {
                    display: flex;
                }
            }
        }
    }

    .task-wrapper {
        .answer {
            position: relative;

            .correct-answers {
                display: block;
            }

            .scroll-container {
                padding-top: 2.5rem;

                .questions-title {
                    display: none;
                }

                .questions {
                    .auch {
                        display: none;
                    }
                }

                .explanation {
                    display: block;

                    .collapsible-trigger {
                        margin-top: 1rem;
                    }
                }
            }
        }
    }}

@media (max-width: 64rem) {
    .exercises-option {
        .task-wrapper {
            flex-direction: column;
            align-items: center;
            gap: 0;

            .flex-box {
                flex-direction: column;
                align-items: center;
                gap: 1.5rem;
            }

            .paper {
                border: none;
                padding: 0;
            }

            .task {
                padding-bottom: 1.5rem;
                margin-bottom: 0;
                height: fit-content;
                border-bottom: .0625rem solid var(--gray-25);
                border-radius: 0;

                &::after {
                    display: none;
                }

                form {
                    height: fit-content;

                    .scroll-container {
                        overflow: visible;
                        padding: 0 .5rem 0 0;

                        p,
                        .p {
                            font-size: 1rem;
                            line-height: 1.625rem;
                        }

                        .p + .p {
                            margin-top: 1rem;
                        }

                        .blank {
                            padding: 0 .25rem;

                            .dropdown {
                                .dropdown-trigger {
                                    pointer-events: auto;

                                    .number {
                                        width: 1rem;
                                        height: 1rem;
                                        font-size: .625rem;
                                    }

                                    svg {
                                        display: block;
                                    }
                                }

                                &.active {
                                    .dropdown-menu {
                                        display: block;
                                    }
                                }
                            }
                        }
                    }
                }
            }

            .answer {
                max-width: 100%;
                height: fit-content;

                &::after {
                    display: none;
                }

                .scroll-container {
                    questions-title {
                        display: none;
                    }

                    .questions {
                        .question-wrapper:not(.auch) {
                            display: none;
                        }
                    }
                }
            }        }
    }

    .result {
        .task-wrapper {
            gap: 1rem;

            .answer {
                display: block;

                .correct-answers {
                    position: relative;
                    left: 0;
                    padding: 0;
                }

                .scroll-container {
                    padding-top: 0;

                    .questions {
                        .question-wrapper {
                            padding-bottom: .75rem;

                            .question {
                                margin-bottom: 1rem;
                            }
                        }
                    }
                }
            }
        }
    }
}

@media (max-width: 48rem) {
    .exercises-option {
    .header:not(.exercise-header) {
            flex-direction: column-reverse;
            align-items: start;
            margin-bottom: 2rem;

            .title {
                font-family: "Onest", sans-serif;
                font-size: 1.5rem;
                font-weight: 600;
            }

            .top-bar {
                justify-content: start;
                border: none;
                padding: 0;
                gap: 1rem;
                height: fit-content;

                .box {
                    .counter {
                        font-size: 1rem;
                    }

                    .button-check {
                        display: none;
                    }
                }
            }
        }

        .exercises-explanation {
            padding: .75rem;
            margin-bottom: 2rem;
            border-radius: .75rem;
        }
    }

    .result {
    .header:not(.exercise-header) {
            .top-bar {
                .box {
                    .counter {
                        display: block;
                    }

                    .button-repeat {
                        display: none;
                    }

                    .button-next {
                        display: none;
                    }
                }
            }
        }

    }

    .exercises-option.is-sprachbausteine:not(.result) {
        .task-wrapper .answer {
            display: none !important;
        }
    }

    .exercises-option.is-sprachbausteine.result {
        .task-wrapper {
            .flex-box {
                gap: .5rem;
            }

            .answer {
                display: contents;

                > .correct-answers {
                    left: auto;
                    order: -2;
                    padding: 0;
                    position: static;
                    width: 100%;
                }

                > .scroll-container {
                    display: contents;

                    > .questions-title,
                    > .questions {
                        display: none;
                    }

                    > .explanation {
                        display: block;
                        margin: 0 0 .5rem;
                        order: -1;
                        width: 100%;
                    }
                }
            }

            .task {
                border-bottom: 0;
                padding-bottom: 0;
            }

            .task .blank .dropdown .dropdown-item.is-correct-answer {
                color: var(--action-green);
                font-weight: 600;
            }

            .task .blank .dropdown .dropdown-item.is-incorrect-answer {
                color: var(--action-red);
                font-weight: 600;
            }
        }
    }
}

@media (min-width: 48.0625rem) {
    .exercises-option.is-sprachbausteine.result .task-wrapper .answer {
        display: block;
    }

    .exercises-option.is-sprachbausteine.result .task-wrapper .answer > .scroll-container {
        display: block;
    }

    .exercises-option.is-sprachbausteine.result .task-wrapper .answer > .scroll-container > .questions-title,
    .exercises-option.is-sprachbausteine.result .task-wrapper .answer > .scroll-container > .questions {
        display: block;
    }
}
