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

:root {
    --color-background: #0a2463;
    --color-front: #fdecef;

    --color-main: #89023e;
    --color-accent: #cc7178;
    --color-secondary: #c6c8ee;

    background-color: var(--color-background);
    color: var(--color-front);
    transition: 0.5s;
}

.dark {
    --color-background: #0a2463;
    --color-front: #fdecef;
    --color-main: #89023e;
    --color-accent: #cc7178;
    --color-secondary: #c6c8ee;

    background-color: var(--color-background);
    color: var(--color-front);
}

.light {
    --color-background: #fdecef;
    --color-front: #0a2463;
    --color-main: #89023e;
    --color-accent: #cc7178;
    --color-secondary: #c6c8ee;

    background-color: var(--color-background);
    color: var(--color-background);
}

.header-main {
    display: flex;
    width: 100%;
    justify-content: center;
    background-color: var(--color-main);
}
.top-bar {
    display: flex;
    flex-basis: 1000px;
    align-items: center;
    justify-content: space-evenly;
    gap: 20px;
    margin-left: 2rem;
    margin-right: 2rem;
    position: relative;
}

.top-bar > * {
    display: inline-flex;
    height: 3rem;
    align-items: center;
}
.search-bar {
    flex: 1 1 auto;
}
.search-bar input {
    display: inline-flex;
    width: 100%;
    height: 1.5rem;
    border: 0;
    border-radius: 8px;
}

.profileContainer {
    cursor: pointer;
}
.profileContainer .visible {
    display: inline-flex;
    align-items: center;
}

.hidden {
    display: none;
}

.profile-options {
    position: absolute;
    background-color: var(--color-main);
    top: 50px;
    border-radius: 8px;
    z-index: 10;
}
li {
    list-style: none;
}

li a {
    color: var(--color-secondary);
    display: block;
    border: 10px solid transparent;
    text-decoration: none;
}
.profile-options li:hover {
    background-color: var(--color-accent);
}

#overlay {
    height: 100%;
    width: 100%;
    position: absolute;
    z-index: 1;
}

main {
    margin: 4rem;
    display: flex;
    justify-content: center;
}
#book-shelf {
    display: grid;
    gap: 20px;
    max-width: calc(4 * 350px + 3 * 20px);
    min-width: 250px;

    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    grid-auto-rows: minmax(400px, 1fr);
    align-items: center;
}

.book {
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    background-color: var(--color-secondary);
    border: 1.5rem solid transparent;
    border-radius: 8px;
    color: black;
    transition: 0.5s;
    height: 100%;
}
.book:hover {
    transform: scaleX(1.05);
}

.book-info {
    /* display: flex; */
    /* flex-wrap: wrap; */
    /* gap: 20px; */
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
#review {
    grid-row-start: 2;
    grid-column: 1 / span 2;
}

.book-info > * {
    flex: 1;
}

.cover {
    max-height: 440px;
}

#new-book-div {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    order: 999;
}

#new-book-div img {
    padding: 1rem;
    margin: 2rem;
    border: 2px solid;
    border-radius: 50%;
    background-color: white;
}

#new-book-div:active {
    transform: scale(0.9);
}

#add-book-dialog {
    /* height: 200px; */
    width: 300px;
    border: 2rem solid transparent;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
}
@media (width <= 600px) {
    .header-main {
        display: flex;
        width: 100%;
    }
    .top-bar {
        margin-left: 0;
        margin-right: 0;
    }
    .top-bar input {
        display: none;
    }
}
