* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: #e3e3e3;
  color: #000000;
}

header {
  background-color: #000000;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 40px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.858);
}

header .logo {
  font-size: 1.8em;
  font-weight: bold;
  cursor: pointer;
}

.search-bar {
  display: flex;
  width: 40%;
}

.search-bar input {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 6px 0 0 6px;
  outline: none;
}

.search-bar button {
  background-color: #ffc800;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  transition: 0.3s;
}

.search-bar button:hover {
  background-color: #ffd336;
}

nav a {
  margin-left: 20px;
  text-decoration: none;
  color: #ffffff;
  font-weight: 500;
  transition: 0.3s;
}

nav a:hover {
  color: #ffc400;
}

.container {
  display: flex;
  gap: 30px;
  padding: 40px;
  max-width: 1400px;
  margin: 0 auto;
}

.filters {
  width: 250px;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 20px;
  height: fit-content;
  flex-shrink: 0;
}

.filters h2 {
  font-size: 1.3em;
  margin-bottom: 15px;
  color: #333;
}

.filter-toggle-btn {
  display: none; 
  width: 100%;
  padding: 10px;
  background-color: #ffc800;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  margin-bottom: 15px;
  cursor: pointer;
}

.filter-section {
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.filter-section:last-child {
  border-bottom: none;
}

.filter-section h3 {
  font-size: 1.1em;
  color: #444;
  margin-bottom: 10px;
}

.filter-section label {
  display: flex;
  align-items: center;
  margin: 8px 0;
  color: #555;
  cursor: pointer;
}

.filter-section input[type="checkbox"] {
  margin-right: 10px;
  accent-color: #ffc800;
  width: 16px;
  height: 16px;
}

.results {
  flex: 1;
}

.results h1 {
  font-size: 1.6em;
  margin-bottom: 25px;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 25px;
  padding-bottom: 40px;
}

.book-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #fff;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: 0.3s;
  cursor: pointer;
  height: 100%;
}

.book-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.book-img {
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 12px;
  background-color: #f0f0f0;
}

.book-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-card h3 {
  font-size: 1.1em;
  text-align: center;
  margin-bottom: 5px;
  color: #222;
  line-height: 1.3;
}

.book-card p {
  color: #666;
  font-size: 0.9em;
  text-align: center;
}

.book-card span {
  display: block;
  margin: 10px 0;
  font-weight: bold;
  color: #333;
  font-size: 1.1em;
}

.book-card button {
  background-color: #FFD740;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.3s;
  width: 100%;
  font-weight: bold;
}

.book-card button:hover {
  background-color: #ffcc00;
}

.book-card.hidden {
  display: none;
}

footer {
  color: #ffffff;
  background-color: #000000;
  text-align: center;
  padding: 10px;
  font-size: 14px;
  margin-top: 40px;
}

@media (max-width: 900px) {
  .container {
    flex-direction: column;
    padding: 20px;
  }

  .filters {
    width: 100%;
    order: -1;
    margin-bottom: 20px;
  }

  .filter-toggle-btn {
    display: block;
  }

  .filter-sections-wrapper {
    display: none;
    margin-top: 15px;
    animation: slideDown 0.3s ease-out;
  }

  .filter-sections-wrapper.active {
    display: block;
  }

  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
  }
}

@media (max-width: 600px) {
  .books-grid {
    grid-template-columns: repeat(2, 1fr); 
    gap: 10px;
  }

  .book-card {
    padding: 10px;
  }

  .book-card h3 {
    font-size: 0.95em;
  }
  
  .book-card button {
    padding: 8px;
    font-size: 0.9em;
  }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

body.dark-theme .filters,
body.dark-theme .book-card {
    background-color: #1e1e1e;
    border: 1px solid #333;
}

body.dark-theme .filters h2,
body.dark-theme .filter-section h3,
body.dark-theme .book-card h3,
body.dark-theme .book-card span,
body.dark-theme .results h1 {
    color: #fff;
}

body.dark-theme .filter-section label,
body.dark-theme .book-card p {
    color: #ccc;
}