/* M6.6c Phase C — TEMPORARY functional UI for Milestone 6 Shelves.
   Deliberately minimal (simple cards/lists/buttons, existing BERESTA
   conventions, no new design system) so a future designer-authored
   Figma UI can replace this presentation without touching the backend
   schema, the Shelf API contracts, or any stored user data. Shared by
   pages/shelves.html (own-shelf list) and pages/shelf.html (single
   shelf detail, both owner and public read-only views). */

[hidden] { display: none !important; }

:root {
  --page-px: 80px;
  --text:    #18181b;
  --muted:   #6b7280;
  --border:  #d6d8de;
  --border2: #e6e7eb;
}

body {
  margin: 0;
  font-family: "VelaSans", system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color: var(--text);
  background: #fff;
}

.page {
  max-width: 1280px;
  margin:    0 auto;
  padding:   40px var(--page-px) 80px;
}

.page__title {
  margin:      0 0 28px;
  font-size:   28px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.titleRow {
  display:     flex;
  align-items: center;
  gap:         14px;
  margin-bottom: 20px;
}
.titleRow .page__title { margin: 0; flex: 1; }

.backBtn {
  width: 36px; height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border2);
  background: #fff;
  cursor: pointer;
  font-weight: 900;
  flex-shrink: 0;
}
.backBtn:hover { background: #fafafa; }

.auth-gate {
  display:         flex;
  justify-content: center;
  align-items:     center;
  min-height:      400px;
}
.auth-gate__box { text-align: center; max-width: 360px; margin: 0 auto; }
.auth-gate__title { font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.auth-gate__text { color: var(--muted); font-size: 15px; margin-bottom: 24px; }

.empty-state {
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  justify-content: center;
  min-height:      240px;
  text-align:      center;
}
.empty-state__title { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.empty-state__text { color: var(--muted); font-size: 15px; }

.hint {
  font-size:  14px;
  color:      var(--muted);
  margin-top: 16px;
  min-height: 20px;
}
.hint.is-ok { color: var(--text); }
.hint.is-error { color: #c01818; font-weight: 900; }

.btn {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  padding:         10px 18px;
  border-radius:   10px;
  font-size:       14px;
  font-weight:     700;
  border:          1px solid transparent;
  cursor:          pointer;
  white-space:     nowrap;
  transition:      opacity .15s, background .15s, color .15s;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn--dark  { background: #18181b; color: #fff; }
.btn--dark:hover:not(:disabled)  { opacity: .85; }
.btn--light { background: #f4f4f5; color: #18181b; }
.btn--light:hover:not(:disabled) { opacity: .85; }
.btn--remove {
  background: #fff;
  border: 1px solid var(--border2);
  color: var(--muted);
  font-size: 16px;
  padding: 10px 14px;
}
.btn--remove:hover:not(:disabled) {
  border-color: #e5b8b8;
  color: #c01818;
  background: #fff8f8;
}

/* ── Create-shelf form (pages/shelves.html) ─────────────────────────── */
.shelf-create {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
}
.shelf-create__input {
  flex: 1;
  max-width: 420px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
}
.shelf-create__input:focus { outline: 2px solid var(--text); outline-offset: 1px; }

/* ── Shelf list / card (pages/shelves.html) ─────────────────────────── */
.shelf-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shelf-card {
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shelf-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shelf-card__title {
  font-size: 16px;
  font-weight: 800;
  flex: 1;
}

.shelf-card__badge {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.shelf-card__badge--private { background: #f4f4f5; color: var(--muted); }
.shelf-card__badge--public  { background: #e6f4ea; color: #1a7a3c; }

.shelf-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shelf-card__icon-btn {
  display:         flex;
  align-items:     center;
  justify-content: center;
  width:           36px;
  height:          36px;
  border:          1px solid var(--border2);
  border-radius:   10px;
  background:      #fff;
  color:           var(--muted);
  cursor:          pointer;
  font-weight:     900;
  flex-shrink:     0;
}
.shelf-card__icon-btn:hover:not(:disabled) { background: #f4f4f5; color: var(--text); }
.shelf-card__icon-btn:disabled { opacity: .35; cursor: default; }

/* ── Shelf detail: work list (pages/shelf.html) ─────────────────────── */
.shelf-work-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shelf-work-row {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 10px 14px;
}

.shelf-work-row__cover {
  width: 48px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  background: #e6e7eb;
  flex-shrink: 0;
  cursor: pointer;
}
.shelf-work-row__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.shelf-work-row__body { flex: 1; min-width: 0; cursor: pointer; }
.shelf-work-row__title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}
.shelf-work-row__author { font-size: 12.5px; margin-top: 2px; }

.shelf-work-row__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  :root { --page-px: 20px; }
  .shelf-card__actions { gap: 6px; }
  .shelf-work-row__author { display: none; }
}
