/* book-display.css - My collection viewer styling */

/* Page container */
body.books-page #container {
  max-width: 1280px;
  width: 1280px;
  margin: 1em auto;
}

body.books-page #content {
  padding: 10px 0;
}

body.books-page h1 {
  padding-left: 8px;
  margin-bottom: 10px;
}

body.books-page #footer {
  padding: 10px 5px;
}

/* Collection container */
.book-collection {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

/* Filters area */
.book-filters {
  margin: 0 5px 1em 5px;
  padding: 1em;
  background-color: #f7f7f7;
  border-radius: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  align-items: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.07);
}

.search-input {
  flex: 1;
  min-width: 200px;
}

.book-filters input[type="text"] {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 1em;
}

.book-filters select {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background-color: white;
  min-width: 150px;
}

.book-filters button {
  padding: 8px 12px;
  background-color: #3a78a7;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-weight: bold;
}

.book-filters button:hover {
  background-color: #2c5d82;
}

/* Stats */
.book-stats {
  margin: 0 5px 1em 5px;
  font-style: italic;
  color: #555;
}

/* Table area */
.book-table-container {
  width: 100%;
  overflow-x: auto;
  margin: 0 0 1em 0;
}

/* Book table */
.book-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
  table-layout: fixed;
}

.book-table th,
.book-table td {
  box-sizing: border-box;
  padding: 8px 6px;
}

.book-table th {
  background-color: #eaeaea;
  cursor: pointer;
  text-align: left;
  border-bottom: 2px solid #ccc;
  font-weight: 600;
}

.book-table th:hover {
  background-color: #ddd;
}

.book-table td {
  border-bottom: 1px solid #eee;
  vertical-align: top;
}

.book-table tr:hover {
  background-color: #f5f8fa;
}

/* Column widths */
.book-table th:first-child,
.book-table td:first-child {
  width: 144px;
  min-width: 144px;
}

.book-table th:nth-child(2),
.book-table td:nth-child(2) {
  width: 18%;
}

.book-table th:nth-child(3),
.book-table td:nth-child(3) {
  width: 10%;
}

.book-table th:nth-child(4),
.book-table td:nth-child(4) {
  width: 10%;
}

.book-table th:nth-child(5),
.book-table td:nth-child(5) {
  width: 8%;
}

.book-table th:nth-child(6),
.book-table td:nth-child(6) {
  width: 5%;
}

.book-table th:nth-child(7),
.book-table td:nth-child(7) {
  width: 40%;
  max-width: none;
}

/* Link styling */
.digital-link {
  color: #3a78a7;
  text-decoration: none;
  padding: 3px 8px;
  background-color: #eef5fb;
  border-radius: 3px;
  display: inline-block;
  transition: background-color 0.2s;
}

.digital-link:hover {
  text-decoration: underline;
  background-color: #d9e9f7;
  transform: none;
}

.digital-unavailable {
  color: #999;
  font-style: italic;
}

/* Sort indicators */
.sort-arrow {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 5px;
}

.sort-arrow.asc {
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid #333;
}

.sort-arrow.desc {
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #333;
}

/* Notes area */
.notes-cell {
  width: auto;
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.4;
}

/* Cover images */
.book-thumbnail {
  width: 100%;
  max-width: 128px;
  height: auto;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  display: block;
  margin: 0 auto;
  transition: all 0.2s ease !important;
}

.thumbnail-cell {
  padding: 8px;
  text-align: center;
  vertical-align: middle;
  width: 128px;
  height: 170px;
}

.thumbnail-cell {
  cursor: zoom-in;
}

.thumbnail-cell:hover .book-thumbnail {
  filter: brightness(0.7) contrast(1.1);
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.3);
}

.thumbnail-placeholder {
  width: 100%;
  max-width: 128px;
  height: 170px;
  background-color: #f0f0f0;
  border: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 0.8em;
  text-align: center;
  border-radius: 3px;
  margin: 0 auto;
}

/* Export/Import buttons */
.export-import {
  margin: 15px 5px;
  display: flex;
  gap: 14px;
}

.export-import button, 
.export-import label {
  padding: 10px 15px;
  background-color: #3a78a7;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 1em;
  text-align: center;
  transition: all 0.15s ease;
}

.export-import button:hover, 
.export-import label:hover {
  background-color: #2c5c82;
  transform: translateY(-1px);
}

.export-import button:active,
.export-import label:active {
  transform: translateY(1px);
}

/* Responsive stuff */
@media only screen and (max-width: 768px) {
  .book-table {
    font-size: 0.9em;
  }
  
  .book-table th:nth-child(3),
  .book-table td:nth-child(3) {
    display: none;
  }
  
  .book-filters {
    flex-direction: column;
    align-items: stretch;
  }
}

@media only screen and (max-width: 480px) {
  .book-table th,
  .book-table td {
    padding: 8px 6px;
  }
  
  .book-table th:nth-child(3),
  .book-table td:nth-child(3),
  .book-table th:nth-child(5),
  .book-table td:nth-child(5) {
    display: none;
  }
  
  .book-table th:nth-child(4),
  .book-table td:nth-child(4) {
    font-size: 0.9em;
  }
}