:root {
    font-size: 18px;
}

@media (max-width: 1400px), (max-height: 900px) {
    :root {
        font-size: 14px;
    }
}

* {
    box-sizing: border-box;
    font-family: var(--main-font);
}

a {
    text-decoration: none;
    color: #000;
    animation: all 0.3s;
}

a:hover {
    text-decoration: underline;
    font-weight: bold;
}

a:visited {
    color: inherit;
}

body {
    margin: 0;
    padding: 0;
    width: 100svw;
    height: 100svh;
    overflow: hidden;
}

.outer-container {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    height: 100vh; /* changed from 100% to 100vh to ensure full viewport height */
}

.col {
    flex-direction: column;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.language-switcher img {
    width: 2rem;
}

main {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

main nav {
    display: flex;
    flex-direction: column;
    width: fit-content;
    min-width: 18%;
    box-shadow: 5px 5px 5px 2px rgba(0, 94, 184, .2);
    border-radius: 15px;
    justify-content: space-between;
    padding: 1rem;
    height: fit-content;
    gap: 2rem;
    background-color: rgba(255, 255, 255, 0.8);
}

@media (max-width: 1400px), (max-height: 900px) {
    main nav {
        min-width: 15%;
        padding: 0.5rem;
        gap: 1rem;
    }
}

main nav li {
    margin: 0.5rem 0;
}

main nav li a {
    text-decoration: none;
}

.content-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1; /* Allow growing to fill space */
    min-height: 0; /* Important for scroll to work inside flex item */
    overflow: auto;
    padding-right: 0.5rem;
}

nav ul {
    list-style: none;
    padding: 0;
}

.language-switcher {
    display: flex;
    padding: 0;
    gap: 0.5rem;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.file-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.info-form-group {
    display: flex;
    gap: 0.5rem;
    flex-direction: column;
}

.hide {
    display: none !important;
}

.invisible {
    opacity: 0;
    pointer-events: none;
}

.layout {
    position: fixed;
    top: 0;
    left: 0;
    width: 100svw;
    height: 100svh;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.layout>div {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    width: fit-content;
    max-width: 600px;
    max-height: 90%;
    overflow-y: auto;
}

button,
input[type="submit"] {
    border: none;
    border-radius: 15px;
    box-sizing: border-box;
    box-shadow: 5px 5px 5px 2px rgba(0, 94, 184, .2), inset 0 0 0 0 rgba(0, 0, 0, .2);
    cursor: pointer;
    padding: 0.5em 1em;
    width: fit-content;
    transition: box-shadow ease 0.5s, transform ease 0.1s;
    background-color: rgba(255, 255, 255, 0.8);
}

button:hover,
input[type="submit"]:hover {
    box-shadow: 0 0 0 0 rgba(0, 0, 0, .2), inset 5px 5px 5px 2px rgba(0, 94, 184, .2);
}

button:active,
input[type="submit"]:active {
    transform: scale(0.95);
}


/* Scrollbar: */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    box-shadow: inset 0 0 5px grey;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(26, 20, 20, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(26, 20, 20, 0.75);
}

::-webkit-scrollbar-thumb:horizontal {
    background: rgba(26, 20, 20, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:horizontal:hover {
    background: rgba(26, 20, 20, 0.5);
}

/* Loader spinner: */
.loader {
    position: absolute;
    top: 30%;
    margin: 0 auto;
    width: 48px;
    height: 48px;
    border: 5px solid #000;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.btns {
    margin: 1rem 0;
}

table {
    width: 100%;
}

td {
    text-align: center;
    align-items: center;
}

.reference-content img {
    max-width: 90vw;
    max-height: 90vh;
    border: 5px solid white;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.reference-viewer {
    padding: 0 !important;
    overflow: hidden !important;
}

.reference-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pointer {
    cursor: pointer;
    text-decoration: underline;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 30px;
    color: rgb(128, 128, 128);
    cursor: pointer;
}

.close-btn:hover {
    color: #2e2e2e;
}

p.error {
    color: red;
    font-weight: bold;
    text-align: center;
    margin: 0 auto;
}