* {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* For screens narrower than 600px */
@media (max-width: 600px) {
    html {
        font-size: 14px;
        /* Scales down rem units */
    }
}

html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

body {
    display: flex;
    flex-direction: row;

    margin: 0;
    padding: 0;
    min-height: 100vh;
    width: 100%;
    background-color: rgba(var(--background-color), 1.0);

    font-family: var(--default-font), system-ui;
    color: var(--text-or-stroke-color);
    line-height: 1;
    justify-content: space-between;
}

a {
    color: var(--text-or-stroke-color);
}

a:hover {
    text-decoration-style: dotted;
}

a:-webkit-any-link {
    cursor: pointer;
    color: var(--text-or-stroke-color);
}

header {
    position: fixed;
    top: 0;
    z-index: var(--z-floating);

    display: flex;
    flex-direction: row;
    justify-content: center;

    width: 100%;
    min-height: 3rem;
    margin: 0;
    padding-bottom: .25rem;
    padding-left: 0;

    color: var(--text-or-stroke-color);
    background-color: rgba(var(--background-color), .95);
    transition: top 0.3s var(--ease-style);
    pointer-events: none;
}

header.player {
    background-color: transparent;
}

header.player #navigation {
    display: none;
}

header nav {
    display: flex;
    flex-direction: row;
    align-items: center;
}

nav a {
    display: flex;

    font-size: 1.25rem;
    color: var(--text-or-stroke-color);
    text-decoration: none;
}

input {
    color: unset;
    border: unset;
    background: unset;
}

#title-searchbar {
    position: absolute;
    right: 0;
    top: 0;
    margin-right: .5rem;
    margin-top: .5rem;
}

.searchbar {
    display: flex;
    border: 1px solid var(--optional-rnd-rect-border-color);
    border-radius: calc(var(--optional-radius) * 0.75);
    background-color: var(--secondary-color);
    color: var(--text-or-stroke-color);
    box-shadow: none;
    transition: box-shadow 0.3s var(--ease-style);
}

.searchbar input {
    border: none;
    background: none;
    color: var(--text-or-stroke-color);
    border-radius: calc(var(--optional-radius) * 0.75);
    padding-left: .5rem;
}

.searchbar input::placeholder {
    color: var(--text-or-stroke-color);
}

.searchbar input:focus::placeholder {
    color: transparent;
}

#search-button {
    background: none;
    border: none;
    /* !!! */
    cursor: pointer;
    box-shadow: none;
    border-radius: 0;
}

header nav a:last-of-type {
    display: flex;
    justify-content: flex-end;
}

nav a:hover {
    text-decoration: underline solid var(--text-or-stroke-color);
}


.book-details {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    padding-top: .5rem;
}

h1,
h2,
h3,
h4,
p,
output {
    color: var(--text-or-stroke-color);
    margin: 0;
}

.book-details p {
    display: flex;
    font-size: .9rem;
}

/*Site Title*/
h1 {
    padding-top: .5rem;
    font-size: 1.25rem;
    font-weight: bold;
}

/*Page Title*/
h2 {
    border-bottom: 1px solid var(--border-color);
    font-size: 1.5rem;
}

/*Book Title*/
h3 {
    font-size: 1rem;
}

h4 {
    display: flex;
    font-size: .75rem;
}

.page-content {
    display: flex;
    flex-direction: column;
    width: 100%;
}

main {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding-top: 4rem;
}

.rounded-rectangle {
    display: flex;
    flex-direction: column;
    align-items: center;

    height: 12rem;
    justify-content: flex-end;
    padding: .5rem;
    background-color: var(--secondary-color);

    border-radius: var(--optional-radius);
    box-shadow: var(--custom-drop-shadow);
    text-decoration: none;

    border: 2px solid var(--optional-rnd-rect-border-color);
    transition: transform 0.3s var(--ease-style), box-shadow 0.3s var(--ease-style);
}

.rounded-rectangle:hover {
    transform: scale(1.05);
    box-shadow: var(--custom-drop-shadow-hover);
    transition: transform 0.3s var(--ease-style), box-shadow 0.3s var(--ease-style);
}

.rounded-rectangle img[data-src] {
    filter: blur(0.2em);
    transform: scale(1.1);
}

.rounded-rectangle img {
    filter: blur(0em);
    box-shadow: var(--custom-drop-shadow);

    width: 107px;
    height: 160px;
    object-fit: cover;

    position: relative;
    transition: box-shadow 0.3s var(--ease-style);
}

.rounded-rectangle:active img {
    transform: scale(1.025);
    box-shadow: var(--custom-drop-shadow-hover);
    transition: box-shadow 0.3s var(--ease-style);
}


.marquee-container {
    width: 8rem;
    overflow: hidden;
}

.marquee-text {
    display: inline-block;
    white-space: nowrap;
}

@keyframes scroll-left {
    to {
        transform: translateX(calc(-1 * max(100% - 8rem, 0px)));
    }
}


.marquee-title-info {
    display: none;
}

.truncated-info {
    display: block;
}

.truncated-info span {
    width: 8rem;
}

.rounded-rectangle:hover .truncated-info {
    display: none;
}

.rounded-rectangle:hover .marquee-title-info {
    display: block;
}

.formats-and-percentage {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    border: 0;
    border-top: 1px solid var(--border-color);
    width: 100%;
}

#title-formats {
    display: inline-flex;
}

#toggle-sidebar {
    display: flex;
    position: fixed;
    left: 0rem;
    align-items: center;
    min-height: 2rem;
    min-width: 2rem;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    z-index: var(--z-layered-on-main);
    transition: top 0.3s var(--ease-style);
    opacity: .6;
    padding-right: 4rem;
    padding-left: .5rem;
    padding-top: .5rem;
    padding-bottom: 1rem;
}

#toggle-sidebar:hover,
#toggle-sidebar.pinned:hover {
    opacity: .75;
}

#toggle-sidebar:active,
#toggle-sidebar.pinned:active {
    opacity: .85;
}

#toggle-sidebar.pinned {
    opacity: 1;
}


@media screen and (max-width: 600px) {
    #toggle-sidebar {
        min-height: 3rem;
        min-width: 2.8rem;
        padding-left: 0;
    }
}

svg {
    min-height: 100%;
    min-width: 100%;
    fill: var(--text-or-stroke-color);
}

.svg-icon-text {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

.svg-icon-text>svg {
    min-width: 1.5rem;
    min-height: 1.5rem;
    max-width: 1.5rem;
    max-height: 1.5rem;
}

@media screen and (max-width: 600px) {
    .svg-icon-text>svg {
        min-width: 3rem;
        min-height: 3rem;
        max-width: 3rem;
        max-height: 3rem;
    }
}

.arrow {
    display: flex;
    font-size: 10rem;
    text-decoration: none;
    color: var(--text-or-stroke-color);
    opacity: .2;
    z-index: var(--z-floating);
    height: 100%;
    align-items: center;
}

/* only apply hover styles on pointers that can hover (i.e. non-touchscreens) */
@media (hover: hover) and (pointer: fine) {
    .arrow:hover {
        opacity: .8;
    }
}

.arrow:active {
    opacity: 1.0;

}

button {
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 4px;
    background-color: var(--secondary-color);
    color: var(--text-or-stroke-color);
    border: 1px solid var(--optional-rnd-rect-border-color);
    box-shadow: none;
    transition: box-shadow 0.3s var(--ease-style);
}


button[type="submit"] {
    background-color: #469448;
    color: white;
    text-shadow: 1px 1px var(--text-or-stroke-color);
}

/* Hover and active states for enabled buttons only */

button:not(:disabled):hover {
    opacity: 0.9;
    box-shadow: var(--custom-drop-shadow);
    transition: box-shadow 0.3s var(--ease-style);
}

button:not(:disabled):active {
    opacity: 1.2;
    box-shadow: none;
}

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

.two-rem-icon {
    min-width: 2rem;
    width: 2rem;
    min-height: 2rem;
    height: 2rem;
    color: var(--text-or-stroke-color);

}

.one-rem-icon {
    width: 1rem;
    height: 1rem;
}


#logout-button,
.delete {
    margin-right: auto;
    /* Pushes it to the left */
    background-color: #f44336;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.cancel {
    background:
        /* top layer: semi-transparent grey */
        linear-gradient(rgba(128, 128, 128, 0.5), rgba(128, 128, 128, 0.5)),
        var(--secondary-color);
}

/* The dimmed background overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    /* Hidden by default - shown when modal is triggered */
    display: none;
    z-index: var(--z-overlay);
    /* so it’s on top of the main page */
}

/* The modal container */
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    /* Translate -50%, -50% to center the modal on screen */
    transform: translate(-50%, -50%);

    min-width: 50vw;
    max-width: 90vw;
    max-height: 90vh;
    background-color: rgba(var(--background-color), 0.9);
    border-radius: 4px;
    padding: 20px;
    display: none;
    /* Hidden by default */
    z-index: var(--z-modal);
    /* Above the overlay */
    box-shadow: var(--custom-drop-shadow);
    transition: opacity 0.3s var(--ease-style), transform 0.3s var(--ease-style);
    flex-direction: column;
    row-gap: 1rem;
}

/* Modal heading */
.modal h2 {
    margin-bottom: 16px;
}

/* Form elements inside the modal */
.modal form {
    display: flex;
    flex-direction: column;
}

.modal label {
    margin-bottom: 4px;
    font-weight: bold;
    width: 15rem;
    max-width: 15rem;
}

.modal input[type="text"],
.modal input[type="date"] {
    margin-bottom: .25rem;
    padding: 8px;
    border: 1px solid var(--text-or-stroke-color);
    border-radius: 4px;
    color: var(--stroke-or-text-color);
}

#loadOverlay {
    display: none;
}


.custom-select select {
    width: 33vw;
}

@media (max-width: 600px) {
    .custom-select select {
        width: 25vw;
    }
}

select {
    /* Remove default styling in most browsers */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    /* Base styles */
    background-color: var(--secondary-color);
    color: var(--text-or-stroke-color);
    border: 1px solid var(--optional-rnd-rect-border-color);
    border-radius: calc(var(--optional-radius) * 0.75);
    box-shadow: none;
    transition: box-shadow 0.3s var(--ease-style);

    padding: 0.6rem 2.4rem 0.6rem 0.8rem;
    /* extra right padding for the arrow */
    cursor: pointer;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='rgba(255, 255, 255, 0.5)' viewBox='0 0 10 6'%3E%3Cpath d='M0 0L5 6L10 0H0Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    /* adjust horizontally as needed */
    background-size: 1rem auto;
}

select:focus {
    outline: none;
    border-color: var(--text-or-stroke-color);
    box-shadow: var(--custom-drop-shadow);
    transition: box-shadow 0.3s var(--ease-style);
    background: var(--secondary-color) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='rgba(255, 255, 255, 0.5)' viewBox='0 0 10 6'%3E%3Cpath d='M0 6L5 0L10 6H0Z'/%3E%3C/svg%3E") no-repeat right 0.75rem center / 1rem auto;
}

.modal-column {
    display: flex;
    flex-direction: column;
    padding-right: .5rem;
    padding-left: .5rem;
    border-right: 1px solid var(--text-or-stroke-color);
    min-width: 45%;
}

.unselectable {
    -moz-user-select: -moz-none;
    -khtml-user-select: none;
    -webkit-user-select: none;
    -o-user-select: none;
    user-select: none;
}

.clickable {
    cursor: pointer;
    pointer-events: auto;
}

.pointer-important {
    pointer-events: all;
}

.minimal-scrollbar {
    scrollbar-width: none;
    /* Hides scrollbar in Firefox */
}


.minimal-scrollbar::-webkit-scrollbar {
    display: none;
    /* Hides scrollbar in WebKit browsers (Chrome, Safari)  */
}

.toast {
    z-index: var(--z-floating);
    position: fixed;
    bottom: 1.75rem;
    left: 75%;
    transform: translateX(-50%);
    background-color: rgba(var(--background-color), 1.0);
    color: var(--text-or-stroke-color);
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.5s var(--ease-style), transform 0.5s var(--ease-style);
    pointer-events: none;
    border: 1px solid var(--text-or-stroke-color);
    box-shadow: var(--custom-drop-shadow)
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.hidden {
    transform: translateX(-50%) translateY(20px);
}