*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
}
body {
    position: relative;
    min-height: 100vh;
}
body::before {
    content: "";
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    position: absolute;
    background-image: url(images/books.jpg);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    background-attachment: fixed;
    opacity: 0.8;
}
/* header */
#header {
    font-size: 40px;
    display: flex;
    justify-content: center;
    height: 50px;
    line-height: 50px;
    background-image: linear-gradient(lightskyblue, lightgreen);
    animation: change 5s linear infinite;
    color: bisque;
    text-shadow: 2px 2px 5px black;
    position: relative;
    font-family: 'Tilt Prism', cursive;
    font-weight: bold;
}
@keyframes change {
    0% {
        background-image: linear-gradient(lightcoral, lightskyblue);
    }
    50% {
        background-image: linear-gradient(lightslategray, lightpink );
    }
}
/* Main */
#main {
  position: relative;
  margin-top: 30px;
  min-height: 100vh;
  margin-bottom: 50px;
}
#section1 {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: relative;
}
.btn-container {
    display: flex;
    justify-content: space-around;
    background-image: linear-gradient(lightcoral, lightskyblue);
    color: white;
    text-shadow: 2px 2px 5px lightcoral;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 25px;
    margin-top: 20px;
    max-width: 315px;
    height: 85px;
    box-shadow: 2px 2px 5px inset red;
    position: relative;
}
.btn-container:hover::before {
    content: "";
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-image: url(images/library.jpg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.65;
    position: absolute;
    border-radius: 25px;
}
#add-title {
    margin-top: 18px;
    font-size: 23px;
    position: relative;
    font-family: 'Lobster', cursive;
    color: black;
}
.add-btn {
    width: 55px;
    height: 55px;
    object-fit: cover;
    animation: rotate 2s linear infinite;
    cursor: pointer;
    margin-top: 5px;
    transition: 0.5s;
    position: relative;
}
.add-btn.active {
    transform: scale(1.3) rotate(360deg);
}
.empty-lib {
    margin-top: 40px;
    background-image: linear-gradient(lightgreen, lightsalmon);
    padding: 10px;
    border-radius: 25px;
    text-shadow: 2px 2px 5px gold;
    font-family: 'Lobster', cursive;
    width: 280px;
    font-size: 14px;
}
.form-container {
    margin-top: 60px;
    margin-bottom: 30px;
    background-color: #00C3F5;
    width: 500px; 
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    display: none;
    position: relative;
    border-radius: 10px;
    border: 2px solid #57FAB9;
}
#form-title {
    width: 400px;
    text-align: center;
    border: 2px solid white;
    padding: 6px;
    border-radius: 10px;
    background-color: black;
    color: lightsalmon;
}
#form {
    display: flex;
    flex-direction: column;
    margin: 10px;
}
label {
    margin-top: 10px;
    font-size: 18px;
    font-family: 'Playfair Display', serif;
    font-weight: bold;
}
#name, #author, #page, #read {
    padding: 10px;
    border: 2px solid lightslategray;
    outline-color: green;
    border-radius: 8px;
    width: 400px;
}
.error {
    color: red;
    font-size: 15px;
}
#submit-btn {
    margin-top: 30px;
    width: 100px;
    margin-left: auto;
    margin-right: auto;
    padding: 5px;
    border-radius: 10px;
    background-color: #0070F0;
    color: white;
    font-size: 15px;
    border: 2px solid black;
    cursor: pointer;
    margin-bottom: -10px;
    font-weight: bold;
}
#submit-btn:hover {
    background-color: #0041F5;
} 
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
  }
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-gap: 40px;
    margin-top: 60px;
  }
.card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: #7D91FF;
    border-radius: 25px;
    box-shadow: 2px 2px 10px inset red;
    max-width: 100%;
    box-sizing: border-box;
    border: 2px dotted red;
    animation: up-down 3s linear infinite;
  }
  @keyframes up-down {
    0% {
        transform: translateY(2px);
    }
    50% {
        transform: translateY(-2px);
    }
    100% {
        transform: translateY(2px);
    }
  }
h2 {
    margin-top: 5px;
    text-align: center;
    text-shadow: 2px 2px 10px black;
    color: lightskyblue;
    font-family: 'Lobster', cursive;
}
p {
    padding: 15px;
    font-size: 18px;
    font-family: 'Domine', serif;
}
#read-btn {
    border: 2px solid white ;
    background-color: lightsalmon;
    border-radius: 8px;
    padding: 5px 10px;
    font-weight: bold;
    text-shadow: 2px 2px 5px yellow;
}
#delete-card {
    padding: 5px;
    margin: 10px;
    border-radius: 10px;
    border: 2px solid black;
    background-color: #FF6D70;
    color: white;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 2px 2px 5px blue;
}
#delete-card:hover {
    background-color: #F53061;
}
#toggleRead {
    background-color: lightseagreen;
    color: white;
    margin: 10px;
    padding: 5px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: bold;
    text-shadow: 2px 2px 5px blue;
}
#toggleRead:hover {
    background-color: #66D95B;
}
/* Footer */
.footer {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    font-size: 20px;
    color: #ddd;
    background-color: black;
    font-weight: bold;
}
.fa-github {
    /* color: red; */
    font-size: 25px;
    transition: transform 0.3s ease-in-out;
  }
  .fa-github:hover {
    transform: rotate(360deg) scale(1.2);
  }
/* Media queries */
@media screen and (max-width: 549px) {
    .form-container {
        width: 450px;
    }
}

@media screen and (max-width: 484px) {
    .form-container {
        width: 420px;
    }
}

@media screen and (max-width: 444px) {
    .form-container {
        width: 400px;
    }
    #form-title {
        width: 350px;
    }
    #name, #author, #page, #read {
        width: 350px;
    }
}
@media screen and (max-width: 413px) {
    .form-container {
        width: 350px;
    }
    #form-title {
        width: 300px;
    }
    #name, #author, #page, #read {
        width: 300px;
    }
}
@media screen and (max-width: 368px) {
    .form-container {
        width: 300px;
    }
    #form-title {
        width: 250px;
        font-size: 15px;
    }
    #name, #author, #page, #read {
        width: 250px;
    }
    label {
        font-size: 18px;
    }
}
@media screen and (max-width: 318px) {
    .form-container {
        width: 280px;
    }
    #form-title {
        width: 220px;
        font-size: 15px;
    }
    #name, #author, #page, #read {
        width: 220px;
    }
    label {
        font-size: 15px;
    }
}
@media screen and (max-width: 295px) {
    .empty-lib {
        width: 240px;
        font-size: 12px;
    }
    .form-container {
        width: 250px;
    }
    #form-title {
        width: 200px;
        font-size: 15px;
    }
    #name, #author, #page, #read {
        width: 200px;
    }
    label {
        font-size: 15px;
    }
    .btn-container {
        max-width: 250px;
        height: 75px;
    }
    #add-title {
        font-size: 18px;
    }
    .add-btn {
        width: 45px;
        height: 45px;
    }
}