body {
    background: var(--main-background);
    background-size: cover;
    backdrop-filter: grayscale(1) blur(0px);
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    color: var(--primary-color);
    font-family: system-ui;
    font-size: var(--primary-fontsize);
    min-width: 40rem;
    height: 100%;
    margin: 0;
    transition: backdrop-filter 3s ease-in-out;
}

body[data-device="mobile"] {
    min-width: 100vw;
    width: 100vw;
    height: unset;
}

.main-content {
    position: absolute;
    display: flex;
    flex-direction: row;
    /* align-items: center; */
    justify-content: center;
    gap: 0.5rem;
    left: 1.5rem;
    top: 5.5rem;
    width: calc(100% - 3rem);
    height: max(calc(100% - 11.5rem), 12rem);
}

[data-device="mobile"] .main-content {
    width: 100%;
    gap: unset;
    left: 0;
    top: 4rem;
    height: max(calc(100% - 8rem), 12rem);
}

[data-device="mobile"] #body {
    width: 100vw;
    height: 100vh;
}

body.loaded,
body:has(.login-form) {
    backdrop-filter: grayscale(1) blur(15px);
}


#logindiv img {
    max-height: 20%;
}

#home {
    background: var(--secondary-color-2);
    flex: 1;
    height: 100%;
    
    border-radius: 18px;
    overflow-x: auto;
    overflow-y: auto;
}

[data-device="mobile"] #home {
    width: calc(100% - 1.5rem);
}

#home>div {
    border-radius: 0.5rem;
    width: calc(100% - 2rem - 1px);
    height: calc(100% - 2rem - 1px);
    margin: 1rem;
}

#home:has(#logindiv) {
    left: 1.5rem;
    top: 1.5rem;
    width: calc(100% - 3rem);
    height: calc(100% - 8rem);
}

#home:is(.hidden, .hidden:has(#logindiv)) {
    width: 0%;
    height: 0%;
}


#home.rollmenu {
    left: 9%;
    width: 89%;
}

#logindiv {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 99%;
}

/* header is upper region of the page */
#header {
    position: absolute;
    height: 4rem;
    width: calc(100% - 6rem);
    left: 1.5rem;
    background: var(--secondary-color-2);
    top: 1rem;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-inline: 1.5rem;
}

[data-device="mobile"] #header {
    padding-inline: 0;
    height: 3.8rem;
    width: 100%;
    left: 0;
    top: 0;
}

body:has(.login-form) #header {
    display: none;
}

#header.hidden {
    width: 0%;
    overflow: hidden;
}

#header>* {
    max-height: 95%;
    transition: filter 0.2s ease-in-out;
}

/* footer is the lower region of the page */
#footer {
    position: absolute;
    top: max(calc(100% - 5.5rem), 18rem);
    height: 4rem;
    width: calc(100% - 3rem);
    left: 1.5rem;
    background: var(--secondary-color-2);
    
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    overflow: hidden;
}

[data-device="mobile"] #footer {
    width: 100%;
    height: 3.8rem;
    top: calc(100% - 3.8rem);
    left: 0;
    font-size: 0.6rem;
}

#footer.hidden {
    width: 0%;
    overflow: hidden;
}

#footer * {
    max-height: 95%;
    transition: filter 0.2s ease-in-out;
}

/* buttons */

.btn,
.btn-not-hover,
.status {
    appearance: auto;
    text-rendering: auto;
    letter-spacing: normal;
    word-spacing: normal;
    line-height: normal;
    text-transform: none;
    text-indent: 0px;
    text-shadow: none;
    display: inline-block;
    text-align: center;
    box-sizing: border-box;
    margin: 0em 0em 0em 0em;
    padding-block: 1px;
    padding-inline: 6px;
    border-width: 2px;
    padding: 1px;
    margin-bottom: 1px;
    margin-inline: 3px;
    height: 1.2rem;
    width: fit-content;
    min-width: 8rem;
    border-radius: 0.8rem;
    background-color: var(--main-theme-color);
    color: var(--primary-color);
    font-size: var(--primary-fontsize);
    border-color: var(--primary-color);
    text-transform: uppercase;
    font-weight: bold;
    border-style: outset;
    border-image: initial;
    white-space: nowrap;
    text-overflow: ellipsis;
    box-shadow: rgba(50, 50, 93, 0.25) 0px 50px 100px -20px, rgba(0, 0, 0, 0.3) 0px 30px 60px -30px, rgba(10, 37, 64, 0.35) 0px -2px 6px 0px inset;
}
/*SOME CCS FUCKSORSERY TO FIX BUTTON PADDING IN TABLES*/
table .btn:not(button){
    padding-top: 0px;
}

.btn {

    transition: border-color 0.2s ease-in-out !important;
    cursor: pointer;

}

.btn-hidden {
    display: none;
}

.btn-flexy {
    min-width: auto;
    max-width: auto;
    padding-inline: 0.5rem;
}

.btn:hover {
    box-shadow: rgba(50, 50, 93, 0.25) 0px 30px 60px -12px inset, rgba(0, 0, 0, 0.3) 0px 18px 36px -18px inset;
    border-color: var(--main-theme-color);
}

.btn.actions,
.btn.actions:hover {
    background-color: var(--action-color) !important;
    border-radius: 0.2rem;
    border-color: black;

}

a.btn {
    text-decoration: none;
}

/* should be called btn.btn-success, not btn.success to distinguish from default django form alert classes!!! */
.btn.success {
    background-color: var(--success-color);
}

.btn.btn-success {
    background-color: var(--success-color);
}

.btn.delete {
    background-color: var(--danger-color);
}

.btn.delete:hover {
    border-color: black;
}

.btn.cancel {
    background-color: var(--warning-color);
}

.btn.cancel:hover {
    border-color: black;
}

.btn[disabled],
.btn[disabled]:hover {
    border-color: var(--primary-disabled-color);
    background-color: var(--secondary-disabled-color);
    color: var(--primary-disabled-color);
    cursor: unset;
}

/* buttons */
button.standard {
    padding: 1px;
    margin-bottom: 1px;
    margin-inline: 3px;
    min-height: 1.2rem;
    width: fit-content;
    width: 8rem;
    border-radius: 0.8rem;
    border-color: var(--primary-color);
    background-color: var(--main-theme-color);
    color: var(--primary-color);
    font-size: var(--primary-fontsize);
    transition: border-color 0.2s ease-in-out !important;
    text-transform: uppercase;
    font-weight: bold;
}

button.success {
    background-color: var(--success-color);
}

button.standard[disabled],
button.standard[disabled]:hover {
    border-color: var(--primary-disabled-color);
    background-color: var(--secondary-disabled-color);
    color: var(--primary-disabled-color);
    cursor: unset;
}

button {
    cursor: pointer;
    box-shadow: rgba(50, 50, 93, 0.25) 0px 50px 100px -20px, rgba(0, 0, 0, 0.3) 0px 30px 60px -30px, rgba(10, 37, 64, 0.35) 0px -2px 6px 0px inset;
}

button:hover {
    box-shadow: rgba(50, 50, 93, 0.25) 0px 30px 60px -12px inset, rgba(0, 0, 0, 0.3) 0px 18px 36px -18px inset;
}

button.standard.actions,
button.standard.actions:hover {
    background-color: var(--action-color) !important;
    border-radius: 0.2rem;
    border-color: black;

}

button.pagebutton {
    width: min-content;
    border-radius: 0.4rem;
    min-width: 2rem;
}

button.standard:hover {
    border-color: var(--main-theme-color);

}

button.standard.delete {
    background-color: var(--danger-color);
}

button.standard.delete:hover {
    border-color: black;
}

button.standard.cancel {
    background-color: var(--warning-color);
}

button.standard.cancel:hover {
    border-color: black;
}

/* multiple buttons/actions */
.button_container .buttons {
    max-height: 0rem;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out !important;
    top: 100%;

}

.button_container.clicked .buttons {
    max-height: 10rem;
    z-index: 5;
}

[data-device="mobile"] .buttons {
    flex-wrap: wrap;
}

.button_container button {
    margin-block: 5px;

}

.button_container {
    position: relative;
}

.button_container:hover>button {
    background-color: var(--main-theme-color);
}

/* inputs */
input,
textarea,
select {
    background: var(--secondary-solid-color);
    color: var(--primary-color);
}

select option {
    background: var(--secondary-solid-color);
    color: var(--primary-disabled-color);
}

select option:hover {
    background: var(--secondary-color-2);
    color: var(--primary-color);
}

select option:checked {
    background: var(--secondary-disabled-color-2);
    color: var(--primary-color);
}

::-webkit-calendar-picker-indicator {
    filter: var(--calendar-picker-filter);
}



/* titles */




/* scroll bars */

::-webkit-scrollbar-track {
    border: 5px solid var(--scroll-background-color);
    background-color: var(--scroll-background-color);
}

::-webkit-scrollbar {
    width: 15px;
    height: 15px;
    background-color: var(--scroll-background-color);
    position: absolute;
    top: 0px;
    cursor: grab;
}

::-webkit-scrollbar-thumb {
    background-color: var(--main-theme-color);
    box-shadow: var(--protruding-element-shadow-box);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    box-shadow: var(--schedule-indicator-box-shadow);
}

/* additional classes */
.flex-row {
    display: flex;
    flex-direction: row;
    align-content: center;
    align-items: center;
}


/* default Django form error class */
.errorlist {
    color: var(--danger-color);
    font-size: var(--primary-fontsize);
    font-weight: bold;
}

.error {
    color: var(--danger-color);
    text-transform: uppercase;
    font-weight: bold
}

.warning {
    color: var(--warning-color);
    text-transform: uppercase;
    font-weight: bold
}

.success {
    color: var(--success-color);
    text-transform: uppercase;
    font-weight: bold
}


div.status {
    height: 1.2rem;
    width: fit-content;
    min-width: 8rem;
    border-radius: 0.8rem;
    color: var(--primary-color);
    font-size: var(--primary-fontsize);
    transition: background-color 0.2s ease-in-out !important;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    padding-inline: 5px;
}

.pagination {
    display: flex;
    flex-direction: row;
    padding-block: 0.3rem;
}

.toogle-language img {
    width: 1.5rem;
}

td,
th,
thead,
tbody,
table,
div,
tr {
    caret-color: transparent;
}

input,
textarea,
select,
option {
    caret-color: var(--primary-color);
}

/* logos */

.main-logo {
    background-image: var(--main-logo);
    background-size: cover;
    width: 6rem;
    height: 4rem;
    max-height: none !important;
}

.text-logo {
    background-image: var(--text-logo);
    background-size: cover;
    width: 6rem;
    height: 4rem;
    max-height: none !important;
}

[data-device="mobile"] .text-logo {
    width: 4rem;
    height: 2rem;
}

.graphics-logo {
    background-image: var(--graphics-logo);
    background-size: cover;
    width: 4rem;
    height: 4rem;
    max-height: none !important;
}

[data-device="mobile"] .graphics-logo {
    width: 2rem;
    height: 2rem;
}

.user-logo {
    background-image: var(--user-logo);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 12rem;
    height: 4rem;
    max-height: none !important;
}

[data-device="mobile"] .user-logo {
    width: 6rem;
    height: 2rem;
}

.user-logo-login {
    background-image: var(--user-logo);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    height: 15%;
    width: auto;
    aspect-ratio: 6/2;
    max-height: none !important;
}

.full-logo {
    background-image: var(--full-logo);
    background-size: cover;
    height: 40%;
    width: auto;
    aspect-ratio: 16/9;
    max-height: none !important;
}

.login-form {
    border-radius: 1rem;
}

.pdf-preview-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.5rem;

}

:not(#home)>.pdf-preview-container {
    border-radius: 0.5rem;
    width: calc(100% - 2rem - 1px);
    height: calc(100% - 2rem - 1px);
    margin: 1rem;
}


.pdf-preview {
    flex-grow: 1;
    display: contents;
}

.pdf-preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    zoom: calc(1 / var(--zoom)) !important;
}

.text-bold {
    font-weight: bold;
}

.text-upper {
    text-transform: uppercase;
}