/* =========================================================
   Scrapbook — page-flip book style
   ========================================================= */

.scrap-main {
  padding: 24px 20px 96px;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.scrap-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.filter-wrap {
  margin-left: auto;
}
.filter-wrap select {
  background: var(--surface);
  border: 1.5px solid var(--rule);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
}

/* The Book */
.book {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg),
    -4px 0 0 #e8e4de,
    -8px 0 0 #ddd8d0;
  border: 1px solid var(--rule);
  overflow: hidden;
  position: relative;
  min-height: 500px;
}

/* Page */
.page {
  padding: 32px;
  animation: page-flip 0.4s ease-out both;
}

@keyframes page-flip {
  from { opacity: 0; transform: perspective(800px) rotateY(-8deg); }
  to { opacity: 1; transform: perspective(800px) rotateY(0); }
}

.page-photo-wrap {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
  background: #f0f0f0;
  position: relative;
}
.page-photo-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.06);
  pointer-events: none;
}
.page-photo {
  width: 100%;
  display: block;
  max-height: 480px;
  object-fit: contain;
  background: #fafafa;
}

.page-caption {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  text-align: center;
}

.page-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 8px;
}
.page-tag {
  font-size: 12px;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
  padding: 3px 12px;
  border-radius: 999px;
}

.page-meta {
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 500;
}

.page-number {
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 600;
  margin-top: 16px;
  font-style: italic;
  font-family: var(--font-display);
}

/* Page navigation */
.page-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid var(--rule);
  background: var(--bg);
}
.page-nav-btn {
  padding: 10px 24px;
  border: 1.5px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}
.page-nav-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.page-nav-btn:disabled { opacity: 0.3; cursor: default; }

.page-indicator {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

/* Empty state */
.book-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
  padding: 40px;
  color: var(--ink-soft);
}
.book-empty-icon { font-size: 48px; margin-bottom: 16px; }
.book-empty-text { font-size: 16px; font-weight: 500; }

/* Delete button on page */
.page-actions {
  text-align: center;
  margin-top: 12px;
}
.page-del-btn {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-body);
  padding: 4px 14px;
  border-radius: 8px;
  border: 1px solid var(--rule);
  background: transparent;
  cursor: pointer;
  color: var(--ink-soft);
  transition: all 0.15s ease;
}
.page-del-btn:hover { color: var(--rose); border-color: var(--rose); }

/* Upload modal */
.file-input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0; overflow: hidden;
}
.upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 16px;
  border: 2px dashed var(--rule);
  border-radius: 14px;
  background: var(--bg);
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: all 0.15s ease;
}
.upload-label:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.upload-icon { font-size: 28px; }
.photo-thumb {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 12px;
  margin-top: 10px;
}
.upload-status {
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 6px;
  border-radius: 8px;
}
.upload-status.uploading { color: var(--primary); background: var(--primary-light); }
.upload-status.done { color: var(--emerald); background: var(--emerald-light); }

.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.tag-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1.5px solid var(--rule);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  background: transparent;
  font-family: var(--font-body);
  color: var(--ink-soft);
}
.tag-opt:hover { border-color: var(--primary); }
.tag-opt.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.form-error {
  color: var(--rose);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

@media (max-width: 720px) {
  .scrap-main { padding: 16px 12px 64px; }
  .page { padding: 20px 16px; }
  .page-caption { font-size: 17px; }
  .page-photo { max-height: 360px; }
  .book { min-height: 400px; }
}
