@import url("https://fonts.googleapis.com/css2?family=Google+Sans:ital,opsz,wght@0,17..18,400..700;1,17..18,400..700&family=Rammetto+One&display=swap");

:root {
  --bg: white;
  --surface: #fff8f0;
  --text: #0e1819;
  --text-secondary: #6b6b6b;

  --accent-1: #ffc117;
  --accent-2: #fe938c;
  --accent-3: #9dd9d2;
  --accent-3-hover: #afe7e1;

  --shadow-lg: rgba(0, 0, 0, 0.05) 0 10px 10px -5px;

  --red: rgb(236, 74, 74);
  --red-hover: rgb(255, 98, 98);

  --main-font: "Google Sans", sans-serif;
  --header-font: "Google Sans", serif;
}

* {
  box-sizing: border-box;
  font-family: var(--main-font);
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  display: grid;
  grid-template-columns: 20% auto;
}

#side-bar {
  padding: 0 20px;
  background-color: rgb(235, 235, 235);
  min-height: 100vh;
}

#side-bar h1 {
  color: var(--text);
  font-family: var(--header-font);
  font-weight: 800;
}

form input {
  display: block;
  width: 100%;
  margin: 5px 0 10px 0;
  border: none;
  border-radius: 10px;
  font-size: 0.875em;
  padding: 0.5rem;
  background-color: white;
  border-radius: 50px;
  padding: 0.5rem 1rem;
}

form input:last-of-type {
  margin-bottom: 1rem;
}

form legend {
  font-weight: bold;
  margin-bottom: 10px;
}

#add-btn {
  padding: 1rem 1.5rem;
  background-color: white;
  color: var(--text);
}

#add-btn:hover {
  background-color: #f4f4f4;
}

#top-bar {
  padding: 1.5rem 0;
}

button {
  cursor: pointer;
}

#search-input {
  font-family: var(--main-font);
  padding: 1rem 1.5rem;
  border-radius: 50px;
  width: 300px;
  border: solid 1px var(--text-secondary);
}

#search-btn {
  padding: 1rem 1.5rem;
  margin-left: 8px;
  background-color: var(--accent-3);
  color: var(--text);
}

#search-btn:hover {
  background-color: var(--accent-3-hover);
}

#search-btn,
#add-btn {
  font-weight: bold;
  border: none;
  border-radius: 50px;
}

#main-body {
  padding: 0 20px;
}

#book-container {
  margin-bottom: 1rem;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  place-items: center;
  gap: 25px;
  border-radius: 20px;
  background-color: white;
  box-shadow: var(--shadow-lg);
  border: 1px solid #ddd;
  padding: 20px;
  align-items: start;
}

.book-card {
  border-radius: 10px;
  cursor: pointer;
  min-width: 100px;
  position: relative;
}

.book-image-container {
  position: relative;
  display: inline-block;
  width: 100%;
  transition: all 0.3s ease;
}

.book-image-container:hover {
  transform: translateY(-5px);
}

.book-card img {
  width: 100%;
  margin: auto;
  height: 100%;
  object-fit: cover;
  box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  display: block;
}

.delete-book-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  color: rgba(0, 0, 0, 0.3);
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 0;
  padding-bottom: 4px;
}

.book-image-container:hover .delete-book-btn {
  opacity: 1;
}

.delete-book-btn:hover {
  color: var(--red);
}

.title {
  font-size: 1rem;
  font-weight: bold;
  margin: 0.3rem 0;
}

.author {
  font-size: 0.9rem;
  margin: 0;
  color: var(--text-secondary);
}

.rating {
  color: var(--accent-1);
}

@media screen and (max-width: 1000px) {
  #book-container {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media screen and (max-width: 800px) {
  #book-container {
    grid-template-columns: repeat(4, 1fr);
  }
}
