* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  background: url("assets/background.jpg") no-repeat center center fixed;
  background-size: cover;
  color: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* HEADER */
.header {
  text-align: center;
  padding: 40px 20px 10px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
}

.header h1 {
  font-size: 2.2rem;
  color: #00ffff;
  margin-bottom: 10px;
  text-shadow: 0 0 10px #00ffff;
}

.header .note {
  color: #ccc;
  font-size: 0.95rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.5;
}

/* MAIN CONTAINER */
.container {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ADD BOOK FORM */
.add-book-form {
  background: rgba(0, 0, 0, 0.7);
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 0 15px rgba(0,255,255,0.3);
  max-width: 500px;
  width: 100%;
  text-align: center;
  margin-bottom: 25px;
}

.add-book-form input,
.add-book-form textarea {
  width: 90%;
  margin: 8px 0;
  padding: 10px;
  border: none;
  border-radius: 8px;
  outline: none;
  font-size: 1rem;
}

.add-book-form button {
  background: #00ffff;
  border: none;
  color: #000;
  padding: 10px 20px;
  margin: 10px 5px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.add-book-form button:hover {
  background: #007bff;
  color: #fff;
  box-shadow: 0 0 10px #00ffff;
}

/* FILTER SECTION */
.filter-section {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

#searchInput {
  padding: 10px;
  width: 250px;
  border: 2px solid #00ffff;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #00ffff;
  outline: none;
  font-size: 1rem;
  transition: 0.3s;
}

#searchInput:focus {
  box-shadow: 0 0 10px #00ffff;
}

#ratingFilter,
#toggleFavorites {
  background: rgba(0, 0, 0, 0.6);
  color: #00ffff;
  border: 2px solid #00ffff;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  transition: 0.3s;
}

#toggleFavorites.active {
  background: #00ffff;
  color: #000;
}

/* BOOK CARDS */
.books-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.book-card {
  background: rgba(0, 0, 0, 0.6);
  border-radius: 12px;
  padding: 20px;
  width: 260px;
  box-shadow: 0 0 15px rgba(0,255,255,0.2);
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.book-card:hover {
  transform: scale(1.03);
  box-shadow: 0 0 20px rgba(0,255,255,0.4);
}

.book-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.favorite-star {
  position: static;
  font-size: 1.4rem;
  cursor: pointer;
  transition: 0.3s;
}

.favorite-star.active {
  color: #ff0066;
  text-shadow: 0 0 10px #ff0066;
}

.book-card h3 {
  color: #00ffff;
  font-size: 1.1rem;
  margin: 0;
  flex: 1;
  word-break: break-word;
  max-height: 3em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-card p {
  margin: 5px 0;
  color: #ddd;
  font-size: 0.95rem;
  max-height: 3em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Buttons inside each book card */
.card-buttons {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.card-buttons .edit-btn {
  flex: 1;
  text-align: center;
  padding: 8px;
  border-radius: 6px;
  background: #00ffff;
  color: #000;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  transition: 0.3s;
}

.card-buttons .edit-btn:hover {
  background: #007bff;
  color: #fff;
  box-shadow: 0 0 8px #00ffff;
}

/* Delete button */
.card-buttons .delete-btn {
  background: #ff3366;
  color: #fff;
}

.card-buttons .delete-btn:hover {
  background: #cc0033;
  box-shadow: 0 0 8px #ff3366;
}

/* FOOTER */
footer {
  text-align: center;
  padding: 15px;
  background: rgba(0,0,0,0.6);
  color: #aaa;
  font-size: 0.9rem;
}

/* RESPONSIVE */
@media (max-width: 600px) {
  .add-book-form input,
  .add-book-form textarea,
  #searchInput {
    width: 100%;
  }

    .book-card {
    width: 100%;
    max-width: 340px; /* keeps the card nice and contained */
    margin: 0 auto;
  }

    .card-buttons {
    flex-direction: column;
    align-items: stretch;
  }
  
  .card-buttons .edit-btn {
    font-size: 0.8rem;
    padding: 6px;
        width: 100%;
    text-align: center;
  }

  #searchInput {
    width: 100%;
  }
}
