/* Reader Pro Shelf Multi-Select & Action Bar Enhancement */

/* Make single-book "⋯" button clearly visible on both desktop and mobile */
.shelf-screen .book-card {
  position: relative;
}

.shelf-screen .book-card .book-more {
  opacity: 0.92 !important;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

@media (prefers-color-scheme: dark) {
  .shelf-screen .book-card .book-more {
    background: rgba(34, 28, 25, 0.82);
    color: #f5ede7;
  }
}

/* Header multi-select toggle button */
.se-multiselect-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(128, 128, 128, 0.25);
  background: rgba(128, 128, 128, 0.1);
  color: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}

.se-multiselect-btn:hover {
  background: rgba(128, 128, 128, 0.18);
}

.se-multiselect-btn:active {
  transform: scale(0.97);
}

.se-multiselect-btn.is-active {
  background: #c85a32;
  border-color: #c85a32;
  color: #fff;
}

/* Multi-select mode card styling */
body.se-select-mode .shelf-screen .book-card {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  border-radius: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

body.se-select-mode .shelf-screen .book-card .book-more {
  display: none !important;
}

body.se-select-mode .shelf-screen .book-card.se-selected {
  outline: 2.5px solid #c85a32;
  outline-offset: 3px;
  transform: translateY(-2px);
}

/* Checkbox badge on book cards in multi-select mode */
.se-card-check {
  display: none;
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 20;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  background: rgba(20, 20, 20, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: background 0.15s ease, transform 0.15s ease;
}

body.se-select-mode .shelf-screen .book-card .se-card-check {
  display: inline-flex;
}

.shelf-screen .book-card.se-selected .se-card-check {
  background: #c85a32;
  border-color: #fff;
  transform: scale(1.06);
}

.se-card-check svg {
  width: 14px;
  height: 14px;
  opacity: 0;
  color: #fff;
  transition: opacity 0.12s ease;
}

.shelf-screen .book-card.se-selected .se-card-check svg {
  opacity: 1;
}

/* Floating bottom action bar in multi-select mode */
.se-action-bar {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(120%);
  z-index: 9500;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: calc(100vw - 24px);
  padding: 10px 14px;
  border-radius: 20px;
  background: rgba(255, 252, 249, 0.92);
  color: #241c18;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
  opacity: 0;
  pointer-events: none;
}

@media (prefers-color-scheme: dark) {
  .se-action-bar {
    background: rgba(36, 29, 25, 0.92);
    color: #f6efe9;
    border-color: rgba(255, 255, 255, 0.12);
  }
}

.se-action-bar.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.se-bar-count {
  font-size: 13px;
  font-weight: 600;
  padding: 0 6px;
  opacity: 0.85;
}

.se-bar-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(128, 128, 128, 0.25);
  background: rgba(128, 128, 128, 0.1);
  color: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.se-bar-btn:hover:not(:disabled) {
  background: rgba(128, 128, 128, 0.2);
}

.se-bar-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.se-bar-btn.is-danger {
  background: #d64545;
  border-color: #d64545;
  color: #fff;
  font-weight: 600;
}

.se-bar-btn.is-danger:hover:not(:disabled) {
  background: #be3737;
}

.se-bar-btn.is-primary {
  background: #c85a32;
  border-color: #c85a32;
  color: #fff;
  font-weight: 600;
}

/* Toast notification */
.se-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 9999;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(28, 24, 22, 0.92);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.se-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
