:root {
    --border-radius: 8px;
    --body-background: white;
    --text-color: black;
    --alert-color: #eee;
    --tab-group-color: #efefef;
    --tab-group-active: lightgray;
    --input-border: #888;
    --icon-size: 24px;
}

html.dark {
    --body-background: #1c1c1c;
    --text-color: white;
    --alert-color: #333;
    --tab-group-color: #333;
    --tab-group-active: #444;
    --input-border: #666;
}

body {
    margin: 0;
    padding: 1.25em;
    font-family: Roboto, Arial;
    background-color: var(--body-background);
    color: var(--text-color);
}

.hidden {
    display: none !important;
}

input, textarea {
    font-family: inherit;
    font-size: 1em;
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius);
    background-color: var(--body-background);
    color: var(--text-color);
    padding: 0.5em;
    outline: none;
}

.icon {
    cursor: pointer;
    transition: filter ease-in-out 250ms;
    fill: currentColor;
    height: var(--icon-size);
    width: var(--icon-size);
}

/* NAV HEADER */

nav {
    margin: -1.25em -1.25em 1.25em -1.25em;
    padding: 0 1rem;
    height: calc(var(--icon-size) + 2rem);
    background-color: #145014;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav .logo-container {
    position: absolute;
    top: 0.5rem;
    left: 1rem;
}

nav .logo {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-right: 0.25rem;
    user-select: none;
}

nav a:not([href=""]) + .logo-container {
    left: calc(2rem + var(--icon-size));
}

nav .logo img {
    height: calc(var(--icon-size) + 1rem);
    width: calc(var(--icon-size) + 1rem);
    border-radius: 50%;
    box-shadow: 2px 2px 4px 1px rgba(0, 0, 0, 0.3);
}

nav .logo span {
    font-size: 1rem;
}

nav a {
    color: white;
    text-decoration: none;
}

nav .icon {
    color: white;
}

nav .links {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.25rem;
    user-select: none;
}

nav .links a {
    transition: filter ease-in-out 250ms;
}

nav .links .current {
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
}

nav .links a:hover,
nav .icon:hover {
    filter: brightness(80%);
}

nav .buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
}

nav .buttons a {
    height: var(--icon-size);
}

nav a[href=""],
nav .icon.placeholder {
    visibility: hidden;
    cursor: default;
}

@media screen and (max-width: 525px) {
    nav .logo {
        display: none;
    }
}

/* BUTTONS */

button {
    border: 0;
    padding: 0.5em 1em;
    font-family: inherit;
    font-size: 1em;
    border-radius: var(--border-radius);
    cursor: pointer;
    margin: 0;
    transition: filter ease-in-out 250ms;
    background-color: #efefef;
    color: black;
    user-select: none;
    display: inline-flex;
    gap: 0.25em;
    align-items: center;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button:not(:disabled):hover {
    filter: brightness(90%);
}

button.green {
    background-color: #145014;
    color: white;
}

button.green:not(:disabled):hover {
    filter: brightness(120%);
}

html.dark button.green:not(:disabled):hover {
    filter: brightness(90%);
}

button.red {
    background-color: red;
    color: white;
}

button.yellow {
    background-color: #ffc107;
    color: black;
}

button.dark {
    background-color: #333;
    color: white;
}

button.dark:not(:disabled):hover {
    filter: brightness(140%);
}

/* ALERTS */

.alert {
    position: fixed;
    margin: auto;
    top: 1em;
    left: 50%;
    border-radius: var(--border-radius);
    padding: 0.5em 1em;
    max-width: 90%;
    background-color: var(--alert-color);
    transform: translate(-50%, calc(-100% - 1em));
    transition: transform 250ms ease-in-out;
    text-align: center;
    z-index: 200;
}

.alert.show {
    transform: translate(-50%, 0);
}

/* MODAL */

.modal {
    padding: 1em;
    border: 0;
    border-radius: var(--border-radius);
    min-width: 250px;
    max-width: calc(100% - 100px);
    background-color: var(--body-background);
    color: var(--text-color);
}

.modal > * {
    margin: 0.5em 0;
}

.modal::backdrop {
    background-color: rgba(0, 0, 0, 0.4);
}

html.dark .modal::backdrop {
    background-color: rgba(0, 0, 0, 0.7);
}

.modal.red {
    background-color: red;
    color: white;
}

#account-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -1rem -1rem 0 -1rem;
    padding: 0.75rem 1rem;
    font-size: 1.25rem;
    background-color: var(--tab-group-color);
    color: var(--text-color);
}

#account-modal .icon {
    fill: var(--text-color);
}

#account-modal img {
    height: 100%;
    aspect-ratio: 172 / 228;
    overflow: initial;
    border-radius: var(--border-radius);
}

#account-modal a {
    display: inline-flex;
    width: 100%;
    background-color: #145014;
    color: white;
    justify-content: center;
    padding: 0.5em 1em;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: filter ease-in-out 250ms;
    user-select: none;
    box-sizing: border-box;
}

#account-modal .account-container {
    height: 80px;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin: 1rem 0;
}

#account-modal .account-container .email {
    font-size: 0.75em;
    color: #888;
}