:root {
    --background: #17171a;
    --foreground: #eee;
    --soft: #26262b;
    --accent: #f60;

    --gap: 5px;
    --radius: 5px;
    --input-padding: .5em 1em;
    --base-font-size: 16px;
}

* {
    color: var(--foreground);
    font-family: sans-serif;
    font-size: var(--base-font-size);
    line-height: 1.5;
}

body {
    background: var(--background);
    display: flex;
    flex-direction: column;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100dvh;
    width: 100dvw;
}

.fit-height {
    max-height: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

.page {
    padding: 10px;
}

.notification {
    margin: 10px auto;
    padding: 5px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--accent);
    width: max-content;
    color: var(--accent);
}

form {
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    border-radius: var(--radius);
    background: var(--soft);
}

label {
    margin-bottom: -10px;
}

button, input {
    background: var(--background);
    color: var(--foreground);
    padding: var(--input-padding);
    border-radius: var(--radius);
    border: 1px solid var(--soft);
}

button {
    cursor: pointer;
}

.flex {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.flex-v {
    display: flex;
    gap: 5px;
    flex-direction: column;
}

.space-between {
    justify-content: space-between;
}

.menu {
    padding: 15px;
    border: 1px solid var(--soft);
    border-radius: var(--radius);
    display: flex;
    flex-direction: row-reverse;
    flex-wrap: wrap;
}

.fake-container {
    padding: 15px;
    border-radius: var(--radius);
    border: 1px solid var(--soft);
    height: 100%;
    width: 100%;
    background: var(--soft);
    box-sizing: border-box;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, min(300px, 100%));
    grid-row-gap: 15px;
    grid-column-gap: 15px;
    padding: 15px;
    border-radius: var(--radius);
    border: 1px solid var(--soft);
    max-height: 100%;
    height: 100%;
    overflow: auto;
    background: var(--soft);
}

.gridContainer {
    border: 1px solid var(--foreground);
    border-radius: var(--radius);
    display: flex;
    background: var(--background);
    position: relative;
}

.gridContainer:hover {
    background: rgba(0, 0, 0, .1);
    border: 1px solid var(--foreground);
    box-shadow: inset 0 0 10px 0 black;
}

.gridImageContainer {
    display: flex;
    background: transparent;
    margin: auto 0;
    width: 100%;
    height: 150px;
    overflow: hidden;
    border-radius: var(--radius);
}

.gridImage {
    object-fit: contain;
    object-position: center;
    width: auto;
    height: auto;
    margin: 0 auto;
}

.flex-fill {
    flex: 1;
}

.disabled {
    opacity: .5;
    pointer-events: none;
    cursor: not-allowed;
}

.pages, .controls {
    display: flex;
    gap: 5px;
    align-items: center;
}

.page-input {
    background: var(--soft);
    width: 4em;
    border: 1px solid var(--foreground);
    color: var(--foreground);
}

.gridImageLabel {
    position: absolute;
    background: rgba(0, 0, 0, .6);
    color: var(--foreground);
    font-size: 12px;
    bottom: 0;
    left: 0;
    padding: 4px 8px;
    border-radius: var(--radius);
}

.modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100dvw;
    height: 100dvh;
    background: rgba(0, 0, 0, .9);
    overflow: hidden;
    display: flex;
}

.modal img {
    object-fit: contain;
    width: 95%;
    height: 95%;
    margin: auto;
}

.page {
    padding: 10px;
}

.spinner-container {
    margin: auto;
}

.spinner {
    --spinner-size: 1em;
    --translation-size: calc(var(--spinner-size) / 2 - var(--spinner-size) / 10);
    height: var(--spinner-size);
    width: var(--spinner-size);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.spinner > div {
    box-sizing: border-box;
    position: absolute;
    width: 20%; /*This size will affect the distance of the dots from the center.*/
    height: 20%; /*Should be the same as the width.*/
    border-radius: 50%;
    background-color: var(--foreground);
    animation: spinning-circle 1.4s linear infinite;
}

@keyframes spinning-circle {
    0% {
        transform: rotate(0deg) translate(var(--translation-size)) rotate(0deg) scale(0.5);
    }
    50% {
        transform: rotate(240deg) translate(var(--translation-size)) rotate(-240deg) scale(1);
    }
    100% {
        transform: rotate(360deg) translate(var(--translation-size)) rotate(-360deg) scale(0.5);
    }
}

.spinner > div::after {
    content: "";
    display: block;
    margin: 0 auto;
    width: 15%;
    height: 15%;
    background-color: var(--foreground);
    border-radius: 100%;
}

.align-content {
    align-items: center;
}

.stats-panel {
    padding: 1rem 2rem;
    border-top: 1px solid var(--soft);
}

.stats-panel h2 {
    margin: 0 0 1rem;
    font-size: 1.2rem;
    color: var(--accent);
}

.stats-section {
    margin-bottom: 2rem;
}

.stats-section h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    opacity: 0.7;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 120px;
    overflow-x: auto;
    padding-bottom: 1.2rem;
    position: relative;
}

.bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    width: 28px;
    height: 100%;
}

.bar-fill {
    width: 100%;
    background: var(--accent);
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: height 0.3s;
}

.bar-label {
    font-size: 0.6rem;
    opacity: 0.6;
    margin-top: 2px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.bar-chart--bins .bar-col {
    width: 40px;
}

.bar-chart--bins .bar-label {
    transform: rotate(-45deg);
    transform-origin: top center;
    margin-top: 4px;
}
