body {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    font-family: 'Open Sans', sans-serif;
}

footer {
    grid-area: footer;
    background-color: black;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 3rem;
    gap: 1rem;
}

header {
    display: flex;
    align-items: center;
    background-color: #8ecae6;
    height: 5rem;
    box-shadow: 1px 1px 8px #333;
    z-index: 1;
}

header > *, .card > * {
    margin-left: 1rem;
}

.cards-container {
    position: relative;
    flex: 1;
    min-height: calc(100vh - 8rem);
    display: grid;
    grid-template-columns: repeat(auto-fit, 16rem);
    background-color: #219ebc;
}

.card > h1 {
    margin: auto;
}

.card {
    margin: 1rem 0.5rem;
    color: #8ecae6;
    display: grid;
    grid-template-rows: 3rem 2rem 2rem;
    width: 14rem;
    height: 20rem;
    border: 0.25rem solid #023047;
    border-radius: 2rem;
    background-color: #023047;
}

dialog {
    position: absolute;
    z-index: 99;
    height: 45vh;
    border-radius: 2rem;
    background-color: #34699A;
}

dialog p {
    display: flex;
    justify-content: space-between;
}

label {
    font-size: 1.2rem;
}

input {
    background: none;
    border: none;
    font-size: 1.2rem;
    border-bottom: 2px solid black;
}

input[type=number] {
    width: 3rem;
}

input:focus, button:focus {
    outline: none;
}

.add-book {
    position: fixed;
    z-index: 1;
    bottom: 2rem;
    right: 2rem;
    background: none;
    border: none;
    width: 4rem;
    height: 4rem;
    cursor: pointer;
    transition: transform 0.5s ease;
}

.add-book:hover {
    transform: rotate(180deg) scale(1.2);
}

.add-book img {
    width: 4rem;
    height: 4rem;
}

input::-webkit-inner-spin-button, input::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

input[type=number] {
    -moz-appearance: textfield; 
}

button[type=submit] {
    width: 10rem;
    height: 3rem;
    margin-top: 2rem;
    font-size: 1.5rem;
    font-weight: 700;
    background: none;
    border: 2px solid white;
    border-radius: 2rem;
    box-shadow: 2px 2px 5px black;
    cursor: pointer;
}

button[type=submit]:hover {
    transform: scale(1.05) translateY(-0.5rem);
}


.overlay {
    display: none;
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 98;
    background-color: rgba(0,0,0, 0.7);
}

.card div {
    align-self: flex-end;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card button {
    width: 2rem;
    height: 2rem;
    margin: 1rem;
    background: none;
    border: none;
    cursor: pointer;
}


.card button img {
    width: 2rem;
    height: 2rem;
}

.card button:hover {
    transform: scale(1.1);
}

.switch {
 font-size: 17px;
 position: relative;
 display: inline-block;
 width: 62px;
 height: 35px;
}

.switch input {
 opacity: 1;
 width: 0;
 height: 0;
}

.slider {
 position: absolute;
 top: 0;
 right: 0;
 left: 0;
 bottom: 0;
 cursor: pointer;
 background: #fff;
 transition: .4s;
 border-radius: 30px;
 border: 1px solid #ccc;
}

.slider:before {
 position: absolute;
 content: "";
 height: 1.9rem;
 width: 1.9rem;
 border-radius: 16px;
 left: 1.2px;
 top: 0;
 bottom: 0;
 background-color: white;
 box-shadow: 0 2px 5px #999999;
 transition: .4s;
}

input:checked + .slider {
 background-color: #5fdd54;
 border: 1px solid transparent;
}

input:checked + .slider:before {
 transform: translateX(1.5em);
}