/* Books Grid Layout */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

/* Book Card */
.library-container .book-card {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
  padding: 0px;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Book Cover */
.library-container .book-cover {
  position: relative;
  width: 100%;
  height: 270px;
  background: #f0f0f0;
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #999;
  background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
}

/* Book Info */
.book-info {
  padding: 15px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.book-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0;
  color: #2d3748;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-author {
  font-size: 0.85rem;
  color: #666;
  margin: 5px 0;
}

.book-series {
  font-size: 0.8rem;
  color: #667eea;
  font-style: italic;
  margin-top: 2px;
}

.book-added-by {
  font-size: 0.75rem;
  color: #999;
  margin-top: 5px;
}

/* Book Actions */
.book-actions {
  margin-top: auto;
  padding-top: 15px;
  display: flex;
  gap: 8px;
}

/* Status Badges */
.status-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(255, 255, 255, 0.95);
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  line-height: 1;
  height: auto;
  width: auto;
  margin: 0;
  z-index: 10;
}

.format-badges {
  position: absolute;
  bottom: 6px;
  right: 6px;
  display: flex;
  gap: 3px;
  background: rgba(255, 255, 255, 0.95);
  padding: 3px 5px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  height: auto;
  width: auto;
  margin: 0;
  z-index: 10;
}
.format-badges:empty {
  display: none;
}


/* In-Library Badge */
.in-library-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: #e6f7ed;
  color: #38a169;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Library Controls */
.library-controls {
  margin-bottom: 30px;
}

.search-form {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.search-input {
  flex: 1;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
}

.filter-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 768px) {
  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 15px;
  }

  .book-cover {
    height: 225px;
  }

  .book-info {
    padding: 12px;
  }
}