:root {
    --bg: #262027;
    --fg: #f3f3f3;
    --bg1: #362e38;
    --fg1: #ececec;
    --bg2: #423a44;
    --fg2: #a1a1a1;
    --bg3: #4a414c;

    --accent: #e366a4;
    --button: #e25c92;
    --button-hover: #e14ba7;
    --highlight: #693c50;

    --white: #fff;
    --gray: #666;
    --blue: #4c84c4;
    --green: #3f8e3a;
    --green-darker: #368031;
    --red: #c54c4c;
    --red-darker: #b93838;
    --orange: #c68549;
    --yellow: #d8bb19;
    --yellow-darker: #c5ab18;
}

body {
    font-size: 14px;
    font-family: Montserrat, Helvetica, sans-serif;
    background-color: var(--bg);
    color: var(--fg);
    margin: 0;
}

.rotate {
    animation: spinner 1.5s linear infinite; 
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* Header */

header {
    background-color: var(--bg1);
}

header .wrapper {
    padding: 0.25em;
    margin: 0 auto;
    max-width: 1000px;

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

header .logo {
    font-size: 1.5em;
    display: flex;
    align-items: center;
}

header .logo>img {
    height: 1em;
    vertical-align: middle;
}

header .logo>span {
    text-decoration: none;
}

header nav {
    display: flex;
    align-items: center;
    overflow-x: auto;
}

header nav a {
    padding: 5px;
}

/* Boxes */

.boxes {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
}

.boxes .box {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-wrap: nowrap;
    justify-content: center;

    border: 1px solid var(--bg3);
    border-radius: 0.75em;
    transition: box-shadow, border-color 0.2s ease-in-out;

    background-color: var(--bg2);
    margin: .5em;
    padding: 1.2em;
}

.box:hover {
    color: var(--fg1);
    border-color: var(--accent);
    box-shadow: var(--button-hover) 0 0 5px;
}

.box .icon {
    font-size: 5em;
}

.box .title {
    text-align: center;
}

.box .description {
    text-align: center;;
    font-size: 0.8em;
    color: var(--fg2);
}   

/* Tags */

.tags {
    overflow-x: clip;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.tags>* {
    margin: 4px 2px;
    padding: 2px 4px;
    border-radius: 5px;
    background-color: var(--bg2);
    border: 1px solid transparent;
}

.tags .tag {
    display: flex;
    align-items: center;
}

.tags span {
    text-wrap: nowrap;
}

.tags a.tag:hover {
    background-color: var(--bg3);
    color: inherit;
}

.tags img {
    width: 1.2em;
    height: 1.2em;
    margin-right: 3px;
}

.tags .material-symbols-rounded {
    font-size: 22px;
}

.tags .small {
    font-size: 16px;
    color: var(--fg2);
    padding: 3px;
}

.tags.faded a, .tags a.faded, .tags.faded select, .tags.faded input, .tags input.faded {
    background-color: var(--bg);
    border: 1px solid var(--bg2);
    color: var(--fg2);
}

/* Links */

a {
    color: var(--fg);
    transition: color 0.1s ease-in-out;
    text-decoration: none;
}

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

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

/* Content */

main {
    position: relative;
}

.main-content {
    padding: 0 1em;
    margin: 0 auto;
    max-width: 1000px;
}

.main-background {
    background: center / cover no-repeat url("/media/thumbnail");
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120%;
    z-index: -1;
    filter: blur(5px) opacity(0.15) brightness(0.6);
}

section {
    margin: 0 0 2em 0;
}

.title-container {
    padding: 1em 0 1em 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

section .title {
    font-size: 2em;
}

section .title.blur:not(:hover) {
    filter: blur(3px);
}

section .title-container>.about {
    font-size: 0.75em;
    color: var(--fg2);
}

section > .description {
    color: var(--fg2);
    padding: 0.2em;
}  

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

.thumbnail {
    display: block;
    min-width: 50px;
    width: 50px;
    height: 50px;
    border-radius: 5px;
    overflow: hidden;
}

.thumbnail.blur img:not(:hover) {
    filter: blur(4px);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.2s;
}

/* Tooltips */

.tooltip {
    position: relative;
}

.tooltip:before {
    content: attr(data-tooltip);
    position: absolute;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;

    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;

    width: max-content;
    max-width: 300px;
    padding: 0.4em;
    margin-bottom: 10px;
    font-family: sans-serif;
    font-size: 16px;
    text-align: center;
    border-radius: 4px;
    background: var(--bg1);
    color: var(--fg1);

    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.tooltip-bottom:before {
    top: 100%;
    bottom: auto;
}

.tooltip:hover:before {
    opacity: 1;
    visibility: visible;
    transition-delay: 0.4s;
}

/* Text colors */

.white-text {
    color: var(--white);
}

.gray-text {
    color: var(--gray);
}

.blue-text {
    color: var(--blue);
}

.green-text {
    color: var(--green);
}

.red-text {
    color: var(--red);
}

.orange-text {
    color: var(--orange);
}

/* Table */

table {
    width: 100%;
}

table th {
    font-weight: normal;
    padding: 3px;
    background-color: var(--bg2);
    color: var(--fg1);
}

table td {
    padding: 4px;
}

table tr:hover {
    box-shadow: var(--bg1) -2px 0;
}

/* Other */

.flash {
    margin: 10px 0;
    padding: 5px 10px;
    background-color: var(--bg1);
    color: var(--fg);

    display: flex;
    align-items: center;
}

.flash .message {
    margin-left: 5px;
    padding-top: 1px;
}

/* Buttons */

.buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.buttons>*, .button {
    margin: 5px 3px;
    padding: 0.6em 1em;
    border-radius: 4px;
    color: var(--fg);
    border: none;
    cursor: pointer;
    background-color: var(--button);
    transition: background-color 0.1s ease-in-out;
}

.buttons>*.red {
    background-color: var(--red);
}

.buttons>*.red:hover {
    background-color: var(--red-darker);
}

.buttons>*:hover, .button:hover {
    background-color: var(--button-hover);
    color: var(--fg);
}

.button.gray {
    background-color: var(--bg1);
    color: var(--fg1);
}

.button.green {
    background-color: var(--green);
}

.button.green:hover {
    background-color: var(--green-darker);
}

.button.yellow {
    background-color: var(--yellow);
}

.button.yellow:hover {
    background-color: var(--yellow-darker);
}

/* For things with icons */

.icons {
    display: flex;
    align-items: center;
}

.icons>* {
    padding: 0 2px;
    background-color: var(--bg2);
}

.icons>*:first-child {
    border-radius: 5px 0 0 5px;
}

.icons>*:last-child {
    border-radius: 0 5px 5px 0;
}

.icon {
    display: flex;
    align-items: center;
}

.icon .material-symbols-rounded {
    font-size: 1rem;
    margin-right: 3px;
}

/* Form */

.login-form {
    display: flex;
    align-items: center;
    flex-direction: column;
}

.login-form input[type=text], .login-form input[type=password] {
    min-width: 15em;
}

.reset-password-link {
    margin: 0.5em;
    font-size: 0.9em;
    color: var(--fg2);
}

.login-form label {
    background-color: var(--bg1);
    color: var(--fg1);
    border-radius: 4px;
    margin: 0.1em;
    padding: 0.4em 0.5em;
    min-width: 15em;
}

input, select, textarea, button {
    background-color: var(--bg1);
    color: var(--fg1);
    border-radius: 4px;
    border: none;
    margin: 0.1em;
    padding: 0.4em 0.5em;
    appearance: textfield;
    font-size: 14px;
}

textarea {
    box-sizing: border-box;
    width: 20em;
    height: 5em;
}

input[type=submit], button {
    background-color: var(--button);
    border-radius: 4px;
    padding: 0.6em 1em;
}

input[type=submit]:hover, button:hover {
    background-color: var(--button-hover);
    cursor: pointer;
}

.form-description {
    font-size: 0.75em;
    color: var(--fg2);
}

input.wide {
    width: 20em;
}

/* Stars */

.stars {
    padding: 0 0.5em;
    color: var(--fg2);
    display: flex;
}

.stars :hover {
    color: var(--fg);
    cursor: pointer;
}

.stars .active {
    color: var(--accent);
}

.stars a.active {
    color: var(--accent);
}

/* Mobile */


@media screen and (max-width: 700px) {
    
    #qrcode-button {
        display: none;
    }

    main {
        padding: 0 0.2em;
    }

    section .tags {
        flex-direction: column;
    }

    .tags .small {
        font-size: 20px;
    }

    .mobile-hide {
        display: none;
    }

    .boxes .box {
        flex-grow: 1;
        min-width: 20%;
        max-width: 40%;
        margin: 0.2em;
        padding: 0.4em;
    }

    .box .title {
        font-size: 1.2em;
    }
}

@media screen and (max-width: 400px) {
    textarea, input, input.wide {
        width: auto;
        max-width: 100%;
    }
}