:root {
  --primary-color: #4361ee;
  --secondary-color: #3a0ca3;
  --text-color: #333;
  --text-light: #666;
  --bg-color: #f5f5f5;
  --card-bg: #ffffff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 2rem 1rem;
  text-align: center;
}

.app-header h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

.search-container {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.search-container input {
  flex: 1;
  padding: 0.8rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  min-width: 200px;
}

.search-container button {
  padding: 0.8rem 1.5rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.3s ease;
}

.search-container button:hover {
  background: var(--secondary-color);
}

.app-main {
  flex: 1;
  padding: 2rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.books-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
}

.book-card {
  background-color: var(--card-bg);
  border-radius: 12px;
  width: 340px;
  display: flex;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.book-cover {
  width: 120px;
  height: 160px;
  object-fit: cover;
}

.book-info {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.book-title {
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.book-author {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.book-meta {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-light);
}

.details-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  padding: 0.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 0.5rem;
  text-align: center;
  transition: background 0.3s ease;
}

.details-btn:hover {
  background: var(--secondary-color);
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  gap: 1rem;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(67, 97, 238, 0.2);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hidden {
  display: none;
}

.app-footer {
  background-color: var(--text-color);
  color: white;
  text-align: center;
  padding: 1.5rem;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .book-card {
    width: 100%;
    max-width: 350px;
  }
}

@media (max-width: 480px) {
  .search-container {
    flex-direction: column;
  }

  .search-container button {
    justify-content: center;
    padding: 0.8rem;
    width: 100%;
  }

  .book-card {
    flex-direction: column;
    align-items: center;
  }

  .book-cover {
    width: 100%;
    height: 200px;
  }

  .book-info {
    align-items: center;
    text-align: center;
  }
}
