/* Bookshelf layout */
#bookshelf {
  margin: 20px;
}

#FilterBar{
    display: flex;
    background-color: #333;
    padding: 10px;
    border-radius: 15px;
    margin-bottom: 20px;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.selectDropdown p{
  color: white;
  font-weight: bold;
  margin-right: 10px;
  margin-left: 10px;
  cursor: pointer;
}

.selectDropdown {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.selectDropdown button{
  height: 35px;
  min-width: 80px;
  padding: 0 15px;
  border-radius: 10px;
  font-weight: bold;
}

.selectDropdown button:hover{
  background-color: #f0f0f0;
}

.genreSelect, .seriesSelect{
  position: absolute;
  top: 100%;
  z-index: 10;
  background: white;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 220px;
  overflow-y: auto;
  display: none;
  min-width: 200px;
  padding: 5px;
}

.sortSelect {
  position: absolute;
  top: 100%;
  z-index: 10;
  background: white;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  overflow-y: auto;
  display: none;
  min-width: 150px;
  padding: 5px;
}

.genreSelect label, .seriesSelect label {
  display: block;
  padding: 4px 8px;
  cursor: pointer;
}

.sortSelect label{
  display: block;
  padding: 4px 8px;
  cursor: pointer;
}

.genreSelect label:hover, .sortSelect label:hover, .settingsSelect label:hover{
  background-color: #f0f0f0;
}

#listtype {
    display: flex;
    justify-content: flex-end;
  text-align: center;

}

#gridBtn, #listBtn, #settingsBtn{
  display: flex;
  justify-content: center;
  align-items: center;
  height: 48px;
  width:  48px;
  padding: 10px 20px;
  margin: 0 5px;
  color: white;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid #555555;
  background-color: #333333;
  font-weight: bold;
  transition: 0.3s;
}

#gridBtn img, #listBtn img{
    display: block;

}

#listtype button:hover {
  background-color: #ddd;
}

#gridBtn.active, #listBtn.active{
    border-color: #ddd;

}

/* Book items */
.book {
  background: #fff;
  border-radius: 6px;
  padding: 12px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

/* Grid view */
.bookshelf.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
}

.bookshelf.grid .book {
  min-height: 320px;
  width: auto;
  display: flex;
  flex-direction: column;
}

.bookshelf.grid .bookInfo{
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.bookshelf.grid .book img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: fill;
  margin-bottom: 10px;
}

/* List view */
.bookshelf.list {
  display: block;
}

.bookshelf.list .book {
  display: flex;
  align-items: center;
  text-align: left;
}

.bookshelf.list .book img {
  width: 30%;
  height: 200px;
  object-fit: cover;
  margin-right: 20px;
}

.bookshelf.list .book div {
  flex: 1; /* fill remaining space next to image */
}

/* Text styles */
.title {
  margin: 10px 5px;
  font-weight: bold;
  margin-top: 4px;
  overflow: hidden;
}

.author {
  color: #555;
  overflow: hidden;
  font-size: 0.95em;
}

.year {
  color: #777;
  font-size: 0.85em;
}

.genre{
  margin: 10px 0px 5px 5px;
  color: #555;
  overflow: hidden;
  font-size: 0.95em;
  
}

.book-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.book-link:hover .book {
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transform: translateY(-2px);
  transition: 0.2s;
}

.settingsContainer {
  position: relative;
  display: flex;
  align-items: end;
  justify-content: flex-end;
}

.settingsDrop{
  position: absolute;
  top: 100%;
  z-index: 1;
  border: 2px solid #666666;
  background-color: #333333;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 220px;
  overflow-y: auto;
  display: none;
  min-width: 200px;
  padding: 5px;
}

.settingsDrop a{
  display: block;
  border-bottom: 1px solid #555555;
  color: white;
  font-size: large;
  text-decoration: none;
}

.settingsDrop a:hover{
  background-color: #555555;
}


