/* ═══════════════════════════════════════════════════════
   book-card.css — Komponen kartu buku 3D & progress
   punyahanif.id
═══════════════════════════════════════════════════════ */

/* ── BOOK CARD ── */
.book-list-container { padding-bottom: 60px; }

.book-card {
  background: white;
  border-radius: var(--radius);
  display: flex;
  padding: 28px;
  gap: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.book-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--primary);
  border-radius: 4px 0 0 4px;
  opacity: 0;
  transition: var(--transition);
}

.book-card:hover                { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.book-card:hover::before        { opacity: 1; }

/* ── CARD LEFT (cover) ── */
.card-left { flex: 0 0 140px; }

/* ── 3D BOOK ── */
.book-wrap {
  perspective: 900px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
}

.book-3d {
  width: 130px;
  height: 173px;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateY(0deg);
  transition: transform 0.5s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.book-wrap:hover .book-3d { transform: rotateY(30deg); }

/* Punggung buku */
.book-spine {
  position: absolute;
  top: 0; left: 0;
  width: 18px; height: 100%;
  background: linear-gradient(to right, #0f1f5c, #1c2f9b);
  transform: rotateY(-90deg) translateX(-9px);
  transform-origin: left center;
  display: flex; align-items: center; justify-content: center;
  border-radius: 2px 0 0 2px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.book-wrap:hover .book-spine { opacity: 1; }

.book-spine span {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.48rem;
  font-weight: 700;
  writing-mode: vertical-rl;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Cover depan */
.cover-container {
  position: absolute;
  left: 0; top: 0;
  width: 130px; height: 173px;
  border-radius: 2px 8px 8px 2px;
  overflow: hidden;
  background: var(--primary);
  box-shadow: 4px 8px 24px rgba(0, 0, 0, 0.22);
}

/* Shine saat hover */
.cover-container::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.18) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
  pointer-events: none;
}

.book-wrap:hover .cover-container::after { transform: translateX(200%); }

.cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px;
}

.cover-placeholder-lines { width: 100%; }

.cover-line {
  height: 5px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  margin-bottom: 5px;
  transform: rotate(-5deg);
}

.cover-line:nth-child(1) { width: 90%; background: rgba(255, 255, 255, 0.35); }
.cover-line:nth-child(2) { width: 75%; }
.cover-line:nth-child(3) { width: 85%; }
.cover-line:nth-child(4) { width: 60%; }
.cover-line:nth-child(5) { width: 80%; }
.cover-line:nth-child(6) { width: 70%; }

/* Halaman-halaman */
.book-pages {
  position: absolute;
  right: 0; top: 3px;
  width: 10px; height: calc(100% - 6px);
  transform: rotateY(90deg);
  transform-origin: right center;
  background: repeating-linear-gradient(
    to bottom,
    #f5f5f5 0px, #f5f5f5 1.5px,
    #ddd 1.5px, #ddd 2px
  );
  border-radius: 0 1px 1px 0;
}

/* Shadow bawah */
.book-shadow {
  width: 130px; height: 14px;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.18) 0%, transparent 75%);
  transition: transform 0.5s ease, opacity 0.5s ease;
  margin-top: 2px;
}

.book-wrap:hover .book-shadow {
  transform: scaleX(1.25) translateX(6px);
  opacity: 0.65;
}

/* Nama penulis di bawah cover */
.book-author-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
  margin-top: 4px;
}

.lock-badge {
  position: absolute;
  bottom: 8px; right: 8px;
  background: rgba(255, 255, 255, 0.92);
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  z-index: 3;
}

/* ── PROGRESS ── */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-bar-container {
  flex: 1;
  background: #e9ecef;
  border-radius: 10px;
  height: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  background: linear-gradient(90deg, var(--primary-mid), #4f86f7);
  height: 100%;
  border-radius: 10px;
  transition: width 0.5s ease;
}

.progress-pct {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── CARD RIGHT ── */
.card-right { flex: 1; display: flex; flex-direction: column; }

.book-category-tag {
  display: inline-block;
  background: var(--accent-soft);
  color: #8a6e00;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
  width: fit-content;
}

.book-title {
  font-family: 'Lora', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
  line-height: 1.25;
}

.book-description {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.65;
  margin-bottom: 22px;
  flex: 1;
  font-style: italic;
}

.card-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: auto;
}

/* ── UNLOCK BAR ── */
.unlock-bar {
  display: flex;
  align-items: center;
  background: var(--bg-app);
  padding: 10px 14px;
  border-radius: 12px;
  flex: 1;
  border: 1.5px dashed var(--border);
  gap: 8px;
}

.unlock-bar-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.code-input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-weight: 700;
  text-transform: uppercase;
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  color: var(--primary);
  letter-spacing: 0.08em;
}

.code-input::placeholder {
  color: #b0b8c9;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  text-transform: none;
  letter-spacing: 0;
}

/* ── BUTTONS ── */
.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 11px 20px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  flex: 1;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  transition: var(--transition);
}

.btn-primary:hover { background: var(--primary-mid); transform: translateY(-1px); }

.btn-bookmark {
  background: var(--bg-app);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
}

.btn-bookmark:hover          { border-color: var(--accent); }
.btn-bookmark.active         { background: var(--accent); border-color: var(--accent); }

/* ── DARK MODE ── */
body.dark .book-card          { background: var(--bg-card); border-color: var(--border); }
body.dark .book-title         { color: var(--primary); }
body.dark .unlock-bar         { background: #1a2540; border-color: var(--border); }
body.dark .btn-bookmark       { background: #1e293b; border-color: var(--border); }
body.dark .btn-primary        { background: var(--primary); }
body.dark .progress-bar-container { background: #334155; }
