/* ═══════════════════════════════════════════════════
   BookVault — app.css
   Navy · Gold · Cream — Luxury Library Aesthetic
═══════════════════════════════════════════════════ */

:root {
  --navy:        #0f1e3c;
  --navy-mid:    #1a2f5a;
  --navy-light:  #243a6e;
  --gold:        #c8941a;
  --gold-light:  #f0b840;
  --cream:       #f8f5ef;
  --parchment:   #ede8dc;
  --white:       #ffffff;
  --text:        #1a1a2e;
  --muted:       #6b7280;
  --success:     #059669;
  --danger:      #dc2626;
  --border:      #e5e0d5;
  --radius:      12px;
  --shadow:      0 4px 24px rgba(15,30,60,.10);
  --shadow-lg:   0 16px 48px rgba(15,30,60,.18);
  --transition:  0.22s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Outfit', sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Nav ───────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 200;
  background: var(--navy);
  box-shadow: 0 2px 20px rgba(0,0,0,.28);
}
.nav-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; gap: 20px;
  padding: 0 32px; height: 62px;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; font-weight: 700;
  color: var(--gold-light);
  text-decoration: none;
  letter-spacing: .4px;
  flex-shrink: 0;
}
.nav-brand-icon { font-size: 20px; }
.nav-links { display: flex; gap: 4px; margin-left: 24px; }
.nav-link {
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: 14px; font-weight: 500;
  padding: 6px 14px; border-radius: 8px;
  transition: all var(--transition);
  letter-spacing: .2px;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,.1); }
.nav-link.active { color: var(--gold-light); background: rgba(200,148,26,.15); }
.nav-link-admin { color: #6ee7b7 !important; }
.nav-link-admin.active { color: #6ee7b7; background: rgba(52,211,153,.15); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.nav-user {
  display: flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,.8); font-size: 14px; font-weight: 500;
}
.nav-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gold); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.badge-admin {
  background: rgba(200,148,26,.2); border: 1px solid rgba(200,148,26,.4);
  color: var(--gold-light); font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px; letter-spacing: .5px;
  text-transform: uppercase;
}

/* ── Buttons ───────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 10px; cursor: pointer;
  font-family: 'Outfit', sans-serif; font-weight: 600;
  transition: all var(--transition); text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: var(--navy); color: #fff;
  padding: 11px 22px; font-size: 14px;
}
.btn-primary:hover { background: var(--navy-mid); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(15,30,60,.25); }
.btn-gold {
  background: var(--gold); color: var(--navy);
  padding: 11px 22px; font-size: 14px;
}
.btn-gold:hover { background: var(--gold-light); transform: translateY(-1px); }
.btn-danger {
  background: var(--danger); color: #fff;
  padding: 11px 22px; font-size: 14px;
}
.btn-danger:hover { background: #b91c1c; }
.btn-ghost {
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.75);
  border: 1px solid rgba(255,255,255,.15);
  padding: 8px 16px; font-size: 13px;
}
.btn-ghost:hover { background: rgba(255,255,255,.15); color: #fff; }
.btn-outline {
  background: transparent; color: var(--navy);
  border: 1.5px solid var(--navy);
  padding: 10px 20px; font-size: 14px;
}
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-sm { padding: 6px 14px !important; font-size: 13px !important; border-radius: 8px !important; }
.btn-lg { padding: 14px 30px !important; font-size: 16px !important; }
.btn-block { width: 100%; }

/* ── Page layout ───────────────────────────────── */
.page-body { flex: 1; }
.container { max-width: 1280px; margin: 0 auto; padding: 40px 32px; }
.container-sm { max-width: 520px; margin: 0 auto; padding: 60px 24px; }
.container-md { max-width: 800px; margin: 0 auto; padding: 40px 24px; }

/* ── Cards ─────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: 16px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-body { padding: 28px; }

/* ── Book Grid ─────────────────────────────────── */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 24px;
}
.book-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex; flex-direction: column;
}
.book-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gold);
}
.book-cover {
  width: 100%; aspect-ratio: 2/3;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  position: relative;
  overflow: hidden;
}
.book-cover img {
  width: 100%; height: 100%; object-fit: cover;
  position: absolute; inset: 0;
}
.book-cover-emoji { position: relative; z-index: 1; }
.book-info { padding: 12px 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.book-title { font-size: 13px; font-weight: 700; color: var(--navy); line-height: 1.3; }
.book-author { font-size: 11px; color: var(--muted); }
.book-rating { font-size: 11px; color: var(--gold); display: flex; align-items: center; gap: 3px; margin-top: auto; }
.book-genre { font-size: 10px; color: var(--muted); }

/* ── Star Rating ───────────────────────────────── */
.stars-display { display: flex; gap: 2px; font-size: 18px; }
.star-interactive {
  cursor: pointer; font-size: 28px;
  transition: transform var(--transition);
  user-select: none;
}
.star-interactive:hover { transform: scale(1.2); }

/* ── Search bar ────────────────────────────────── */
.search-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  padding: 52px 32px;
  position: relative; overflow: hidden;
}
.search-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(200,148,26,.12) 0%, transparent 60%);
}
.search-hero-inner { max-width: 1280px; margin: 0 auto; position: relative; }
.search-hero h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(28px, 4vw, 48px); font-weight: 700;
  color: #fff; line-height: 1.05; margin-bottom: 8px;
}
.search-hero h1 em { color: var(--gold-light); font-style: normal; }
.search-hero p { color: rgba(255,255,255,.55); font-size: 15px; margin-bottom: 28px; }
.search-row { display: flex; gap: 10px; flex-wrap: wrap; }
.search-input-wrap {
  flex: 1; min-width: 240px; max-width: 400px;
  display: flex; align-items: center; gap: 10px;
  background: #fff; border-radius: 10px;
  padding: 12px 18px;
}
.search-input-wrap input {
  border: none; background: none; outline: none;
  font-family: 'Outfit', sans-serif; font-size: 14px;
  color: var(--text); width: 100%;
}
.search-input-wrap .search-icon { color: var(--muted); font-size: 15px; }
.search-select {
  border: none; background: #fff; border-radius: 10px;
  padding: 12px 18px; font-family: 'Outfit', sans-serif;
  font-size: 14px; color: var(--text); cursor: pointer;
  outline: none;
}

/* ── Section headings ──────────────────────────── */
.section-heading {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px; font-weight: 700; color: var(--navy);
}
.results-count { font-size: 13px; color: var(--muted); }

/* ── Toast notifications ───────────────────────── */
.toast-container {
  position: fixed; top: 80px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  background: var(--white);
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  border-left: 4px solid var(--success);
  font-size: 14px; font-weight: 500;
  pointer-events: all;
  animation: toastIn .3s ease, toastOut .3s ease 3s forwards;
  max-width: 340px;
}
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--gold); }
.toast-icon { display:flex; align-items:center; flex-shrink:0; }
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--gold); }
.toast.info .toast-icon { color: var(--ajax-blue); }
@keyframes toastIn  { from { opacity:0; transform:translateX(60px); } to { opacity:1; transform:translateX(0); } }
@keyframes toastOut { from { opacity:1; transform:translateX(0); } to { opacity:0; transform:translateX(60px); } }

/* ── Forms ─────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-size: 13px; font-weight: 700;
  color: var(--navy); margin-bottom: 6px; letter-spacing: .2px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-control {
  width: 100%;
  border: 1.5px solid var(--border); border-radius: 10px;
  padding: 11px 14px; font-family: 'Outfit', sans-serif;
  font-size: 14px; color: var(--text);
  background: #fafaf8;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(15,30,60,.08);
}
.form-control.is-invalid { border-color: var(--danger); }
.form-error {
  font-size: 12px; color: var(--danger);
  margin-top: 4px; display: none;
}
.form-error.show { display: block; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
textarea.form-control { resize: vertical; min-height: 120px; }

/* ── Auth pages ────────────────────────────────── */
.auth-wrap {
  min-height: calc(100vh - 62px);
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  padding: 40px 24px;
  position: relative;
}
.auth-wrap::before {
  content: '';
  position: absolute; right: 10%; bottom: 10%;
  font-size: 180px; opacity: .05;
}
.auth-card {
  background: var(--white);
  border-radius: 20px;
  padding: 48px 44px;
  width: 100%; max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,.25);
  position: relative; z-index: 1;
}
.auth-logo { font-size: 36px; text-align: center; margin-bottom: 6px; }
.auth-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px; font-weight: 700;
  text-align: center; color: var(--navy);
  margin-bottom: 4px;
}
.auth-subtitle { font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 32px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--muted); }
.auth-footer a { color: var(--navy); font-weight: 600; text-decoration: none; }
.auth-footer a:hover { color: var(--gold); }
.alert {
  padding: 12px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 500;
  margin-bottom: 20px; display: none;
}
.alert.show { display: block; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: var(--danger); }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: var(--success); }

/* ── Book Detail ───────────────────────────────── */
.book-detail-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  padding: 48px 32px;
}
.book-detail-inner {
  max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: 200px 1fr; gap: 40px;
  align-items: start;
}
.book-cover-xl {
  width: 200px; aspect-ratio: 2/3;
  border-radius: 16px;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  display: flex; align-items: center; justify-content: center;
  font-size: 60px;
  box-shadow: 8px 12px 40px rgba(0,0,0,.4);
  overflow: hidden; position: relative;
}
.book-cover-xl img { width:100%; height:100%; object-fit:cover; position:absolute; inset:0; }
.book-cover-xl .cover-emoji { position:relative; z-index:1; }
.book-detail-meta { padding-top: 8px; }
.book-detail-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(28px, 4vw, 44px); font-weight: 700;
  color: #fff; line-height: 1.05; margin-bottom: 8px;
}
.book-detail-author { font-size: 16px; color: rgba(255,255,255,.6); margin-bottom: 16px; }
.tags-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tag {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.8); border-radius: 20px;
  padding: 4px 12px; font-size: 12px; font-weight: 500;
}
.avg-rating-display { display: flex; align-items: center; gap: 10px; }
.avg-rating-score {
  font-family: 'Cormorant Garamond', serif;
  font-size: 40px; font-weight: 700; color: var(--gold-light); line-height: 1;
}
.avg-rating-info { color: rgba(255,255,255,.5); font-size: 12px; }

/* ── Profile ───────────────────────────────────── */
.profile-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  padding: 48px 32px 40px;
}
.profile-header-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 24px; }
.profile-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--gold); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(200,148,26,.4);
}
.profile-name { font-family: 'Cormorant Garamond', serif; font-size: 32px; font-weight: 700; color: #fff; }
.profile-email { font-size: 14px; color: rgba(255,255,255,.5); margin-top: 4px; }
.profile-stats { display: flex; gap: 32px; margin-top: 16px; }
.profile-stat { text-align: center; }
.profile-stat-value { font-size: 24px; font-weight: 700; color: var(--gold-light); }
.profile-stat-label { font-size: 12px; color: rgba(255,255,255,.5); }

/* ── Readlist / Rated mini cards ───────────────── */
.mini-books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
}
.mini-book-card {
  text-decoration: none; color: inherit;
}
.mini-cover {
  width: 100%; aspect-ratio: 2/3;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  overflow: hidden; position: relative;
  margin-bottom: 6px;
}
.mini-cover img { width:100%; height:100%; object-fit:cover; position:absolute; inset:0; }
.mini-cover .mini-emoji { position:relative; z-index:1; }
.mini-title { font-size: 11px; font-weight: 700; color: var(--navy); line-height: 1.3; }
.mini-stars { font-size: 10px; color: var(--gold); }

/* ── Add/Edit book form ────────────────────────── */
.book-form-header {
  background: var(--navy); padding: 40px 32px;
}
.book-form-header-inner { max-width: 800px; margin: 0 auto; }
.book-form-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px; font-weight: 700; color: #fff;
}
.book-form-header p { color: rgba(255,255,255,.55); margin-top: 6px; }

/* ── Empty state ───────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 24px;
  color: var(--muted);
}
.empty-state-icon { font-size: 60px; margin-bottom: 16px; }
.empty-state h3 { font-size: 20px; color: var(--navy); margin-bottom: 8px; }

/* ── Spinner ───────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
.spinner-dark {
  border-color: rgba(15,30,60,.15);
  border-top-color: var(--navy);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── AJAX loading overlay for book grid ─────────── */
.grid-loading {
  opacity: .4; pointer-events: none;
  transition: opacity .2s;
}

/* ── Readlist toggle button ─────────────────────── */
.readlist-btn { transition: all var(--transition); }
.readlist-btn.in-list {
  background: #fef3c7 !important;
  color: var(--gold) !important;
  border-color: var(--gold) !important;
}

/* ── Footer ────────────────────────────────────── */
.site-footer {
  background: var(--navy); padding: 24px 32px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.footer-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.footer-brand { font-family: 'Cormorant Garamond', serif; font-size: 18px; font-weight: 700; color: var(--gold-light); }
.footer-copy { font-size: 12px; color: rgba(255,255,255,.3); }

/* ── Utility ───────────────────────────────────── */
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8  { margin-top:  8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom:  8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.divider { border:none; border-top: 1.5px solid var(--border); margin: 32px 0; }

/* ── Responsive ────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .search-row { flex-direction: column; }
  .book-detail-inner { grid-template-columns: 1fr; }
  .books-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
  .profile-stats { gap: 20px; }
}
/* ═══════════════════════════════════════════════════
   BookVault — app_additions.css
   Append to app.css or load after it
═══════════════════════════════════════════════════ */

/* ── Search Hero Background Image ─────────────── */
.search-hero-bg {
  position: relative;
  background:
    linear-gradient(135deg, rgba(15,30,60,.82) 0%, rgba(26,47,90,.88) 100%),
    url('https://images.unsplash.com/photo-1507842217343-583bb7270b66?w=1600&q=80') center/cover no-repeat;
  min-height: 260px;
}

/* Fallback pattern if image fails */
.search-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(200,148,26,.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(200,148,26,.06) 0%, transparent 40%);
  pointer-events: none;
}

.search-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 60%, rgba(15,30,60,.4));
  pointer-events: none;
}

/* ── Pagination ─────────────────────────────── */
.pagination-wrap {
  display: flex;
  justify-content: center;
  padding: 32px 0 16px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  color: var(--navy);
  font-size: 14px;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  text-decoration: none;
  transition: all .15s;
}

.page-btn:hover {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
  transform: translateY(-1px);
}

.page-btn.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  pointer-events: none;
}

.page-ellipsis {
  color: var(--muted);
  font-size: 14px;
  padding: 0 4px;
}

/* ── Registration / Auth enhancements ──────── */
.alert-success {
  display: none;
  padding: 12px 16px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 8px;
  color: #166534;
  font-size: 14px;
  margin-bottom: 16px;
}
.alert-success.show { display: block; }

/* ── Readlist grid with status ──────────────── */
.readlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.readlist-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
  transition: transform .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
}

.readlist-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.1);
}

.readlist-card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  flex: 1;
}

.readlist-card-info {
  padding: 10px 10px 4px;
}

.readlist-status-row {
  padding: 6px 10px 10px;
}

.status-select {
  width: 100%;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1.5px solid var(--status-color, #e5e7eb);
  font-size: 11px;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  color: var(--status-color, #374151);
  background: #fff;
  transition: border-color .15s;
}

.status-select:focus { outline: none; border-color: var(--navy); }

/* Status tabs */
.status-tabs { display: flex; gap: 8px; flex-wrap: wrap; }

.status-tab-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-family: 'Outfit', sans-serif;
  transition: all .15s;
}

.status-tab-btn.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.status-tab-btn:not(.active):hover {
  border-color: var(--navy);
  color: var(--navy);
}

.tab-count {
  background: rgba(0,0,0,.08);
  border-radius: 10px;
  padding: 1px 7px;
  margin-left: 4px;
  font-size: 11px;
}

.status-tab-btn.active .tab-count { background: rgba(255,255,255,.2); }

/* ── Profile edit modals ────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  animation: modalIn .2s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  color: var(--navy);
}

.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 6px;
  transition: background .15s;
}
.modal-close:hover { background: #f3f4f6; }

/* ── Comments / Reviews ─────────────────────── */
.comment-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #f3f4f6;
}

.comment-item:last-child { border-bottom: none; }

.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.comment-body-wrap { flex: 1; }

.comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.comment-author { font-weight: 600; font-size: 13px; color: var(--navy); }
.comment-date   { font-size: 12px; color: var(--muted); }
.comment-text   { font-size: 14px; line-height: 1.6; color: #374151; }

.spinner-wrap { color: var(--muted); font-size: 14px; padding: 16px 0; }

/* ── Buy Links ──────────────────────────────── */
.buy-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.buy-link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px solid #e5e7eb;
  text-decoration: none;
  transition: all .15s;
  background: #fff;
}

.buy-link-card:hover {
  border-color: var(--navy);
  background: #f5f3ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15,30,60,.1);
}

.buy-store-icon { font-size: 24px; }
.buy-store-name { font-size: 13px; font-weight: 600; color: var(--navy); }
.buy-store-sub  { font-size: 11px; color: var(--muted); }

/* ── Responsive ─────────────────────────────── */
@media (max-width: 600px) {
  .buy-links-grid { grid-template-columns: 1fr 1fr; }
  .readlist-grid  { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .modal-card     { padding: 20px; }
}

/* ── Book cover fallback letter ────────────────── */
.book-cover-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 52px; font-weight: 700;
  color: var(--gold-light);
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
}
.book-cover img {
  width: 100%; height: 100%; object-fit: cover;
  position: absolute; inset: 0;
}
.cover-fallback-letter {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 80px; font-weight: 700;
  color: var(--gold-light);
}

/* ── Buy store SVG icon ─────────────────────────── */
.buy-store-icon {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex-shrink: 0;
  color: var(--navy);
}
.buy-store-icon svg { stroke: var(--navy); }
.buy-link-card:hover .buy-store-icon svg { stroke: var(--navy-mid); }

/* ── Nav username ───────────────────────────────── */
.nav-username { color: rgba(255,255,255,.85); font-size: 14px; font-weight: 500; }

/* ── Search icon SVG ────────────────────────────── */
.search-icon svg { stroke: rgba(255,255,255,.6); display: block; }

/* Profile mini cover letter fallback */
.cover-letter-mini {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px; font-weight: 700;
  color: var(--gold-light);
  background: var(--navy);
}

/* ── Login form shake on error ── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX(8px); }
  60%       { transform: translateX(-5px); }
  80%       { transform: translateX(5px); }
}
form.shake { animation: shake 0.45s ease; }

