@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

:root {
  --primary-color: #007bff;
  --secondary-color: #1e1e1e;
  --text-color: #333;
  --light-text: #5a5a5a;
  --bg-color: #f2f2f2;
  --card-bg: #fff;
  --shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-color);
}

/* header css */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background-color: var(--card-bg);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#github {
  font-size: 1.5rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.3s ease;
}

#github:hover {
  color: var(--primary-color);
}

/* main css */
.main-content {
  flex: 1;
  padding: 2rem;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

.search-container {
  margin-bottom: 2rem;
}

.search {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.input-container {
  position: relative;
  flex: 1;
}

.search-field {
  width: 100%;
  padding: 0.75rem 1rem;
  padding-right: 3rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.search-field:focus {
  outline: none;
  border-color: var(--primary-color);
}

.icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--light-text);
  pointer-events: none;
}

.btn-container {
  display: flex;
  gap: 1rem;
}

.btn {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  background-color: var(--card-bg);
  transition: all 0.3s ease;
  min-width: 120px;
  color: var(--secondary-color);
}

.btn:hover {
  background-color: #f5f5f5;
}

.book-results {
  margin-top: 2rem;
}

/* book card  */

.card-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 1.5rem;
}

/* card css */
.card {
  display: flex;
  flex-direction: column;
  background-color: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.card-container a {
  all: unset;
  display: contents;
}

.image-container {
  background-color: var(--secondary-color);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.image img {
  width: 100%;
  height: auto;
  max-height: 150px;
  object-fit: contain;
}

.about {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.5rem;
  margin-bottom: 0.5rem;
}

.book-meta {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.5rem;
}

.Author,
.Publisher {
  font-size: 0.875rem;
  color: var(--light-text);
}

.publish-date {
  font-size: 0.75rem;
  color: var(--light-text);
  margin-bottom: 10px;
}

.pages {
  font-size: 0.75rem;
  color: var(--light-text);
}

/* pagination css */
.pagination-container {
  position: relative;
  padding: 10px;
  box-sizing: border-box;
  display: flex;
  top: 3rem;
  width: 100%;
  justify-content: center;
  align-items: center;
  margin-bottom: 5rem;
}

.page-switch-btn {
  padding: 10px 12px;
  border: none;
  height: 100%;
  margin: 0 10px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

#pageNumbers {
  color: var(--secondary-color);
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 500;
}

/* footer css */
footer {
  padding: 1.5rem;
  background-color: var(--secondary-color);
  color: white;
  margin-top: 2rem;
}

footer p {
  text-align: center;
}

@media (min-width: 768px) {
  .search {
    flex-direction: row;
    align-items: center;
  }

  .card {
    flex-direction: row;
  }

  .card .image-container {
    flex: 0 0 150px;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 1rem;
  }

  .main-content {
    padding: 1rem;
  }

  .btn-container {
    flex-direction: row;
    width: 100%;
  }

  .btn {
    width: 100%;
  }

  #sort-container {
    width: 100%;
  }

  #view-type {
    display: none;
  }

  .card-container {
    grid-template-columns: 1fr;
  }

  .footer {
    display: block;
    font-size: 12px;
    text-align: center;
  }
}
