:root {
    --sidebar-width-open: 320px;
    --sidebar-width-closed: 115px;
    --app-header-size: 5rem;
    --main-header-size: 4.5rem;
}

* {
    font-family: Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/*css framework placeholder*/
.scroll {
    overflow: auto;
}

.notification {
    border-width: 1px;
    border-style: solid;
    border-radius: 2px;
}

html {
    width: 100%;
    height: 100%;
}

form {
    display: grid;
}

/* Screen-reader only: visually hidden but accessible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body {
    display: grid;
    grid-template-rows: 4rem 1fr;
    grid-template-columns: 100%;
    width: 100%;
    height: 100%;

    grid-template-areas:
    "header"
    "main";

    margin: 0;
    padding: 0;

    gap: var(--spacing-lg);

    place-items: stretch;
    place-content: stretch;

    .disabled {
        opacity: 1;
        filter: contrast(0.25) brightness(1.5) grayscale(1);
        cursor: auto;
    }

    > header {
        grid-area: header;
        display: grid;
        place-content: stretch;

        grid-template-columns: 1fr 1fr;
        grid-template-areas: "search menu";
        gap: var(--spacing-lg);

        padding: var(--spacing-lg) max(var(--spacing-xl), 2%) 0;

        @media (min-width: 850px) {
            .search {
                grid-area: search;
                display: flex;
                justify-content: center;

                align-items: start;
                margin-top: 0.4rem;
                /* we do this+margin-top instead of center because the height of the header changes when
                                                  the dropdown menu to the right is opened */
            }
        }

        @media (max-width: 849.9px) {
            .search {
                grid-area: search;
                display: flex;
                justify-content: center;

                align-items: start;
                margin-top: 0.4rem;
                /* we do this+margin-top instead of center because the height of the header changes when
                                                  the dropdown menu to the right is opened */
            }
        }

        > .menu {
            z-index: 100;
            grid-area: menu;
            justify-self: stretch;
            text-align: right;
            display: flex;
            justify-content: right;

            .pr-2 {
                padding-right: .5rem;
            }

            .ui-overlaypanel-content {
                display: flex;
                flex-direction: column;
                gap: var(--spacing-sm);

                .ui-button {
                    position: relative;
                    z-index: 1;

                    &:hover {
                        z-index: 0;
                    }
                }
            }
        }

    }

    > main {
        grid-area: main;
        padding: 0 max(var(--spacing-xl), 2%);
        display: grid;
        grid-template-rows: auto 1fr;
        min-height: fit-content;
        min-width: fit-content;
        gap: var(--spacing-lg);


        header {
            display: flex;
            justify-content: space-between;
            align-items: center;

            gap: var(--spacing-md);

            .header-group {
                display: grid;
                align-items: center;
                justify-items: start;

                p {
                    font-size: 1.5rem;
                }

                * {
                    line-height: 1;
                    margin: 0;
                }

                &.actions {
                    height: 3.5rem;
                    align-items: stretch;
                }
            }
        }
    }

    > aside {
        grid-area: aside;
    }
}

#copy-right a:link,
#copy-right a:visited,
#copy-right a:hover,
#copy-right a:active {
    text-decoration: none;
    color: unset;
}

.button-wrapper {
    padding: 3px;
    border-radius: 15px;
}

.button-wrapper-clicked {
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    background: conic-gradient(from 90deg, rgb(154, 220, 255), rgb(174, 159, 215), rgb(197, 89, 167), rgb(213, 27, 74), rgb(244, 208, 111), rgb(154, 220, 255));
}

.button-wrapper:hover,
.button-wrapper:focus-within {
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    background: conic-gradient(from 90deg, rgb(154, 220, 255), rgb(174, 159, 215), rgb(197, 89, 167), rgb(213, 27, 74), rgb(244, 208, 111), rgb(154, 220, 255));
    transition: 0.2s;
}

.logo-div {
    position: relative;
    display: grid;

    .logo_container {

        img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }
    }
}

#menu.clicked {
    #main-menu {
        width: 18rem;
        height: 10rem;
        z-index: 1;
    }

    .profile-pic-wrapper {
        height: 4.75rem;
        width: 4.75rem;
    }

    .options-dropdown-wrapper {
        height: 100%;
        flex-direction: column-reverse;
    }

    .reverse-columns {
        flex-direction: column-reverse;
    }
}

#main-menu {
    display: grid;
}

#dummyluceneform .dummy-lucene-input-wrapper {
    position: relative;
    display: inline-flex;
}

#dummyluceneform .dummy-lucene-input-wrapper::before {
    content: "\e908";
    position: absolute;
    left: 0.7em;
    top: 50%;
    transform: translateY(-50%);
    font-family: "PrimeIcons";
    font-size: 1.2em;
    color: #9c9c9c;
    pointer-events: none;
}

#dummyluceneform .dummy-lucene-input-wrapper .ui-inputfield,
#dummyluceneform .dummy-lucene-input-wrapper input {
    border-radius: 12px;
    padding-left: 2.7em !important;
}

#lucenedialog {
    position: fixed !important;
    top: 5% !important;
    left: 5% !important;
    width: 90% !important;
    height: 90% !important;
    display: flex;
    flex-direction: column;
}

#lucenedialog .ui-dialog-content {
    flex: 1;
    overflow-y: auto;
}

#luceneform a {
    color: black;
}

.blur-effect {
    filter: blur(3px);
    transition: filter 0.3s ease;
    cursor: wait;
}

#luceneform .nowrap {
    white-space: nowrap;
}

#luceneform .lucene-input-wrapper {
    position: relative;
    display: inline-flex;
}

#luceneform .lucene-input-wrapper::before {
    content: "";
    position: absolute;
    left: 0.7em;
    top: 50%;
    transform: translateY(-50%);
    font-family: "PrimeIcons";
    font-size: 1.2em;
    color: #9c9c9c;
    pointer-events: none;
    content: "\e908"; /* Unicode für pi-search */
}

#luceneform .lucene-input-wrapper .ui-inputfield {
    padding-left: 2.7em !important;
    border-radius: 12px;
    border-width: 1px;
}

#luceneform .lucene-input-wrapper .ui-inputfield:hover {
    outline: none;
    border-color: transparent;
    box-shadow: none;
}

#luceneform .lucene-input-wrapper .ui-inputfield:focus {
    outline: 2px solid #000;
    outline-offset: -3px;
    border-color: transparent;
    box-shadow: none;
}

#luceneform .lucene-input-wrapper .lucene-clear {
    position: absolute;
    right: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    font-size: 2.0rem;
    line-height: 1;
    cursor: pointer;
    color: #9c9c9c;
    padding: 0;
}

#luceneform .lucene-input-wrapper .lucene-clear:hover {
    color: #555;
}

#luceneform .lucene-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #9c9c9c;
    transition: color 0.2s ease;
}

#luceneform .lucene-help:hover {
    color: #555;
}

#luceneform\:results tr {
    transition: background-color 0.2s ease-in-out;
}

#luceneform\:results tr:hover {
    background-color: #F5F6FA;
}

body .ui-datatable thead th.ui-state-active,
body .ui-datatable thead th.ui-state-hover:hover {
    color: var(--fontColor);
}

.debugonly {
    color: #c1bfb4;
}

.option-button {
    background: var(--panelContentBackgroundColor);
    border: 0;
    border-radius: var(--border-radius-xl);
    padding: 1rem 0rem 1rem 0px;
    box-shadow: none;
    width: inherit;

    .ui-button-text {
        /*color: black;*/
        padding: .5rem 1rem .5rem 2.5rem;
    }

    .pi {
        margin-left: .75rem;
        margin-top: -0.55rem;
    }
}

.option-button.ui-button.ui-state-loading {
    opacity: 1;
}

body .ui-overlaypanel.options-dropdown {
    border-top-right-radius: 0;
    border-top-left-radius: 0;
    width: 18rem;
    box-shadow: none;
}

.ui-button.options-dropdown-button {
    background-color: transparent;
    border: none;
    color: black;
    box-shadow: none;

    display: flex;
    align-items: center;
    justify-content: right;
    gap: var(--spacing-sm);

    .ui-button-text {
        padding: .5rem 2rem .5rem 2rem;
    }

    .pi {
        transition: var(--duration-xs);
        color: var(--accentColor);
    }

    &:hover {
        border: none;
        box-shadow: none;
    }
}

.options-dropdown-wrapper {
    transition: var(--duration-xs);
    border-top-right-radius: var(--border-radius-xl);
    border-top-left-radius: var(--border-radius-xl);
    display: flex;
    justify-content: right;

    .ui-overlaypanel {
        top: 11rem;
    }
}

.options-dropdown-wrapper-clicked {
    background-color: white;
    padding-top: 1rem;
}

.ui-button.options-dropdown-button.options-dropdown-button-clicked {
    width: 100%;
    flex-direction: column-reverse;

    .pi {
        top: 0;
        right: 50%;
        rotate: 180deg;
        width: 1.5rem;
        font-size: 1.5rem;
        left: 48.3%;
        margin-top: 0;
    }

    .ui-button-text {
        /*color: black;*/
        padding-left: 2rem;
    }
}

.pi-power-off {
    color: red;
    font-weight: 600;
}


#sidebar {
    display: grid;
    height: 100%;
    position: fixed;
    background-color: var(--panelBackgroundColor);
    border-top-right-radius: var(--border-radius-md);
    border-bottom-right-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    gap: var(--spacing-md);

    grid-template-rows: auto 1fr;

    transition: var(--duration-xs);

    #sidebar-scroll-wrapper {
        display: grid;
        grid-template-rows: auto 1fr;
        min-height: fit-content;
        gap: var(--spacing-lg);

        .menuForm {
            border-radius: var(--border-radius-xl);

            display: flex;
            flex-direction: column;

            overflow-y: auto;

            padding: var(--spacing-sm);
            gap: var(--spacing-sm);
            background-color: var(--surface-ground);

            .ui-linkbutton a {
                display: block;
                width: 100%;
                height: 100%;
            }

            .navlist-section-heading {
                padding: var(--spacing-md);
            }

            .lvl {
                display: grid;
                grid-template-rows: auto;
                grid-template-columns: 100%;

                place-content: start stretch;
                place-items: start stretch;

                gap: 5px;

                padding: 0 0 15px 1.5rem;

                .ui-button {
                    border-radius: 10px;

                    &.ui-button-text-icon-left .ui-button-text {
                        padding: 0.25rem 0.5rem 0.25rem 2rem;
                    }
                }
            }

            #menu-toggle {
                position: absolute;
                top: calc(1.5rem + 1.75rem - 18px);
                right: -16px;
                border-radius: 50%;
                border: none;
                background-color: var(--panelContentBackgroundColor);
                padding: 6px;
                color: red;

                &:hover, &:focus {
                    outline: 2px solid rgba(1, 1, 1, 0.9);
                }

                i {
                    font-size: 0.75rem;
                    text-align: center;
                    border: 2px solid #999999;
                    border-radius: 50%;
                    height: 25px;
                    width: 25px;
                    display: inline-block;

                    &:before {
                        display: inline-flex;
                        color: #999999;
                        justify-content: center;
                        margin-top: .285rem;
                    }

                    @media screen and (min-width: 1200px) {
                        &.pi-chevron-right {
                            display: none;
                        }
                    }
                    @media screen and (max-width: 1199px) {
                        &.pi-chevron-left {
                            display: none;
                        }
                    }
                }
            }
        }
    }
}

/*collapsed menu*/

@media (max-width: 1199px) {
    body.lw:not(.sidebar-opened) #sidebar {
        width: var(--sidebar-width-closed);
        padding: var(--spacing-md) var(--spacing-lg);

        .ui-button {
            height: calc(2.15rem + 6px);
        }

        #test-logo-full,
        .ui-button-text,
        .curr-nav-wrapper {
            display: none;
        }

        .navlist-section-heading {
            padding-left: 2px;
            padding-right: 0;
            width: 2px;
        }

        #sidebar-scroll-wrapper {
            .menuForm {
                .ui-icon {
                    left: calc(50% - 8px);
                    margin-top: -8px;
                }

                .lvl {
                    display: none;
                }
            }
        }
    }

    body.lw.sidebar-opened #sidebar {
        z-index: 999999;
        width: var(--sidebar-width-open);
        /* shadow only on small screen sidebar popup */
        box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);

        #test-logo-collapsed {
            display: none;
        }

        #sidebar-scroll-wrapper .menuForm #menu-toggle {
            i.pi-chevron-left {
                display: inline-block;
            }

            i.pi-chevron-right {
                display: none;
            }
        }
    }
}

@media (min-width: 1200px) {
    body.lw:not(.sidebar-closed) #sidebar {
        width: var(--sidebar-width-open);

        #test-logo-collapsed {
            display: none;
        }
    }

    body.lw.sidebar-closed {
        > main, > header {
            margin-left: var(--sidebar-width-closed);
        }

        #sidebar {
            width: var(--sidebar-width-closed);
            padding: var(--spacing-md) var(--spacing-lg);

            .ui-button {
                height: calc(2.15rem + 6px);
            }

            #test-logo-full,
            .ui-button-text,
            .proto-panel {
                display: none;
            }

            .navlist-section-heading {
                padding-left: 2px;
                padding-right: 0;
                width: 2px;
            }

            #sidebar-scroll-wrapper {
                .menuForm {
                    .ui-icon {
                        left: calc(50% - 8px);
                        margin-top: -8px;
                    }

                    .lvl {
                        display: none;
                    }

                    #menu-toggle {

                        i.pi-chevron-left {
                            display: none;
                        }

                        i.pi-chevron-right {
                            display: inline-block;
                        }
                    }
                }
            }
        }
    }
}

body.lw > main, body.lw > header {
    transition: margin-left var(--duration-xs);
    margin-left: var(--sidebar-width-closed);
    margin-right: 2%;
}

@media (min-width: 1200px) {
    body.lw > main, body.lw > header {
        margin-left: var(--sidebar-width-open);
    }
}

.ui-button.veranstaltung-button-widget {
    padding-top: 2rem;
    height: 100%;
    background: white;
    border: 0;
    border-radius: var(--border-radius-xl);
    width: inherit;
    text-align: left;

    .ui-progressbar-value {
        background: linear-gradient(to right, rgb(154, 220, 255), rgb(174, 159, 215), rgb(197, 89, 167), rgb(213, 27, 74), rgb(244, 208, 111));
    }

    .ui-progressbar {
        height: .3rem;
        margin-bottom: .5rem;
    }

    .veranstaltung-button-content {
        margin-left: 8px;

        span {
            padding-right: .1rem;
        }
    }

    .veranstaltung-fortschritt-wrapper {
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
        height: 5.7rem;
    }

    .veranstaltung-fortschritt {
        font-size: 2rem;
        margin-top: auto;
    }
}

#dashboard_form a.ui-datepicker-prev {
    color: var(--accentColor);
    text-decoration: none;
}

#dashboard_form a.ui-datepicker-next {
    color: var(--accentColor);
    text-decoration: none;
}

#dashboard_form .ui-datepicker-inline {
    border: none;
    border-radius: var(--border-radius-xl);
}

#dashboard_form .ui-datepicker-header {
    border: none;
}

body .ui-button {
    text-align: left;

    a {
        text-decoration: none;
    }
}

.blur-background {
    filter: blur(5px);
    transition: filter var(--duration-xl-fast) ease;
}

#blurBackground {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(0px);
    transition: backdrop-filter var(--duration-xl-fast) ease;
    display: none;
    z-index: 1;
}

/* TODO(Konrad) @kkoch: Ich weiß nicht genau ob das in irgendeiner Form auch in das Theme
    soll. aber das wäre ein typischer sass fall, dass man hier ne loop für die line couns generiert.
    1-5 wäre vermutlich genug. */
.clamp-lines-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    clip-path: content-box;
}

.proto-navlist-section-heading {
    padding: var(--spacing-md);
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

body.lw {
    .curr-nav-wrapper {
        .ui-widget-header hr {
            margin-bottom: 0;
            margin-left: var(--spacing-lg);
        }

        .proto-navpanel-heading {
            font-size: 1em;
            display: flex;
            align-items: center;
            gap: var(--spacing-md);
            padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-sm) var(--spacing-lg);
        }

        .ui-widget-content {
            padding: 0;
        }
    }

    .profile-pic-wrapper {
        width: 2.75rem;
        height: 2.75rem;
        border-radius: 100%;
        display: grid;
        overflow: hidden;

        &.rainbow-border {
            padding: 1px;
        }

        .profile-pic {
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: top center;
            border-radius: 100%;
        }
    }
}


.pagination-container {
    display: flex;
    flex-wrap: wrap; /* erlaubt Umbruch bei kleiner Breite */
    justify-content: space-between;
    gap: 10px; /* optionaler Abstand */

}

.pagination-left,
.pagination-right {
    margin-bottom: 1rem;
}

.pagination-left {
    flex: 0 0 70%; /* feste Basis: 70% */
    display: flex;
    flex-wrap: wrap;
    justify-content: left;
}

.pagination-right {
    flex: 1; /* nimmt restlichen Platz */
    display: flex;
    justify-content: right;
}

.ui-outputlabel-label {
    font-weight: unset !important;
}

/* Responsive: bei kleiner Breite Spalten untereinander */
@media (max-width: 600px) {
    .pagination-left, .pagination-right {
        flex: 0 0 100%;
        justify-content: left; /* beide links für mobile */
    }
}

/* Facet chips inside lucene dialog */
.lucene-facets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.lucene-facet-chip {
    background: #eef0f4;
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    color: #333;
}

.ui-datatable-scrollable-header {
    position: sticky;
    top: 0;
    z-index: 10;
}

.lw.no-scroll,
html.no-scroll {
    overflow: hidden;
}

#luceneform .search-link {
    text-decoration: underline;
    color: var(--fontColor);
}

/* Thumbnail hover preview in search results */
.search-thumb-container {
    display: inline;
}

.search-thumb-container .search-thumb-preview {
    display: none;
}

.search-thumb-floating {
    position: absolute;
    z-index: 999999;
    pointer-events: none;
    object-fit: contain;
    border: none;
    background: #fff;
    width: auto;
}

.attached-file-image {
    height: 10rem;
    width: 100%;
    object-fit: contain;
}

.attached-file-panel {
    width: 12rem;

    .ui-panel-content {
        max-height: 15rem;
    }

    .ui-panel-titlebar {
        .ui-panel-titlebar-icon {
            color: #495057;
        }
    }
}

.attached-file-name {
    word-break: break-all;
    max-height: 3rem;
    overflow: hidden;
    margin-top: .5rem;
}

.attached-file-image-wrapper {
    height: 10rem;
}

.attached-file-overlay {
    transition: .5s ease;
    opacity: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -150%);
    -ms-transform: translate(-50%, -150%);
    text-align: center;

    .pi {
        font-size: 5rem;
        /*color: black;*/
    }
}

.attached-file-image-container:hover .file-content {
    opacity: 0.1;
}

.attached-file-image-container .file-content .pi-download {
    opacity: 1;
}

.attached-file-image-container:hover .attached-file-overlay {
    opacity: 1;
}

.attached-file-image-container {
    position: relative;
}

.file-content {
    transition: .5s ease;
    backface-visibility: hidden;
}

.image-size {
    min-width: 15rem;
    min-height: 15rem;
    max-width: 40rem;
    max-height: 40rem;
}

.attached-files-wrapper {
    .ui-panel-content {
        border-radius: 15px;
    }
}

#tutorialpanel {
    position: fixed;
    top: 0;
    right: 0;
    width: 30px;
    height: 30px;
    z-index: 9999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#tutorialpanel > i {
    font-size: 20px;
    color: rgb(153, 153, 153);
    font-weight: 400;
    margin-top: 10px;
    margin-right: 10px;
}

.ui-card.folder-dialog-card {
    background: #F5F6FA;
}
.control-field {
    display: flex;
    &.top, &.bottom {
        align-items: start;
        gap: var(--spacing-sm);
    }
    &.left, &.right {
        align-items: center;
        gap: var(--spacing-md);
    }
    &.top {
        flex-direction: column;
    }
    &.right {
        flex-direction: row-reverse;
    }
    &.bottom {
        flex-direction: column-reverse;
    }
}
