/* Vintage wallpaper pattern */
body {
  background-color: #F9F8F6;
  color: #0F172A;
  font-size: 16px;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4b895' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Modern Scandinavian Bookshelf */
.shelf-row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 20px;
  padding: 0 40px 15px;
  margin-bottom: 60px;
  position: relative;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 640px) {
  .shelf-row {
    gap: 15px;
    padding: 0 15px 15px;
    margin-bottom: 45px;
  }
}

/* The wooden plank */
.shelf-row::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(to bottom, #E2D1C3, #D4B895);
  border-radius: 10px;
  box-shadow: 
    inset 0 2px 4px rgba(255,255,255,0.7),
    0 10px 20px rgba(176, 141, 106, 0.15);
  z-index: 1;
}

/* Shadow cast by the shelf on the wall */
.shelf-row::before {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 20px;
  right: 20px;
  height: 20px;
  background: rgba(0,0,0,0.05);
  filter: blur(10px);
  z-index: 0;
}

/* Modern Textbook Design */
.book {
  width: 140px;
  height: 200px;
  border-radius: 6px 12px 12px 6px;
  box-shadow: 
    inset 4px 0 10px rgba(0,0,0,0.1),
    inset -1px 0 2px rgba(255,255,255,0.3),
    -5px 5px 15px rgba(0,0,0,0.1);
  cursor: pointer;
  position: relative;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: 24px 12px;
  color: white;
  z-index: 2;
  transform-origin: bottom center;
  perspective: 1000px;
}

@media (max-width: 640px) {
  .book {
    width: 110px;
    height: 160px;
    padding: 16px 8px;
  }
}

/* Clean spine */
.book-spine {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 12px;
  background: linear-gradient(to right, rgba(255,255,255,0.3), rgba(0,0,0,0.1));
  border-radius: 6px 0 0 6px;
}

.book:hover {
  transform: translateY(-25px) scale(1.02);
  z-index: 10;
  box-shadow: 
    inset 4px 0 10px rgba(0,0,0,0.1),
    -10px 15px 25px rgba(0,0,0,0.15);
}

/* Opening Animation Class */
.book.opening {
  transform: translateY(-20px) scale(1.05);
  z-index: 20;
  transition: all 0.25s ease-out;
}

.book-icon {
  font-size: 32px;
  margin-bottom: 16px;
  opacity: 0.9;
}

@media (max-width: 640px) {
  .book-icon {
    font-size: 24px;
    margin-bottom: 10px;
  }
}

.book-title {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

@media (max-width: 640px) {
  .book-title {
    font-size: 12px;
  }
}

.book-sem-badge {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.3);
}

@media (max-width: 640px) {
  .book-sem-badge {
    font-size: 9px;
    padding: 3px 8px;
    bottom: 8px;
  }
}

/* Filter Pills */
.filter-pill {
  padding: 8px 20px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 600;
  background: white;
  color: #64748B;
  border: 1px solid #E2E8F0;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.filter-pill:hover {
  background: #F8FAFC;
  color: #0F172A;
  border-color: #CBD5E1;
}
.filter-pill.active {
  background: #0F172A;
  color: white;
  border-color: #0F172A;
  box-shadow: 0 4px 12px rgba(15,23,42,0.2);
}

/* Modern Search */
.search-input {
  background: white;
  border: 2px solid transparent;
  color: #0F172A;
  transition: all 0.3s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
.search-input:focus {
  border-color: #D4B895;
  box-shadow: 0 4px 25px rgba(212, 184, 149, 0.2);
  outline: none;
}

/* Glass Modal */
#paperModal {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
#paperModal.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-content {
  transform: scale(0.98) translateY(5px);
  transition: all 0.2s ease-out;
}
#paperModal.active .modal-content {
  transform: scale(1) translateY(0);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }
