body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background: #f4f4f4;
}

#library-section {
  padding: 40px 20px 80px;
  max-width: 1300px;
  margin: 0 auto;
}

.empty-message {
  text-align: center;
  color: #777;
  font-size: 1.1rem;
  padding: 80px 0;
}

#library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

#library-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: #e8e8e8;
}

#library-grid img:hover {
  transform: scale(1.04);
  box-shadow: 0 0 16px goldenrod;
}

#pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 30px;
  flex-wrap: wrap;
}

#pager button {
  border: none;
  background: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

#pager button.active {
  background: #111;
  color: #fff;
}

#pager button:hover:not(.active) {
  background: #eee;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.88);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 10px;
}

.close-lightbox {
  position: absolute;
  top: 20px;
  right: 30px;
  color: lightgray;
  font-size: 32px;
  cursor: pointer;
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: lightgray;
  font-size: 28px;
  padding: 14px 18px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  user-select: none;
}

.lightbox-arrow:hover {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

@media (max-width: 768px) {
  .lightbox-arrow {
    font-size: 20px;
    padding: 10px 14px;
  }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}
