@import url("https://fonts.googleapis.com/css2?family=Estonia&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Grandiflora+One&display=swap");

* {
  margin: 0;
  padding: 0;
}
/* General Styles */
body {
  font-family: "Poppins", sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* justify-content: center; */
  height: 100vh;
  background-color: #f8f9fa;
  color: #333;
  transition: background 0.5s ease, color 0.5s ease;
}

.container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-align: center;
  animation: fadeIn 1s ease-in-out;
}

/* Header */
.head {
  margin-top: 100px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 98vh;
  /* max-width: 800px; */
  padding: 15px;
  background: white;
  border-radius: 10px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
  transition: background 0.5s ease, color 0.5s ease;
}

.head1 {
  gap: 10px;
  margin: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 70%;
  /* max-width: 800px; */
  padding: 15px;
  /* background: white; */
  border-radius: 10px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
  transition: background 0.5s ease, color 0.5s ease;
}
h1 {
  font-family: "Berkshire Swash", serif;
  text-decoration: overline;
  font-size: 3.5rem;
  margin: 0;
  font-weight: bold;
  letter-spacing: 1px;
}

/* Theme Toggle Button */
.theme-toggle {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  transition: transform 0.3s ease-in-out;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

/* Access Buttons */
.access {
  display: flex;
  gap: 20px;
  margin-top: 200px;
}

.enter {
  background: linear-gradient(135deg, #007bff, #0056b3);
  width: 100px;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 18px;
  font-family: "Grandiflora One", cursive;
  font-weight: 900;
  cursor: pointer;
  text-align: center;
  text-transform: uppercase;
  transition: background 0.3s ease, transform 0.3s ease;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
}

.enter a {
  color: white;
  text-decoration: none;
  padding: 30%;
}
.enter:hover {
  background: linear-gradient(135deg, #0056b3, #003580);
  transform: translateY(-3px);
}

/* Librarian Question Box */
.question-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
  font-family: "Grandiflora One", cursive;

  border-radius: 10px;
  box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.2);
  text-align: center;
  width: 300px;
  animation: slideDown 0.5s ease-in-out;
}

.question-box input {
  width: 80%;
  font-family: "Tangerine", cursive;

  padding: 10px;
  margin: 10px 0;
  border-radius: 5px;
  border: 1px solid #ddd;
}

.question-box button {
  background: #007bff;
  color: white;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 5px;
  font-size: 14px;
  font-family: "Berkshire Swash", serif;
}

.question-box button:hover {
  background: #0056b3;
}

/* Dark Mode */
.dark-mode {
  background-color: #222;
  color: white;
}

.dark-mode .head {
  background: #333;
}
.dark-mode .head1 {
  background: #333;
}

.dark-mode .enter {
  background: linear-gradient(135deg, #ff4b2b, #ff416c);
}

.dark-mode .enter:hover {
  background: linear-gradient(135deg, #ff2b2b, #ff104c);
}

.dark-mode .question-box {
  background: #444;
  color: white;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translate(-50%, -60%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.adbok {
  margin-top: 50px;
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
  width: 50%;
  height: fit-content;
  box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  transition: background 0.3s ease, transform 0.3s ease;

  gap: 15px;
}
h2 {
  text-decoration: overline;
  margin-top: 50px;
  margin-left: 40%;
  font-size: 50px;
  transition: background 0.3s ease, transform 0.3s ease;
}
.adbok input {
  margin: 15px;
  font-family: "Tangerine", cursive;
  width: 90%;
  height: 15%;
  border: double;
  border-radius: 5px;
  font-size: 2.5rem;
  font-weight: 900;
  background-color: transparent;
  transition: background 0.3s ease, transform 0.3s ease;
}

.adbok button {
  font-family: "Berkshire Swash", serif;
  width: 70%;
  height: 90px;
  border: double;
  border-radius: 5px;
  background: rgb(240, 182, 37);
  transition: background 0.3s ease, transform 0.3s ease;
}
.adbok button:hover {
  background: rgba(240, 182, 37, 0.822);
  cursor: pointer;
}

.book-ad {
  font-family: "Grandiflora One", cursive;

  font-size: 2.2rem;
  color: white;
  /* height: 200px; */
  margin-top: 30px;
  padding: 15px;
  width: 250px;
  background: #007bff;
  border: none;
  border-radius: 10px;
  font-weight: 900;
}

.book-ad:hover {
  background: #007bffdc;
  color: rgba(255, 255, 255, 0.867);
}

table {
  position: relative;

  /* left: 10px; */
  height: fit-content;
  width: 97%;
  border-radius: 5px;
  transition: background 0.3s ease, transform 0.3s ease;
  margin-top: 40px;
  backdrop-filter: blur(10px);
  box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.bookList th {
  padding-top: 10px;
  height: 50px;
  /* font-size: 2rem; */
  text-decoration: overline;
  background: #daddd8;
  text-align: center;
  color: rgb(9, 9, 9);
  transition: background 0.3s ease, transform 0.3s ease;
}

th {
  height: 50px;
  font-size: 2.5rem;
  text-decoration: overline;
  text-align: center;
  color: rgb(12, 12, 13);
  letter-spacing: 3px;
  transition: background 0.3s ease, transform 0.3s ease;
  font-family: "Tangerine", cursive;
  font-weight: 900;
}
.bookList tr {
  background: #ecebe4;
  align-self: start;
  border: 2px solid black;

  border-radius: 10px;
  transition: background 0.3s ease, transform 0.3s ease;
}
.bookList td {
  font-family: "Berkshire Swash", serif;
  font-size: 1.5rem;
  text-align: center;
  position: relative;
  color: rgb(41, 40, 40);
  transition: background 0.3s ease, transform 0.3s ease;
}
.bookList td button {
  border: none;
  height: 50px;
  overflow: hidden;
  width: 100%;
  background: #1c1c1c;
  border-radius: 3px;
  font-family: "Berkshire Swash", serif;
  font-size: 1rem;
  color: rgb(173, 169, 169);
  letter-spacing: 2px;
  text-decoration: overline;
  transition: background 0.3s ease, transform 0.3s ease;
}
#titled {
  text-align: start;
  transition: background 0.3s ease, transform 0.3s ease;

  position: relative;
  padding: 20px;
}
#authored {
  text-align: start;
  padding: 20px;

  position: relative;
}
/* Grid Layout for Books */
#bookList1 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  padding: 20px;
  transition: background 0.3s ease, transform 0.3s ease;
}

/* Book Card */
.book-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
  padding: 15px;
  text-align: center;
  transition: transform 0.3s ease;
}

.book-card:hover {
  transform: translateY(-5px);
}

/* Book Image */
.book-image {
  width: 70%;
  height: 250px;
  object-fit: cover;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);

  border-radius: 5px;
  transition: background 0.3s ease, transform 0.3s ease;
}

/* Book Info */
.book-info h3 {
  font-family: "Berkshire Swash", serif;
  /* font-weight: 900; */
  font-size: 1.5rem;
  transition: background 0.3s ease, transform 0.3s ease;
}

.book-info p {
  font-family: "Grandiflora One", cursive;
  position: relative;
  top: 15px;
  /* font-weight: 100; */
  font-size: 1rem;
  letter-spacing: 2px;
  transition: background 0.3s ease, transform 0.3s ease;

  margin: 5px 0;
}

/* Add To Cart Button */
.book-info button {
  font-family: "Berkshire Swash", serif;

  position: relative;
  top: 10px;
  background-color: #007bff;
  color: white;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  margin-top: 10px;
  border-radius: 5px;
  transition: background 0.3s ease, transform 0.3s ease;

  font-size: 14px;
}

.book-info button:hover {
  background-color: #0056b3;
}
/* Cart Container */
#cartList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  padding: 20px;
  transition: background 0.3s ease, transform 0.3s ease;
}

/* Cart Item Card */
.cart-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
  padding: 15px;
  text-align: center;
  transition: transform 0.3s ease;
}

.cart-card:hover {
  transform: translateY(-5px);
}

/* Cart Image */
.cart-image {
  width: 100%;
  height: 100px;
  object-fit: contain;
  border-radius: 5px;
  transition: background 0.3s ease, transform 0.3s ease;
}

/* Cart Info */
.cart-info h3 {
  font-family: "Berkshire Swash", serif;
  font-size: 2rem;
  font-weight: 500;
  margin: 10px 0;
  transition: background 0.3s ease, transform 0.3s ease;
}

.cart-info p {
  font-family: "Grandiflora One", cursive;
  font-size: 1rem;
  margin: 5px 0;
  transition: background 0.3s ease, transform 0.3s ease;
}

/* Remove Button */
.remove-btn {
  font-family: "Berkshire Swash", serif;

  background-color: #dc3545;
  color: white;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  margin-top: 10px;
  border-radius: 5px;
  font-size: 14px;
  width: 100%;
  transition: background 0.3s ease, transform 0.3s ease;
}

.remove-btn:hover {
  background-color: #b02a37;
  transition: background 0.3s ease, transform 0.3s ease;
}

/* Total Price and Buy Now Section */
.total-section {
  text-align: center;
  margin-top: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 10px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
  transition: background 0.3s ease, transform 0.3s ease;
}

.total-price {
  font-family: "Grandiflora One", cursive;

  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
  transition: background 0.3s ease, transform 0.3s ease;
}

.buy-all-btn {
  font-family: "Berkshire Swash", serif;

  background-color: #28a745;
  color: white;
  border: none;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 5px;
  transition: background 0.3s ease, transform 0.3s ease;
}

.buy-all-btn:hover {
  background-color: #1e7e34;
}

/* Message */
.message {
  text-align: center;
  font-size: 16px;
  color: #555;
  transition: background 0.3s ease, transform 0.3s ease;
}
.dark-mode .adbok {
  border-top: 2px solid rgb(255, 255, 255);
  border-bottom: 2px solid rgb(255, 255, 255);
  /* background: linear-gradient(45deg, pink); */

  gap: 15px;
}
.dark-mode h2 {
  text-decoration: overline;
  margin-top: 50px;
  margin-left: 40%;
  font-size: 50px;
}
.dark-mode .adbok input {
  background-color: transparent;
  color: whitesmoke;
}

.dark-mode .adbok button {
  background: #8ecae6;
}
.dark-mode table {
  position: relative;

  backdrop-filter: blur(10px);
  box-shadow: 0px 10px 30px rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(0, 0, 0, 0.3);
}
.dark-mode .bookList th {
  text-decoration: overline;
  background: #303030;
  text-align: center;
  color: rgb(236, 239, 241);
}
/* .dark-mode th {
  text-decoration: overline;

  text-align: center;
  color: aliceblue;
} */
.dark-mode .bookList tr {
  align-self: start;
  border: 2px solid rgb(230, 230, 230);
  /* border: 2px solid black; */
  border-radius: 10px;
}
.dark-mode .bookList td {
  color: rgb(0, 0, 0);
  background: gray;
}
.dark-mode .bookList td button {
  color: rgba(210, 24, 24, 0.77);
  background: #ecebe48c;
}

/* Book Card */
.dark-mode .book-card {
  background: #474545;
  border-radius: 10px;
  box-shadow: 0px 4px 10px rgba(255, 255, 255, 0.1);
  padding: 15px;
  text-align: center;
  transition: transform 0.3s ease;
}

.dark-mode .book-card:hover {
  transform: translateY(-5px);
}

/* Book Image */
.book-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 5px;
  box-shadow: 0px 4px 10px rgba(255, 255, 255, 0.1);
}

/* Book Info */

/* Add To Cart Button */
.dark-mode .book-info button {
  background-color: #2565aa;
  color: white;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  margin-top: 10px;
  border-radius: 5px;
  font-size: 14px;
}

.book-info button:hover {
  background-color: #0056b3;
}
/* Cart Container */
#cartList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  padding: 20px;
}

/* Cart Item Card */
.dark-mode .cart-card {
  background: #2d2c2c;
  border-radius: 10px;
  box-shadow: 0px 4px 10px rgba(255, 255, 255, 0.1);
  padding: 15px;
  text-align: center;
  transition: transform 0.3s ease;
}

.dark-mode .remove-btn {
  background-color: #dc3546c7;
  color: rgb(19, 19, 19);
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  margin-top: 10px;
  border-radius: 5px;
  font-size: 14px;
  width: 100%;
}

.remove-btn:hover {
  background-color: #b02a37;
}

/* Total Price and Buy Now Section */
.dark-mode .total-section {
  text-align: center;
  margin-top: 20px;
  padding: 15px;
  background: #1d1e1e;
  border-radius: 10px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
}

.total-price {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
}

.dark-mode .buy-all-btn {
  background-color: #28a745;
  color: white;
  border: none;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 5px;
}

.buy-all-btn:hover {
  background-color: #1e7e34;
}

/* Message */
.message {
  text-align: center;
  font-size: 16px;
  color: #555;
}

.viewcart {
  height: 50px;
  font-family: "Berkshire Swash", serif;

  width: 100px;
  background: rgb(240, 182, 37);
  border: none;
  border-radius: 10px;
}
.dark-mode .userid {
  background: rgba(209, 215, 215, 0.753) 0;
  color: rgb(0, 0, 0);
}
.login {
  margin-top: 30px;
  font-family: "Berkshire Swash", serif;
  font-size: 20px;
  height: 40px;
  width: 500px;
  background: rgb(31, 165, 31);
  border: none;
  border-radius: 10px;
}
.userid {
  margin-top: 100px;
  height: 50px;
  width: 800px;
  border-radius: 5px;
  border: none;
  font-family: "Tangerine", cursive;
  font-weight: 900;
  font-size: 50px;
  background: #1d1e1ec0;
  color: white;
}

#searchInput {
  border: none;
  border-radius: 3px;
  height: 40px;
  width: 20%;
  font-family: "Tangerine", cursive;
  font-size: 2rem;
  background: #1d1e1e42;
  color: rgb(0, 0, 0);
}
.dark-mode #searchInput {
  background: #9a9d9d96;
  color: rgb(0, 0, 0);
}
/* Responsive Styles */
@media (max-width: 1024px) {
  .head {
    width: 90vw;
    flex-direction: column;
    align-items: center;
    padding: 10px;
  }

  h1 {
    font-size: 3rem;
  }

  .access {
    margin-top: 100px;
    flex-direction: column;
    gap: 10px;
  }

  .enter {
    width: 80%;
    text-align: center;
  }
}

@media (max-width: 768px) {
  body {
    height: auto;
    padding: 10px;
  }

  .head {
    width: 100%;
    padding: 10px;
  }
  #searchInput {
    width: 80%;
  }
  .head1 {
    width: 90%;
    flex-direction: column;
    gap: 10px;
  }

  h1 {
    font-size: 2.5rem;
  }

  .access {
    margin-top: 50px;
    flex-direction: column;
  }

  .enter {
    width: 100%;
  }

  .adbok {
    flex-direction: column;
    height: auto;
    padding: 10px;
    text-align: center;
    width: 90%;
  }

  .adbok input {
    width: 90%;
    height: 40px;
    font-size: 1rem;
  }

  .adbok button {
    width: 80%;
    height: auto;
    padding: 10px;
  }
  .bookList th {
    font-size: 1.5rem;
    letter-spacing: 2px;
  }
  .bookList td {
    /* font-weight: 500; */
    font-size: 1rem;
  }
  #titled,
  #authored {
    text-align: center;
  }
  .userid {
    width: 90%;
    font-size: 2rem;
  }
  .login {
    width: 80%;
  }
  #bookList1,
  #cartList {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .book-image {
    height: 200px;
    object-fit: contain;
  }

  .cart-image {
    height: 150px;
  }

  .total-section {
    padding: 10px;
  }
}

@media (max-width: 576px) {
  h1 {
    font-size: 2rem;
  }

  .head {
    padding: 8px;
  }
  .book-ad {
    font-size: 1.5rem;
    letter-spacing: 3px;
    margin-top: 30px;
    padding: 15px;
    width: 250px;
    background: #007bff;
    border: none;
    border-radius: 10px;
    font-weight: 900;
  }
  .enter {
    font-size: 16px;
    padding: 10px;
  }

  .bookList button {
    text-align: center;
    /* padding: 30px; */
  }
  .book-image {
    box-shadow: none;
  }
  .book-info h3 {
    font-size: 1.3rem;
  }

  .book-info p {
    font-size: 1rem;
    font-weight: 900;
  }

  .remove-btn,
  .buy-all-btn {
    font-size: 14px;
    padding: 10px;
  }

  .total-section {
    font-size: 14px;
  }
}
