/* Mutual settings for the both, mobile and desktop layouts */

* {
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 95%;
    background: var(--brcolor);
}

main,
footer,
header,
.auth,
.breadcrumbs {
    display: flex;
    width: 100%;
    max-width: var(--containerwidth);
}

header {
    align-items: center;
    justify-content: space-between;
    min-height: var(--navbarheight);
    background: var(--navbarcolor);
}

main {
    flex-direction: column;
    background: var(--mainbody);
    padding-bottom: var(--space);
    flex: 1;
}

main > h2,
main > h3,
main > h4,
main > div,
main > span,
main > table,
main > iframe,
main > form,
main > section,
main > p,
main > info {
    margin-left: var(--space);
    margin-right: var(--space);
}

info {
    display: flex;
    flex-direction: row;
    background: #90c890;
    border: 1px solid #184318;
    margin-top: calc(var(--space) / 2);
    padding: calc(var(--space) / 2) var(--space);
    width: auto;
}

info > span {
    display: flex;
    align-items: center;
    margin-right: calc(var(--space) / 2);
    height: 100%;
}

footer {
    display: flex;
    flex-basis: 100%;
    background: var(--footercolor);
    padding: calc(var(--space) * 2) var(--space);
    gap: var(--space);
    flex-direction: column;
    color: white;
}

footer > section {
    display: flex;
    flex-basis: 100%;
    flex-direction: row;
    gap: var(--space);
}

footer h3 {
    color: #b4b8bb;
}

footer a,
footer a:visited,
footer a:active,
footer a:hover {
    color: #b4b8bb;
}

h2, h3, h4 {
    margin-bottom: calc(var(--space) / 2);
}

h3 {
    color: var(--footercolor);
}

.info {
    display: inline-block;
    background: cornsilk;
    padding: calc(var(--space) / 2) var(--space);
    width: auto;
}

.logo {
    display: flex;
    align-items: center;
    height: var(--navbarheight);
    z-index: 7;
}

.auth {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    background: var(--navbaritemcolor);
    padding: calc(var(--space) / 2) var(--space);
    gap: calc(var(--space) / 2);
}

.breadcrumbs {
    flex-direction: row;
    align-items: center;
    background: #e0e4e4;
    padding: calc(var(--space) / 2) var(--space);
    gap: calc(var(--space) / 2);
    max-width: var(--containerwidth);
}

.auth > span,
.auth > strong,
.auth > form {
    white-space: nowrap;
    display: inline-block;
}

#name,
#password {
    margin-right: calc(var(--space) / 2);
}

select {
    padding: calc(var(--space) / 2);
    padding-right: calc(var(--space) * 2 + var(--space) / 2); /* Adding extra 20px padding */

    /* Remove default appearance */
    -webkit-appearance: none;
    -moz-appearance: none;
    -ms-appearance: none;
    appearance: none;

    border: 1px solid black;
    background-color: white;
    box-sizing: border-box;
    background-image: url('/static/img/select_arrow.svg');
    background-repeat: no-repeat;;
    background-position: right 10px center;
    background-size: 14px 18px;
}

/* Paginator */

page > a {
    padding: 5px 10px
}

page > a:hover {
    background: cornsilk;
    color: var(--navbarcolor);
    transition: all var(--speed) ease-out;
}

.currentpage {
    background: burlywood;
    padding: 5px 10px
}

/* Toolbar styles */

toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: calc(var(--space) / 2);
    margin: calc(var(--space) / 2) var(--space);
    font-size: 90%;
}

toolbar > div {
    white-space: nowrap;
    display: inline-block;
}

/* Form styles */

.formline {
    display: flex;
    margin: calc(var(--space) / 2) 0;
    align-items: center;
    flex-wrap: wrap;
}

.formline > label {
    min-width: 300px;
}

.formline > input,
.formline > button {
    padding: calc(var(--space) / 2);
}

.formline > button[type='reset'] {
    background-color: #ffcc7f;
}

.formline > message {
    width: 100%;
    color: red;
}

.formline > input[type='checkbox'] {
    /* Double-sized Checkboxes */
    -ms-transform: scale(2);
    /* IE */
    -moz-transform: scale(2);
    /* FF */
    -webkit-transform: scale(2);
    /* Safari and Chrome */
    -o-transform: scale(2);
    /* Opera */
    transform: scale(2);
    margin: calc(var(--space) / 2);
}

/* Table styles */

table {
    margin-top: calc(var(--space)/2);
    text-align: left;
    border-collapse: collapse;
    border: 5px solid var(--bordercolor);
    overflow-x: auto;
    box-sizing: border-box;
}

td:first-child,
th {
    white-space: nowrap;
}

td,
th {
    padding: calc(var(--space) / 2) var(--space);
    border-width: 0;
    font-size: 90%;
}

tr > .icons:not(:first-of-type) > a {
    padding: 0 calc(var(--space) / 2) 0 0;
}

th {
    background: var(--thcolor);
    text-align: left;
}

tr:nth-child(odd) td {
    background: var(--oddrowcolor);
}

tr:nth-child(even) td {
    background: var(--evenrowcolor);
}

td:not(:first-of-type),
th:not(:first-of-type) {
    border-left: 1px solid var(--bordercolor);
}

td:first-of-type,
th:first-of-type {
    width: 1%;
}

/* Stylizing the menu */

.menu {
    display: flex;
    list-style-type: none;
    background: var(--navbarcolor);
    white-space: nowrap;
    margin: 0;
    padding: 0;
}

.menu > li > a {
    padding: 0 var(--space);
    color: var(--navbaritemcolor);
    display: flex;
    align-items: center;
}

.menu > li > a:hover {
    background: var(--lightestcolor);
    color: var(--navbarcolor);
    transition: all var(--speed) ease-out;
}

.submenu {
    display: flex;
    flex-direction: row;
    /*margin: 0 var(--space);*/
    background: var(--lightestcolor);
    max-width: var(--containerwidth);
    width: 100%;
    justify-content: center;
    border-top: 1px solid var(--bordercolor);
}

.submenu > a {
    white-space: nowrap;
    background-color: var(--navbarcolor);
    padding: calc(var(--space) / 2) var(--space);
    color: white;
    transition: all var(--speed) ease-out;
}

.submenu > a:not([href]) {
    background-color: var(--navbaritemcolor);
    color: black;
}

.submenu > a:hover[href] {
    background-color: var(--navbaritemcolor);
    color: black;
}

details {
    cursor: pointer;
}

summary {
    text-wrap: nowrap;
}

.form_separator {
    margin: var(--space) 0 calc(var(--space) / 2) 0;
    background-color: #3c4856;
    padding: 0;
    height: 1px;
    border: 0;
    width: 100%;
}

/* Settings only for the desktop layout */

@media (min-width: 1025px) and (orientation: landscape) {
    header {
        padding: 0 var(--space);
    }

    /* Stylizing the menu */
    .menu {
        justify-content: flex-end;
    }

    .menu > li > a {
        height: var(--navbarheight);
    }

    /* Stylizing the selected menu item */
    .menu > li > a.selected {
        background: var(--navbaritemcolor);
        color: var(--navbarcolor);
    }

    /* Hiding the burger */
    #burger,
    #burger + label {
        display: none;
    }

    /* Form */
    .formline > input[type='text'],
    .formline > textarea,
    .formline > input[type='email'],
    .formline > input[type='date'],
    .formline > input[type='number'] {
        min-width: 55%;
    }

    .formline > textarea {
        min-height: 100px;
    }
}

@media (max-width: 1024px) or (orientation: portrait) {
    .logo {
        width: 100%;
        justify-content: right;
        position: absolute;
        top: 0;
        align-items: center;
        padding: 0 var(--space);
    }

    /* Showing the burger */
    #burger,
    #burger + label {
        position: absolute;
        display: flex;
        align-items: center;
        height: var(--navbarheight);
        top: 0;
        width: 20%;
        font-size: 30px;
    }

    /* Stylizing the burger */
    #burger {
        opacity: 0;
        z-index: 9;
        cursor: pointer;
    }

    #burger + label > img,
    #burger + label > span {
        position: absolute;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        box-shadow: inset 0 0 0 20px rgba(0, 0, 0, 0.1), 0 0 0 10px rgba(0, 0, 0, 0.1);
        color: var(--navbaritemcolor);
        transition: var(--speed);
        z-index: 2;
        left: var(--space);
    }

    #burger:not(:checked) + label > img {
        opacity: 0;
        transform: scale(0.01, 0.01);
    }

    #burger:checked + label > img {
        transition-delay: var(--speed);
    }

    #burger:checked + label > span {
        opacity: 0;
        box-shadow: inset 0 0 0 20px rgba(0, 0, 0, 0.1), 0 0 20px 360px rgba(0, 0, 0, 0.1);
    }

    /* Stylizing the menu */
    .menu {
        align-items: baseline;
        justify-content: flex-start;
        flex-direction: column;
        width: 100%;
        transition: var(--speed);
        z-index: 5;
    }

    #burger:checked ~ .menu {
        /*height: calc(var(--mobilemenuitemheight) * 5);*/
        margin-top: var(--navbarheight);
        box-shadow: 0 240px 90px 120px rgba(0, 0, 0, 0.8);
    }

    #burger:not(:checked) ~ .menu {
        height: var(--navbarheight);
        padding: 35px 0 0 calc(var(--space) + 5px);
        opacity: 0;
    }

    .menu > li > a,
    .menu > li {
        height: var(--mobilemenuitemheight);
        width: 100%;
        transition: var(--speed);
    }

    #burger:not(:checked) ~ .menu > li > a,
    #burger:not(:checked) ~ .menu > li {
        padding: 5px 0;
        height: 5px;
        width: calc(var(--space) + 2px);
    }

    #burger:not(:checked) ~ .menu > li > a {
        font-size: 5px;
    }

    /* Form */
    .formline > input[type='text'],
    .formline > textarea,
    .formline > input[type='email'],
    .formline > input[type='date'],
    .formline > input[type='number'],
    .formline > button,
    .formline > select {
        min-width: 100%;
    }

    .formline > textarea {
        min-height: 100px;
    }

    main > iframe,
    main > div,
    main > table {
        margin: 0;
        border-left: none;
        border-right: none;
    }

    .submenu {
        flex-direction: column;
    }
}
