@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Source+Sans+3:wght@300;400;500;600&display=swap");.footer {
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer__container {
  text-align: center;
}

.api {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.api__title {
  color: var(--text);
  font-size: 0.875rem;
}

.api__link {
  font-size: 0.875rem;
}

.api__link:hover {
  color: var(--yellow);
}

.developer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.developer__title {
  color: var(--text);
  font-size: 0.875rem;
}

.developer__link {
  font-size: 0.875rem;
}

.developer__link:hover {
  color: var(--yellow);
}
.header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.header__container {
  display: flex;
  justify-content: space-between;
}

.logo-wrapper {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.logo__title {
  font-size: 1.5rem;
  color: var(--title);
  letter-spacing: -0.5px;
}

.logo__description {
  font-size: 0.7rem;
  color: var(--text);
  margin-top: 0.25rem;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--green);
  width: 44px;
  height: 44px;
  border-radius: 10px;
  transition: all 0.3s ease;
  text-decoration: none;
}

.logo-link:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

.theme-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-text {
  color: var(--black);
}

.theme-checkbox {
  display: none;
}

.theme-label {
  position: relative;
  width: 50px;
  height: 28px;
  cursor: pointer;
}

.theme-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--green);
  border-radius: 30px;
}

.theme-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: var(--white);
  border-radius: 50%;
  transition: 0.4s;
}

.theme-checkbox:checked + .theme-label .theme-slider:before {
  transform: translateX(23px);
}

@media (max-width: 480px) {
  .theme-text {
    display: none;
  }
}
.main {
  width: 100%;
}
.books {
  padding: 2rem 0;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.books-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  flex: 1;
}

.loading {
  text-align: center;
  padding: 3rem;
  position: relative;
  grid-column: 1 / -1;
}

.loading::after {
  content: "";
  display: inline-block;
  width: 5rem;
  height: 5rem;
  border-top: 5px solid var(--text);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.error-message {
  text-align: center;
  padding: 3rem;
  color: var(--red);
  grid-column: 1 / -1;
}

.books__no-results {
  text-align: center;
  padding: 3rem;
  color: var(--text);
  grid-column: 1 / -1;
}

@media (max-width: 480px) {
  .books {
    flex-direction: column;
  }
}
.book-card {
  position: relative;
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 5px 5px 5px var(--shadow);
  transition: all 0.3s ease;
  cursor: pointer;
}

.book-card:hover {
  box-shadow: 5px 5px 20px var(--shadow);
}

.book-card__cover {
  width: 100%;
  aspect-ratio: 2 / 3;
}

.book-card__content {
  padding: 0.5rem;
}

.book-card__title {
  font-size: 1rem;
  color: var(--title);
}

.book-card__author {
  font-size: 0.8rem;
  color: var(--text);
}

.book-card__year {
  font-size: 0.8rem;
  color: var(--text);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.book-card {
  animation: fadeInUp 0.5s ease-out forwards;
  opacity: 0;
}

.book-card__favorite {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 24px;
  height: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--card);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s ease;
  border: none;
  opacity: 0.9;
}

.book-card__favorite:hover {
  transform: scale(1.2);
}
.favorites {
  font-family: "Playfair Display", serif;
  background: var(--white);
  border-radius: 10px;
  position: sticky;
  top: 100px;
  height: fit-content;
  max-height: calc(100vh);
  overflow-y: auto;
  scrollbar-width: none;
  width: 240px;
}

.favorites__title-wrapper {
  position: relative;
  border-bottom: 1px solid var(--border);
  padding: 1rem 3rem;
}

.favorites__title-img {
  position: absolute;
  left: 10px;
  top: 20px;
  background-color: var(--favorite);
  width: 30px;
  height: 30px;
  padding: 5px;
  border-radius: 10px;
}

.favorites__title {
  font-size: 1rem;
  color: var(--title);
}

.favorites__title-description {
  font-size: 0.7rem;
  color: var(--text);
}

.favorites__list {
  display: flex;
  flex-direction: column;
}

.favorites__item {
  display: flex;
  margin: 0.5rem 0;
  transition: transform 0.2s;
}

.favorites__item:hover {
  transform: translateX(-3px);
}

.favorites__cover {
  width: 50px;
  height: 75px;
  border-radius: 4px;
  margin: 0 0.5rem;
}

.favorites__info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-right: 25px;
}

.favorites__book-title {
  font-size: 0.7rem;
  color: var(--title);
}

.favorites__book-author {
  font-size: 0.7rem;
  color: var(--text);
}

.favorites__remove {
  margin: auto 0;
  margin-left: auto;
  cursor: pointer;
  background: var(--white);
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
}

.favorites__remove:hover {
  transform: scale(1.3);
}

.favorites__empty {
  text-align: center;
  color: var(--text);
  font-size: 0.7rem;
  padding: 2rem;
}

@media (max-width: 480px) {
  .favorites {
    width: 100%;
  }
}
.search {
  text-align: center;
  margin: auto;
  max-width: 600px;
}

.search__title {
  font-family: "Playfair Display", serif;
  font-size: 2rem;
  color: var(--title);
  margin-bottom: 0.5rem;
}

.search__description {
  font-size: 1.125rem;
  color: var(--text);
  margin-bottom: 1rem;
}

.search__form {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.search__input-wrapper {
  position: relative;
  flex: 1;
}

.search__input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
  pointer-events: none;
}

.search__input {
  width: 100%;
  padding: 0.7rem 2.7rem;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  background-color: var(--white);
  color: var(--title);
  transition: all 0.3s ease;
  outline: none;
}

.search__input:focus {
  box-shadow: 5px 5px 5px var(--shadow);
}

.search__input::placeholder {
  color: var(--shadow);
}

.search__button {
  padding: 0.7rem 2rem;
  font-size: 1rem;
  color: var(--white);
  background-color: var(--green);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search__button:hover {
  background-color: var(--brown);
  box-shadow: 5px 5px 5px var(--shadow);
}

@media (max-width: 768px) {
  .search__title {
    font-size: 1.5rem;
  }

  .search__description {
    font-size: 0.8rem;
  }

  .search__button {
    width: 150px;
    margin: 0 auto;
  }
}

.dark-theme .search__button:hover {
  background-color: var(--black);
}

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


:root {
  --white: #ffffff;
  --green: #27694d;
  --yellow: #daa520;
  --red: #ef4444;
  --brown: #383129;
  --black: #2a2622;

  --title: #2b2622;
  --text: #7c736a;
  --border: #e7e2da;

  --background: #f7f4ef;
  --card: #fcfaf7;
  --secondary: #eeebe4;
  --shadow: #c4b8a8;
  --favorite: #eaf0ed;
}

.dark-theme {
  --white: #1a1a1a;
  --black: #e0e0e0;

  --title: #e0e0e0;
  --text: #a0a0a0;
  --border: #333333;

  --background: #121212;
  --card: #1e1e1e;
  --shadow: #383837;
}

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

html {
  height: 100%;
}

main {
  flex: 1;
}

body {
  background-color: var(--background);
  font-family: "Source Sans 3", sans-serif;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

a {
  text-decoration: none;
  color: var(--green);
}

li {
  list-style-type: none;
}

@media (max-width: 768px) {
  .container {
    padding: 0.5rem;
  }
}
