@charset "UTF-8";
/*
 * 2024 Alexander Schöpe, Bochum, DE
 */

@layer fonts, framework, layout, theme, custom;

@import url('/fontawesome/css/all.min.css') layer(fonts);
@import url('/material-design-icons/font/outlined.css') layer(fonts);
@import url('/bootstrap/css/bootstrap.min.css') layer(framework);

@layer layout {
    :root {
        --main-div-margin: 6px;
        --as-primary: var(--bs-primary);
        --as-secondary: var(--bs-secondary);
    }

    *,
    ::after,
    ::before {
        box-sizing: border-box;
    }

    header {
        & {
            display: flex;
            justify-content: space-between;
            align-items: end;
            padding: 10px;
        }

        & .logo {
            width: auto;
            height: 100px;
        }

        & .header-text {
            & {
                display: flex;
                flex-direction: column;
                align-items: center;
                text-align: center;
                flex-grow: 1;
                margin: 0 20px;
            }

            & span {
                &:nth-child(1) {
                    font-size: 1.2em;
                    font-weight: bold;
                    color: var(--as-secondary);
                }

                &:nth-child(2) {
                    font-size: 0.8em;
                }

                &:nth-child(3) {
                    font-size: 0.5em;
                }
            }
        }
    }

    footer {
        & {
            display: flex;
            /* Zentriert den Inhalt horizontal */
            justify-content: center;
            /* Zentriert den Inhalt vertikal, falls der Footer eine spezifische Höhe hat */
            align-items: center;
            height: 60px;
            /* Zusätzliche Sicherstellung, dass der Text zentriert ist, falls Flexbox nicht wie erwartet funktioniert */
            text-align: center;
            width: 100%;
        }

        & span {
            font-size: 0.8em;
        }
    }

    .boxes {
        & {
            display: grid;
            /* Ändert die Fließrichtung der Grid-Elemente zu horizontal */
            grid-auto-flow: column;
            /* Definiert die Spaltenbreite */
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            /* Ermöglicht horizontales Scrollen, wenn der Inhalt breiter als der Container ist */
            overflow-x: auto;
            /* Verwendet die globale Variable für den Abstand zwischen den Elementen */
            gap: var(--main-div-margin);
        }

        & div {
            display: flex;
            /* Ordnet die Inhalte vertikal an */
            flex-direction: column;
            /* Zentriert die Inhalte horizontal */
            align-items: center;
            /* Startet die Inhalte am oberen Rand des Containers */
            justify-content: flex-start;
            /* Zentriert den Text innerhalb der Elemente */
            text-align: center;
            /* Bezieht Padding und Border in die Gesamtbreite des Elements ein */
            box-sizing: border-box;
        }

        & .hasChildren {
            & {
                margin: var(--main-div-margin);
                border: 6px solid var(--as-primary);
                border-radius: 4px;
            }

            &>span:first-child {
                display: block;
                width: 100%;
                padding: 8px;
                color: white;
                background-color: var(--as-primary);
            }

            & .hasChildren {
                & {
                    margin: var(--main-div-margin);
                    border: 4px solid var(--as-secondary);
                    width: 95%;
                }

                &>span:first-child {
                    background-color: var(--as-secondary);
                }
            }
        }

        & .hasNoChildren {

            &>span,
            & a {
                margin: 2px;
                padding: 6px;
                color: var(--as-secondary);
            }

            & a {
                & {
                    text-decoration: none;
                }

                &:hover {
                    border-radius: 4px;
                    background-color: rgba(224, 247, 250, 0.7);
                    cursor: pointer;
                }
            }
        }
    }

    .tree {
        & a {
            & {
                margin: 2px;
                padding-left: 10px;
                padding-right: 10px;
                color: var(--as-secondary);
                text-decoration: none;
            }

            &:hover {
                border-radius: 4px;
                background-color: rgba(224, 247, 250, 0.7);
                cursor: pointer;
            }
        }

        details {
            & {
                margin-left: 8px;
                padding-left: 4px;
                border-left: 1px solid oklch(from var(--as-secondary) 0.9 c h);
            }

            & summary {
                & {
                    /* Entfernt den Standard-Marker */
                    cursor: pointer;
                    list-style: none;
                }

                &::-webkit-details-marker,
                &::marker {
                    /* Entfernt den Standard-Dreieck-Indikator für alle Browser */
                    display: none;
                }

                details>&:before {
                    /* Fügt ein benutzerdefiniertes Symbol nur dann hinzu, wenn es untergeordnete Elemente gibt ▶ ▼ */
                    font-family: "Font Awesome 5 Free";
                    /* Unicode für "chevron-right" */
                    content: "\f054";
                    display: inline-block;
                    padding-right: 8px;
                    font-weight: 900;
                    color: var(--as-primary);
                    transition: transform 0.2s ease;
                }

                details[open]>&:before {
                    /* Unicode für "chevron-down" */
                    content: "\f078";
                }

                details:not(:has(> :not(&)))>&:before {
                    /* Verhindert die Anzeige des benutzerdefinierten Markers, wenn keine untergeordneten Elemente vorhanden sind */
                    content: none;
                }
            }
        }
    }

    dialog {
        & {
            border: 1px solid #555;
            border-radius: 5px;
            animation: fade-out 0.7s ease-out;
            /* box-shadow: 3px 3px 10px #555; */
        }

        &[open] {
            animation: fade-in 0.7s ease-out;
        }

        &[open]::backdrop {
            animation: backdrop-fade-in 0.7s ease-out forwards;
        }
    }

    .sign-in {
        form {
            & {
                padding: 1rem;
                padding-top: .125rem;
                padding-bottom: .25rem;
            }

            & *+* {
                margin-top: .5rem;
            }

            &>div:last-child {
                display: flex;
                justify-content: flex-end;
            }
        }
    }
}

@layer theme {

    /* Animation keyframes */
    @keyframes fade-in {
        0% {
            opacity: 0;
            transform: scaleY(0);
            display: none;
        }

        100% {
            opacity: 1;
            transform: scaleY(1);
            display: block;
        }
    }

    @keyframes fade-out {
        0% {
            opacity: 1;
            transform: scaleY(1);
            display: block;
        }

        100% {
            opacity: 0;
            transform: scaleY(0);
            display: none;
        }
    }

    @keyframes backdrop-fade-in {
        0% {
            background-color: rgb(0 0 0 / 0%);
        }

        100% {
            background-color: rgb(0 0 0 / 66%);
        }
    }

    .btn {
        --bs-btn-padding-x: 0.625rem;
        --bs-btn-padding-y: 0.3125rem;
        --bs-btn-font-size: 0.9375rem;
    }
}

@layer theme {
    :root {
        --as-primary: #64a70b;
        --as-secondary: #008c95;
        /*
        --as-primary-t10: rgb(from var(--as-primary) r g b / 25%);
        --as-primary-l75: oklch(from var(--as-primary) 75% c h);
        --as-primary-d25: oklch(from var(--as-primary) 25% c h);
        */
    }
}

.jsontree_tree {
    font-size: 12px;
}

.jsontree_label,
.jsontree_value_object,
.jsontree_value_array {
    color: #0451a5;
    font-weight: normal;
}

.jsontree_value_null {
    color: #0000ff;
    font-weight: normal;
}

.jsontree_value_string {
    color: #c94e4e;
    font-weight: normal;
}

.jsontree_value_number {
    color: #2ba675;
    font-weight: normal;
}

.jsontree_value_boolean {
    color: #e07b00;
    font-weight: normal;
}