/* GENERAL RESETS */

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

img,
picture,
svg,
video {
    display: block;
}

* {
    margin: 0;
    padding: 0;
    font: inherit;
}

a {
    text-decoration: none;
}

b {
    font-weight: bold;
}

li {
    list-style-type: none;
}

button {
    background-color: transparent;
    border: none;
}

/* GENERAL WRAPPERS */

/* 
 1. Font family list copied from TailwindCSS / modern-normalize.
 2. Reset font-feature and font-variation settings.
*/
html {
    font-family: Arial, Helvetica, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 1 */
    font-feature-settings: normal; /* 2 */
    font-variation-settings: normal; /* 2 */
    font-size: 1.1em; /* Dit heb ik maar zo gelaten, ook al is het vet lelijk. -RR */
    line-height: 1.25;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0px;
}

.centered-flexbox-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.def-white-box {
    display: flex;
    flex-direction: column;

    background-color: rgba(255, 255, 255, 1);
    padding: 1.5em;
    border-radius: .25em;
    box-shadow: 0 0 0.2em 0 rgba(0, 0, 0, .15);
}

/* BACKGROUNDS */

.bg {
    background-color: rgb(20, 20, 20);
    background-image: url("../img/bg_imgs/main2.jpg");
    background-position: 0% 0%;
    background-size: cover;
    background-attachment: fixed;
}

.alt-bg {
    background-image: url("../img/bg_imgs/bg-alt.jpg");
}


/* TABLES */
/* this div will hold the table */
.table-result-wrapper {
    display: flex;
}

.def-table {
    display: flex;
    flex-direction: column;
    font-size: 1em;
    width: 100%;
}

.def-table img {
    height: 1em;
    vertical-align: middle;
}

.def-table thead {
    display: block;
    font-weight: bold;
    cursor: pointer;
}

.def-table tbody {
    display: block;
    overflow: auto;
}

.def-table tr {
    display: grid;
}

.def-table> :nth-child(2)> :nth-child(2n) {
    background-color: rgba(0, 0, 0, .1);
}

/* just tr:hover, but had to do it this way for specificity */
.def-table> :nth-child(2)>tr:is(:hover, :focus, :focus-within) {
    background-color: rgb(200, 200, 200);
    outline: none;
}

/* 
Use this template to space the table colums in page-specific css, 1fr = 1fraction. If all items are 1fr they will be spaced evenly
.def-table-row {
    grid-template-columns: 2fr 1fr 0.8fr 0.8fr 1.75fr 0.5fr; <-- changes these values
} 
*/

.def-table-row {
    grid-auto-flow: column;
    text-align: left;
    padding: 0.15em 0;
    grid-auto-columns: 1fr;
}

/* FORMS */

.def-form {
    display: flex;
    flex-direction: column;
    gap: .75em;
}

.def-form input {
    padding: .5em 1em;
}

.def-form input[type=submit] :not(.def-btn) {
    background-color: rgb(240, 240, 240);
}

.def-form input[type="checkbox"] {
    width: 1.3em;
    height: 1.3em;
}

.def-form select {
    padding: .5em 1em;
    border: .5px solid rgb(103, 103, 116);
    border-radius: .1em;
}

.def-form input:not(.def-btn):focus {
    outline: none;
    border: 2px solid rgb(40, 40, 40);
    border-radius: .1em;
}

.def-form input:disabled {
    cursor: not-allowed;
}

.form-combo-item {
    display: flex;
    align-items: center;
    gap: .5em;
}

.form-combo-item p {
    white-space: nowrap;
}

.form-date {
    display: flex;
    gap: .1em;
}

.form-date input {
    padding-inline: .5em;
}

/* assumes div with [input p input p input p] structure with the p being "<p>_</p>" */
.form-date> :is(:nth-child(1), :nth-child(3)) {
    width: 2.5em;
    text-align: center;
}

.form-date> :nth-child(5) {
    width: 3.5em;
    text-align: center;
}

.form-date p {
    padding-inline: 2px;
}

/* Forms: custom input fields for date, money, and label from general.js */
.date-input-wrapper,
.money-input-wrapper {
    display: flex;
    gap: .25em;
}

.date-input-wrapper input,
.money-input-wrapper input,
.product-input-wrapper input,
.number-input {
    padding-inline: .5em;
}

.date-input-year,
.money-input-euro,
.product-input-wrapper input,
.number-input {
    width: 3.5em;
}

.date-input-day,
.date-input-month,
.money-input-cent {
    width: 2.5em;
}


.label-dropdown {
    padding: .5em 1em;
}

.product-input-wrapper {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: .5em;
}

.product-input-wrapper img {
    height: 1.5em;
}

.product-input-wrapper .small-img {
    height: .75em;
}

/* SPANS */

span img {
    vertical-align: middle;
    height: 1em;
}

/* Span with regular text and images */

span.text-img {
    display: flex;
    align-items: center;
    gap: .5em;
}

span.text-img a {
    transition: 200ms;
    color: inherit;
    text-decoration: underline;
}

span.text-img a:hover {
    color: rgb(30, 30, 255);
}

/* Span extensions: .clickable .underline .center */

span.clickable {
    cursor: pointer;
}

span.underline {
    border-bottom: 1px solid transparent;
}

span.underline:hover {
    transition: 350ms;
    border-bottom: 1px solid black;
}

span.center {
    justify-content: center;
}

/* BUTTONS */
/* def-btn is dark by default, but the class .light makes it light */
/* In order for the images to switch color properly they need the class .invertable */
/* This is to prevent other images (not black) from inverting their color*/

.def-btn {
    display: flex;
    align-items: center;
    gap: .5em;
    white-space: nowrap;
    padding: .5em 1em;

    transition: 200ms;
    background: rgb(40, 40, 40);
    border: 1px solid rgb(40, 40, 40);
    color: white;
    cursor: pointer;
}

.def-btn>.invertable {
    transition: 300ms;
    filter: invert();
}

.def-btn.light {
    background-color: rgb(240, 240, 240);
    border: 1px solid rgb(135, 135, 135);
    color: black;
}

.def-btn img {
    height: 1em;
}

.def-btn:hover,
.def-btn:focus {
    background-color: rgb(240, 240, 240);
    color: black;
    border-color: rgb(135, 135, 135);
    outline: none;
}

.def-btn.light>.invertable,
.def-btn:hover>.invertable,
.def-btn:active>.invertable,
.def-btn:focus>.invertable {
    filter: invert(0);
}

.def-btn.light:hover>.invertable,
.def-btn.light:active>.invertable,
.def-btn.light:focus>.invertable {
    filter: invert();
}

.def-btn.light:hover,
.def-btn.light:focus {
    background-color: rgb(40, 40, 40);
    color: white;
    border-color: rgb(40, 40, 40);
}

.def-btn:active {
    background-color: white;
}

.def-btn.light:active {
    background-color: black;
    color: white;
}


/* Status picker */
.statusPicker {
    position: absolute;
    display: flex;
    z-index: 10;
    background-color: white;
    border: 2px solid rgb(40, 40, 40);
}

.statusPicker> :is(:nth-child(1), :nth-child(2)) {
    border-right: 1px solid rgb(40, 40, 40);
}

.statusPicker img {
    height: 20px;
    vertical-align: middle;
}

.clickable-status-icon {
    padding: 4px;
    transition: 200ms;
    background-color: white;
}

.clickable-status-icon:hover {
    cursor: pointer;
    background-color: rgb(40, 40, 40);
}

.clickable-status-icon:hover>.invertable {
    filter: invert();
}

/* POPUPS */

#popup-cover {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    background-color: rgba(0, 0, 0, .75);
    z-index: 50;
    display: grid;
    place-items: center;
}

#popup-exit-wrapper {
    position: absolute;
    width: 24em;
    background-color: white;

    display: flex;
    flex-direction: column;

    z-index: 101;
}

#popup-exit-wrapper button {
    padding: .5em;
}

#popup-exit-wrapper span {
    display: flex;
    justify-content: flex-end;
}

#popup-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25em;
}

#popup-top-bar p {
    font-size: 1.25em;
    font-weight: bold;
}

#popup-content {
    padding: 1.5rem;
    padding-top: 0;
    display: flex;
    flex-direction: column;
}

/* UTILITY */

.hidden {
    display: none;
}

.flex-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.flex-left {
    justify-self: flex-start;
}

.flex-right {
    justify-self: flex-end;
}

.flex-content-right {
    justify-content: flex-end;
}

.flex-content-left {
    justify-content: flex-start;
}

.flex-between {
    justify-content: space-between;
}

.flex-center {
    justify-content: center;
}

.align-left {
    align-items: flex-start;
}

.align-right {
    align-items: flex-end;
}

.align-center {
    align-items: center;
}

.flex-expand {
    flex: 1;
}

.text-small {
    font-size: .8em;
}

.bold {
    font-weight: bold;
}

.gap-75em {
    gap: .75em;
}


.gap-5em {
    gap: .5em;
}

.gap-1em {
    gap: 1em;
}

.red {
    color: red;
}

/* filters: for converting black icons to white or grey ones or for rotating images */

.invert {
    filter: invert();
}

.grey-15 {
    filter: invert(15%);
}

.grey-60 {
    filter: invert(60%);
}

.flip-180 {
    transform: rotate(180deg);
}

.pos-relative {
    position: relative;
}

.pos-absolute {
    position: absolute;
}

.width-full {
    width: 100%;
}

/* Animations */

@keyframes rotation {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}


/* Tags & Labels */

.tag {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.3em 0.5em;
    background-color: rgb(210, 210, 210);
    height: 1.4em;
    border-radius: 0.7em;
    cursor: pointer;
}

.tag:hover {
    background-color: rgb(180, 180, 180);
}

.paylabel {
    display: inline;
    border: 1px solid rgb(123, 123, 123);
    border-radius: 0.2em;
    padding: 0 .4em;
    width: fit-content;
}