:root {
  --primary: #2c3e50;
  --secondary: #3498db;
  --accent: #e74c3c;
  --light: #ecf0f1;
  --dark: #2c3e50;
  --radius: 8px;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

body {
  background-color: #f8f9fa;
  color: var(--dark);
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

h1 {
  text-align: center;
  color: var(--primary);
  font-size: 2.5rem;
  margin-bottom: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.controls {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  background: white;
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}

.search-group {
  flex: 1;
  min-width: 300px;
  display: flex;
  gap: 0.8rem;
}

#searchInput {
  flex: 1;
  padding: 0.8rem 1.2rem;
  border: 2px solid #dfe6e9;
  border-radius: var(--radius);
  font-size: 1rem;
  transition: all 0.3s ease;
}

#searchInput:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

button {
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  background: var(--secondary);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

button:hover {
  background: #2980b9;
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

.filter-group {
  display: flex;
  gap: 1rem;
  align-items: center;
}

select {
  padding: 0.7rem 1rem;
  border: 2px solid #dfe6e9;
  border-radius: var(--radius);
  background: white;
  font-size: 0.95rem;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 1.2em;
  padding-right: 2.5rem;
}

.view-toggle {
  display: flex;
  gap: 0.5rem;
  background: #f1f2f6;
  padding: 0.4rem;
  border-radius: var(--radius);
}

.view-toggle button {
  background: transparent;
  color: var(--dark);
  padding: 0.6rem 1.2rem;
}

.view-toggle button.active {
  background: white;
  color: var(--secondary);
  box-shadow: var(--shadow);
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.books-list .book-card {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.book-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.book-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.book-cover {
  width: 100%;
  height: 380px;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
  margin-bottom: 1.2rem;
  background: #f8f9fa;
}

.books-list .book-cover {
  width: 120px;
  height: 180px;
  flex-shrink: 0;
}

.book-title {
  color: var(--primary);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  line-height: 1.3;
}

.book-author {
  color: #7f8c8d;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

.book-details p {
  color: #636e72;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.loading {
  text-align: center;
  padding: 2rem;
  color: #7f8c8d;
  font-weight: 500;
  display: none;
}

.error-message {
  color: #e74c3c;
  text-align: center;
  padding: 2rem;
  font-weight: 500;
}

@media (max-width: 768px) {
  .container {
      padding: 1.5rem 1rem;
  }
  
  .controls {
      flex-direction: column;
      padding: 1rem;
  }
  
  .search-group {
      width: 100%;
  }
  
  .books-list .book-card {
      flex-direction: column;
  }
  
  .books-list .book-cover {
      width: 100%;
      height: 200px;
  }
}
.footer {
  background-color: #222;
  color: white;
  text-align: center;
  padding: 15px 0;
  font-size: 14px;
  position: relative;
  bottom: 0;
  width: 100%;
}

.footer-nav a {
  color: #fff;
  text-decoration: none;
  margin: 0 10px;
}

.footer-nav a:hover {
  text-decoration: underline;
}