*:not(dialog) {
    padding: 0;
    margin: 0;
}

html {
    font-family: 'Lato', sans-serif;
    font-size: 1.5rem;
}

body *:not(script, style, table, thead, tbody, tr, th, td) {
    display: flex;
}

body {
    background-image: url(/assets/image/background.webp);
    background-position: bottom center;
    background-attachment: fixed;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header {
    margin-top: 1rem;
    flex-direction: column;
    align-items: center;
}

header h1 {
    color: #737373;
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
    text-align: center;
    max-width: 90vw;
}

.hidden_toggle {
    display: none;
}

p {
    overflow-wrap: anywhere;
    text-align: center;
    padding: 0.25rem;
    margin-bottom: 1rem;
}

p.message_success {
    color: #00b400;
}

p.message_error {
    color: #df0000;
}

header img {
    height: 80px;
    width: 134px;
}

header p {
    color: #737373;
}

main {
    flex-direction: column;
    align-items: center;
}

main img {
    width: 80%;
    max-width: 200px;
    height: auto;
    border-radius: 0.5rem;
}

section.background {
    background-color: rgba(255, 163, 47, .7);
    border-radius: 20px;
}

section.row {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
}

section.column {
    flex-direction: column;
    align-items: center;
    flex-wrap: wrap;
}

section.padding {
    padding: 0.4rem;
}

section.padding_horizontal {
    padding: 0 1rem 0 1rem;
}

section.margin {
    margin: 0.5rem;
}

section.icon {
    background-color: rgba(255, 163, 47, .7);
    height: auto;
    border-radius: 20px;
    padding: 1rem;
    margin: 0.8rem;
    opacity: 1;
    transition: 0.2s;
    text-align: center;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    max-width: 10rem;
}

section.icon img {
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    width: 200px;
    height: 200px;
}

section.icon:hover {
    opacity: 0.8;
}

label {
    color: black;
    font-size: 1rem;
    text-align: left;
}

a {
    text-decoration: none;
}

button, a:not(:has(img)) {
    max-width: 100%;
    font-size: 1rem;
    margin: 0.3rem;
    padding: .5rem 1rem;
    flex-direction: column;
    align-items: center;
    transition: 0.2s;
    cursor: pointer;
    inline-size: max-content;
    overflow-wrap: break-word;
    background-color: #f0f0f0;
    border: 2px solid black;
    border-radius: 15px;
    color: black;
    font-family: 'Lato', sans-serif;
    font-style: normal;
    font-weight: 400;
}

button:active, a:active {
    transform: scale(0.8);
}

button:hover, a:hover {
    opacity: 0.8;
}

button.record_delete_button {
    background-color: red;
    margin-top: 3rem;
}

button.record_save_button {
    background-color: green;
    color: white;
}

form {
    flex-direction: column;
    align-items: center;
}

input {
    color: black;
    background-color: white;
    font-size: 1rem;
    border-radius: 6px;
    padding: 0.3rem;
    border: solid 1px #9B9B9B;
    margin: 0.5rem 0.5rem 1rem;
}

input[type="file"] {
    max-width: 80vw;
}

input:disabled {
    opacity: 0.7;
}

select {
    font-size: 0.83rem;
    padding: 0.4rem;
    border: solid 1px #9B9B9B;
    margin: 0.5rem 0.5rem 1rem;
    color: black;
    background-color: white;
    border-radius: 0;
    font-family: 'Lato', sans-serif;
    font-style: normal;
    font-weight: 400;
}

textarea {
    color: black;
    resize: vertical;
    max-width: 100%;
    font-size: 0.8rem;
    padding: 5px;
    margin-top: 5px;
    margin-bottom: 5px;
}

input[type="checkbox"] {
    transform: scale(1.7);
    cursor: pointer;
    flex-grow: 0;
    margin: auto;
}

input#remember_me {
    margin: 0 0.5rem;
}

input[type=radio] {
    transform: scale(1.7);
}

input:focus,
select:focus {
    outline: solid 2px #939393;
    box-shadow: 0 0 3px #939393;
}

table {
    margin-bottom: 1rem;
    border-spacing: 0;
    table-layout: fixed;
    max-width: 90vw;
    max-height: 60vh;
    overflow-y: scroll;
    display: block;
}

table tbody tr:hover,
table tbody tr:nth-child(even):hover {
    background-color: rgba(255, 215, 150, 0.2);
}

table tbody tr:nth-child(even):not(.active) {
    background-color: rgba(255, 163, 47, .7);
}

tbody tr.active {
    background-color: rgba(255, 215, 150, 0.2);
}

th {
    border: 1px solid #737373;
    padding: 0.5rem 1rem;
    text-align: left;
    background-color: rgba(255, 215, 150, .7);
    color: black;
    position: sticky;
    top: 0;
}

td {
    border: 1px solid #737373;
    padding: 0 0.2rem;
    text-align: center;
}

tr {
    text-align: center;
}

[data-sort] {
    cursor: pointer;
}

[data-sort]::after {
    content: ' ↕';
}

[data-order='asc']::after {
    content: ' ↑';
}

[data-order='desc']::after {
    content: ' ↓';
}

@media (max-width: 1500px) {
    table {
        width: 100%;
        border: none;
    }

    th {
        display: block;
        padding: 0.3em 0.6em;
        margin-bottom: 0.5rem;
        text-align: center;
        font-size: 0.8em;
    }

    tr {
        margin-bottom: 0.5rem;
        display: block;
        border-radius: 8px;
        overflow: hidden;
        width: 90vw;
    }

    td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5em;
        border-bottom: 1px solid #e0e0e0;
    }

    td:last-child {
        border-bottom: none;
    }

    td:before {
        content: attr(data-label);
        flex: 1;
        font-weight: bold;
        margin-right: 1em;
        color: #333;
    }
}


textarea#comment {
    width: 15rem;
}

dialog {
    animation: fade-out 0.7s ease-out;
}

dialog:open {
    animation: fade-in 0.7s ease-out;
}

dialog:open::backdrop {
    animation: backdrop-fade-in 0.7s ease-out forwards;
}

/* 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 / 20%);
    }
}