* {
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

html {
    position: relative;
}

html,
body {
    height: 100%;
}

body {
    min-height: 2000px;
    position: absolute;
    width: 100%;
    background: rgb(145, 215, 236);
}

body::before {
    content: "";
    background: var(--black-transparent-background);
    position: absolute;
    height: 100%;
    width: 100%;
}

.library {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    min-height: 800px;
    border-radius: 10px;
    padding: 30px 20px;
    display: grid;
    row-gap: 30px;
    column-gap: 20px;
    justify-content: space-around;
    grid-template: repeat(auto-fit, 400px) / repeat(auto-fill, 300px);
    background: rgb(160, 236, 145);
    margin-top: 20vh;
}

.book {
    width: 300px;
    height: 400px;
    background: rgb(246, 248, 149);
    transition: 0.2s;
    box-shadow: 0 0 10px 2px #0002;
    z-index: -1;
}

.book:hover {
    scale: 1.1;
}

.book:not(.add-book) {
    background-position: center;
    background-size: cover;
    position: relative;
}

.add-book {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 6rem;
    cursor: pointer;
    user-select: none;
}

.text {
    position: absolute;
    width: 100%;
    bottom: 0;
    height: 50px;
    background: #000a;
    font-size: 1rem;
    text-align: center;
    color: #fff;
    transition: 0.5s;
    overflow: hidden;
}

.text:hover {
    height: 100%;
}

.title {
    margin-bottom: 0;
    margin-top: 5px;
    font-size: 1em;
}

.author {
    color: rgb(199, 199, 199);
}

.pages {
    margin-bottom: 50px;
}

.description {
    margin: auto;
    width: 85%;
    text-align: left;
}

.favorite-icon,
.is-read-icon,
.trash-icon,
.edit-icon {
    position: absolute;
    top: 20px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    user-select: none;
    transition: 0.2s;
}

.favorite-icon > *,
.is-read-icon > *,
.trash-icon > *,
.edit-icon > * {
    pointer-events: none;
}

.favorite-icon {
    right: 20px;
}

.is-read-icon {
    right: 20px;
    top: 70px;
}

.trash-icon {
    left: 20px;
}

.edit-icon {
    color: #fff;
    left: 20px;
    top: 70px;
}

.red-heart,
.red-trash,
.yellow-reading,
.green-pen {
    display: none;
}

.close-form-btn::before,
.favorite-icon::before,
.is-read-icon::before,
.trash-icon::before,
.edit-icon::before {
    content: "";
    z-index: -1;
    border-radius: 50%;
    background: #0007;
    height: 40px;
    width: 40px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.favorite-icon:hover,
.is-read-icon:hover,
.trash-icon:hover,
.edit-icon:hover {
    scale: 1.2;
}

/* TODO form */
form {
    background: rgb(234, 246, 246);
    min-height: 800px;
    width: max(25vw, 400px);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    z-index: 99;
}

form button[type="submit"] {
    margin-top: 10px;
    margin-bottom: 10px;
}

.scaling-form {
    animation: scale-form 0.5s;
}

@keyframes scale-form {
    from {
        scale: 0;
    }
    to {
        scale: 1;
    }
}

.form-title {
    text-align: center;
    margin-top: 10px;
    margin-bottom: 10px;
}

.alternative-form-title {
    display: none;
}

.details-container {
    width: 90%;
    margin: auto;
}

form .container {
    margin-bottom: 20px;
}

form input {
    padding: 5px;
}

form input:valid,
textarea {
    outline-color: green;
}

form input:invalid,
textarea.invalid {
    outline-color: #f00;
    color: #f00;
}

input.invalid,
textarea.invalid {
    border-color: #f00;
    border-radius: 5px;
}

textarea.invalid {
    border-width: 2px;
}

form .error-message {
    margin-top: 5px;
    color: #f00;
}

fieldset > label,
span {
    display: block;
}

input[type="text"],
textarea {
    width: 100%;
}

input[type="file"] {
    display: none;
}

form button,
button[type="submit"] button {
    border: none;
    width: 100%;
    height: 30px;
    cursor: pointer;
    background: rgb(95, 250, 216);
}
#add-image-btn {
    background: rgb(248, 252, 140);
}

#add-image-btn:hover {
    background: rgb(150, 208, 255);
}

button[type="submit"] {
    width: 40%;
    display: block;
    margin: auto;
}

button[type="submit"]:hover {
    background: rgb(86, 255, 89);
}

button.edit-book-btn {
    display: none;
}

.close-form-btn {
    font-size: 2rem;
    color: #fff;
    background: transparent;
    border: none;
    border-radius: 50%;
    position: fixed;
    right: 20px;
    top: 10px;
    cursor: pointer;
    display: none;
    user-select: none;
}

.close-form-btn:hover::before {
    background: #0009;
}

footer {
    color: #fff;
    background: rgb(32, 44, 97);
    width: 100%;
    height: 50px;
    position: fixed;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
}

footer a {
    height: 30px;
}
