/* GENERAL */

:root {
    --bg-color: white;
    --text-color: #444;
    --link-color: #2a378b;
    --link-visited: #aeb7ec;
    --link-hover: #ce2427;
    --nav-bg-start: #fff;
    --nav-bg-end: #ddd;
    --nav-shadow: rgba(0, 0, 0, .2);
    --nav-text: #444;
    --nav-hover-bg-start: #444;
    --nav-hover-bg-end: #44444488;
    --nav-hover-text: white;
    --table-stripe: #eee;
    --table-text: #444;
    --table-border: #ddd;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --link-color: #7b86d9;
    --link-visited: #5d66a6;
    --link-hover: #ff4045;
    --nav-bg-start: #2a2a2a;
    --nav-bg-end: #1a1a1a;
    --nav-shadow: rgba(0, 0, 0, .4);
    --nav-text: #e0e0e0;
    --nav-hover-bg-start: #3a3a3a;
    --nav-hover-bg-end: #3a3a3a88;
    --nav-hover-text: white;
    --table-stripe: #2a2a2a;
    --table-text: #e0e0e0;
    --table-border: #333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a:link {
    text-decoration: none;
    color: var(--link-color);
}

a:visited {
    color: var(--link-visited);
}

a:hover {
    color: var(--link-hover);
}

body {
    font-family: Roboto, sans-serif;
    color: var(--text-color);
    background: var(--bg-color);
    display: flex;
    transition: background-color 0.3s ease, color 0.3s ease;
}

button, a.button {
    background: linear-gradient(to right, #777, #999, #777);
    background-size: 200% auto;
    color: white;
    border: solid 1px #888;
    padding: .5em 1em;
    border-radius: .5em;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    font-size: .8em;
}

button:hover, a.button:hover {
    border-color: white;
    background: linear-gradient(to right, #888, #aaa, #888);
    background-size: 200% auto;
    background-position: 200% 0;
    transition: background-position .3s;
}

input, textarea {
    font-family: inherit;
    padding: .5em 1em;
    border-radius: .5em;
    border-width: 1px;
}

input[type=file] {
    padding: 0;
}

main {
    padding-left: 1rem;
}

p {
    margin-bottom: 1em;
}

/* FORMS */

fieldset {
    border: none;
    margin-bottom: 1em;
}

fieldset legend {
    margin-bottom: 1em;
    font-weight: 100;
}

form {
    margin-bottom: 1em;
}

form div {
    margin-bottom: 1em;
}

form div label {
    display: block;
    font-size: .8em;
    text-transform: uppercase;
    font-weight: 500;
}

form .columns {
    display: flex;
    gap: 1rem;
    margin-bottom: 0;
}

/* HEADERS */

h1 {
    font-weight: 300;
}

h2 {
    font-weight: 300;
    margin-bottom: 1em;
}

h3 {
    font-weight: 100;
    margin-bottom: 1em;
}

h4 {
    font-weight: 200;
    font-size: .8em;
    text-transform: uppercase;
}

/* NAVIGATION */

nav {
    position: fixed;
    z-index: 9;
    top: 0;
    left: 0;
    padding-top: 3em;
    height: 100vh;
    box-shadow: .3em 0 .5em var(--nav-shadow);
    background: linear-gradient(to bottom, var(--nav-bg-start), var(--nav-bg-end));
    transform: translate(calc(-100% + 3rem), 0);
    transition: transform .3s ease-out, background .3s ease;
    flex-shrink: 0;
    user-select: none;
}

nav.active {
    transform: translate(0, 0);
}

nav li {
    list-style: none;
}

nav li a, nav li a:visited, nav li a:link {
    display: block;
    padding: .5em 3em .5em 2em;
    text-decoration: none;
    color: var(--nav-text);
    transition: color .3s ease;
}

nav.active li a:hover, nav.active li.active a {
    background: linear-gradient(to right, var(--nav-hover-bg-start), var(--nav-hover-bg-end));
    color: var(--nav-hover-text);
    transition: none;
}

.nav-toggle {
    position: fixed;
    cursor: pointer;
    z-index: 10;
    top: 0.35em;
    left: 0.35em;
    width: 2.3em;
    height: 2.3em;
    padding: .6em;
    transition: left .3s ease-out;
}

.nav-toggle svg {
    width: 100%;
    height: 100%;
    stroke: var(--link-hover);
    stroke-width: 3;
    display: block;
    transition: all .3s;
}

.nav-toggle svg line {
    transition: all .3s;
}

nav.active + .nav-toggle svg {
    transform: rotate(90deg);
}

nav.active + .nav-toggle svg line:nth-child(1) {
    transform: rotate(45deg) translate(0, calc(100% / 3));
}

nav.active + .nav-toggle svg line:nth-child(2) {
    transform: rotate(-45deg);
}

nav.active + .nav-toggle svg line:nth-child(3) {
    transform: rotate(45deg) translate(0, calc(-100% / 3));
    opacity: 0;
}

/* TABLES */

table {
    margin-bottom: 2em;
    border-collapse: collapse;
    width: 100%;
    color: var(--table-text);
    border: 1px solid var(--table-border);
}

table td, table th {
    padding: .25em .5em;
    text-align: center;
    border: 1px solid var(--table-border);
}

table th {
    background-color: var(--nav-bg-start);
    color: var(--nav-text);
}

table tbody tr:nth-child(odd) {
    background: var(--bg-color);
}

table tbody tr:nth-child(even) {
    background: var(--table-stripe);
}

/* CONTENT AREA */

.content {
    padding: 2rem;
    margin-left: 3rem;
    flex-grow: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

.content > footer {
    color: #aaa;
    font-size: .7em;
    margin: 5rem 0 0 1rem;
    font-weight: 100;
    line-height: 1.3em;
}

.content > footer p {
    margin: 0;
}

.content > footer .version {
    font-size: .9em;
}

.content > header a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.content > header a:hover {
    color: #666;
}

.content > header a:hover h1 {
    animation: shine 1s;
}

.content > header h1 {
    background: linear-gradient(to right, #666, #666 50%, #ccc, #666);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    color: #000;
}

.content > main {
    flex-grow: 1;
}

@keyframes shine {
    to {
        background-position: 200% 0;
    }
}

.content > header img {
    height: 6rem;
    width: auto;
}

/* NOTIFICATIONS */

.notification {
    display: inline-block;
    padding: .5em 1em;
    margin-bottom: 1em;
    color: white;
    border-radius: .5em;
    font-weight: 500;
    box-shadow: .1em .1em .2em rgba(0, 0, 0, .2);
}

.notification.error {
    background: #ce2427;
}

.notification.info {
    background: seagreen;
}

/* MEDIA QUERIES */

@media (min-width: 900px) {
    nav {
        position: static;
        transform: translate(0, 0);
    }
    nav li a:hover, nav li.active a {
        background: linear-gradient(to right, var(--nav-hover-bg-start), var(--nav-hover-bg-end));
        color: var(--nav-hover-text);
        transition: none;
    }
    .content {
        margin-left: 0;
    }
    .nav-toggle {
        display: none;
    }
}

@font-face {
    font-family: 'Roboto';
    src: url('../fonts/roboto-flex.woff2') format('woff2');
}
@font-face {
    font-family: 'Roboto Mono';
    src: url('../fonts/roboto-mono.woff2') format('woff2');
}