/* ============================================================
   STYLE.CSS — Layout utama & komponen (mobile-first)
   ============================================================ */

/* ---------- Utility ---------- */
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 1.25rem; }
.text-center { text-align: center; }
.section { padding: 3rem 0; }
.section-header { margin-bottom: 1.75rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.section-header h2 { font-size: 1.5rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 0.6rem; }
.section-header h2 i { color: var(--primary); }
.section-link { color: var(--primary); font-weight: 600; font-size: 0.9rem; white-space: nowrap; }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
  height: var(--header-height);
}
.navbar-container {
  max-width: 1280px; margin: 0 auto; padding: 0 1.25rem; height: 100%;
  display: flex; align-items: center; justify-content: space-between;
}
.navbar-brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1.15rem; color: var(--primary); }
.navbar-brand i { font-size: 1.4rem; }
.navbar-toggle {
  display: flex; background: none; border: none; font-size: 1.4rem; color: var(--text);
  width: 48px; height: 48px; align-items: center; justify-content: center; border-radius: var(--radius-sm); cursor: pointer;
}
.navbar-toggle:hover { background: var(--border); }

.navbar-menu {
  position: fixed; top: var(--header-height); left: 0; right: 0; bottom: 0;
  background: var(--card);
  display: flex; flex-direction: column; gap: 0.25rem; padding: 1.25rem;
  transform: translateX(-100%); transition: transform 0.3s ease;
  overflow-y: auto;
}
.navbar-menu.open { transform: translateX(0); }
.navbar-menu a {
  padding: 0.85rem 1rem; border-radius: var(--radius-sm); font-weight: 500; min-height: 48px; display: flex; align-items: center; gap: 0.5rem;
}
.navbar-menu a:hover { background: var(--bg); }
.btn-nav-outline, .btn-nav-solid {
  text-align: center; border: 1.5px solid var(--primary); color: var(--primary) !important;
}
.btn-nav-solid { background: var(--primary); color: #fff !important; border-color: var(--primary); }
.theme-toggle {
  width: 48px; height: 48px; border-radius: var(--radius-full); border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-size: 1.1rem; cursor: pointer; align-self: flex-start;
  display: flex; align-items: center; justify-content: center; margin-top: 0.5rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0 1.5rem; border-radius: var(--radius-sm);
  font-family: var(--font-base); font-weight: 600; font-size: 1rem; border: none; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { min-height: 40px; padding: 0 1rem; font-size: 0.875rem; }
.btn-block { width: 100%; }
.btn-icon { width: 48px; height: 48px; padding: 0; border-radius: var(--radius-full); }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  border: 1px solid var(--border); overflow: hidden;
}
.card-body { padding: 1.25rem; }

/* ---------- Hero Slider ---------- */
.hero-slider { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); margin: 1.5rem 0; }
.hero-slides { display: flex; transition: transform 0.5s ease; }
.hero-slide {
  min-width: 100%; aspect-ratio: 16/9; position: relative; background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: flex-end; padding: 1.5rem;
}
.hero-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.35; }
.hero-slide-content { position: relative; color: #fff; z-index: 1; max-width: 32rem; }
.hero-slide-content h2 { font-size: 1.4rem; margin: 0 0 0.4rem; font-weight: 700; }
.hero-slide-content p { margin: 0 0 1rem; opacity: 0.92; font-size: 0.95rem; }
.hero-dots { position: absolute; bottom: 0.75rem; right: 1rem; display: flex; gap: 0.4rem; z-index: 2; }
.hero-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.5); cursor: pointer; border: none; }
.hero-dot.active { background: #fff; width: 22px; border-radius: var(--radius-full); }

/* ---------- Search Bar ---------- */
.search-bar { display: flex; gap: 0.5rem; margin: 1.5rem 0; }
.search-bar input {
  flex: 1; min-height: 48px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  padding: 0 1rem; font-size: 16px; background: var(--card); color: var(--text); font-family: var(--font-base);
}
.search-bar input:focus { outline: none; border-color: var(--primary); }
#searchResults {
  position: relative; margin-top: 0.5rem;
}
.search-suggestions {
  position: absolute; top: 0; left: 0; right: 0; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md); z-index: 50; max-height: 22rem; overflow-y: auto;
}
.search-suggestion-item { display: flex; gap: 0.75rem; padding: 0.75rem 1rem; align-items: center; }
.search-suggestion-item:hover { background: var(--bg); }
.search-suggestion-item img { width: 40px; height: 56px; object-fit: cover; border-radius: 4px; }

/* ---------- Category Chips ---------- */
.category-scroll { display: flex; gap: 0.75rem; overflow-x: auto; padding: 0.25rem 0.1rem 1rem; scrollbar-width: thin; }
.category-chip {
  flex: 0 0 auto; padding: 0.65rem 1.15rem; border-radius: var(--radius-full); background: var(--card);
  border: 1px solid var(--border); font-weight: 500; font-size: 0.9rem; white-space: nowrap; min-height: 44px; display:flex; align-items:center;
}
.category-chip:hover, .category-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Book Grid & Card ---------- */
.book-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.book-card {
  background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform 0.2s ease, box-shadow 0.2s ease; display: flex; flex-direction: column;
}
.book-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.book-cover-wrap { position: relative; aspect-ratio: 3/4; background: var(--bg); overflow: hidden; }
.book-cover-wrap img { width: 100%; height: 100%; object-fit: cover; }
.book-badge {
  position: absolute; top: 0.5rem; left: 0.5rem; background: var(--success); color: #fff; font-size: 0.7rem;
  padding: 0.2rem 0.55rem; border-radius: var(--radius-full); font-weight: 600;
}
.book-fav-btn {
  position: absolute; top: 0.5rem; right: 0.5rem; width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.9); border: none; display: flex; align-items: center; justify-content: center; cursor: pointer;
  color: var(--danger); font-size: 1rem; box-shadow: var(--shadow-sm);
}
.book-fav-btn.active i { font-weight: 900; }
.book-info { padding: 0.85rem; flex: 1; display: flex; flex-direction: column; gap: 0.3rem; }
.book-title { font-size: 0.95rem; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-author { font-size: 0.8rem; color: var(--text-muted); }
.book-meta { display: flex; align-items: center; justify-content: space-between; margin-top: auto; font-size: 0.78rem; color: var(--text-muted); }
.book-rating { display: flex; align-items: center; gap: 0.25rem; color: var(--warning); font-weight: 600; }

/* Skeleton loading */
.skeleton { background: linear-gradient(90deg, var(--border) 25%, var(--bg) 37%, var(--border) 63%); background-size: 400% 100%; animation: skeleton-loading 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes skeleton-loading { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.skeleton-card { aspect-ratio: 3/4; border-radius: var(--radius); }

/* ---------- Announcement ---------- */
.announcement-box {
  background: linear-gradient(135deg, rgba(37,99,235,0.08), rgba(14,165,233,0.08));
  border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; display: flex; gap: 1rem; align-items: flex-start;
}
.announcement-box i { font-size: 1.5rem; color: var(--primary); }

/* ---------- Footer ---------- */
.site-footer { background: var(--card); border-top: 1px solid var(--border); margin-top: 3rem; }
.footer-container { max-width: 1280px; margin: 0 auto; padding: 2.5rem 1.25rem 1.5rem; display: grid; grid-template-columns: 1fr; gap: 2rem; }
.footer-col h3, .footer-col h4 { margin: 0 0 0.75rem; }
.footer-col p { color: var(--text-muted); font-size: 0.9rem; margin: 0.3rem 0; }
.footer-col a { display: block; color: var(--text-muted); padding: 0.3rem 0; font-size: 0.9rem; }
.footer-col a:hover { color: var(--primary); }
.footer-social { display: flex; gap: 0.75rem; margin-top: 0.75rem; }
.footer-social a { width: 40px; height: 40px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.footer-bottom { text-align: center; padding: 1rem; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.85rem; }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed; bottom: 1.5rem; right: 1.5rem; width: 48px; height: 48px; border-radius: 50%;
  background: var(--primary); color: #fff; border: none; box-shadow: var(--shadow-md); cursor: pointer;
  display: none; align-items: center; justify-content: center; font-size: 1.1rem; z-index: 90;
}
.back-to-top.visible { display: flex; }

/* ---------- Auth pages ---------- */
.auth-wrapper { min-height: calc(100vh - var(--header-height)); display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 26rem; padding: 2rem; }
.auth-card h1 { font-size: 1.4rem; margin-top: 0; text-align: center; }
.auth-card .subtitle { text-align: center; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }
.auth-footer-link { text-align: center; margin-top: 1.25rem; font-size: 0.9rem; color: var(--text-muted); }
.auth-footer-link a { color: var(--primary); font-weight: 600; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: var(--text-muted); margin: 1rem 0; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { opacity: 0.5; }
.breadcrumb .current { color: var(--text); font-weight: 500; }

/* ---------- Book Detail ---------- */
.book-detail-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.book-detail-cover { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); aspect-ratio: 3/4; }
.book-detail-info h1 { font-size: 1.5rem; margin: 0 0 0.5rem; }
.book-detail-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tag { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-full); padding: 0.3rem 0.75rem; font-size: 0.8rem; }
.book-detail-meta-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin: 1.25rem 0; }
.meta-item { background: var(--bg); border-radius: var(--radius-sm); padding: 0.75rem; }
.meta-item .label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.meta-item .value { font-weight: 600; margin-top: 0.15rem; }
.book-detail-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.25rem; }
.star-rating { display: inline-flex; gap: 0.25rem; font-size: 1.4rem; color: var(--border); cursor: pointer; }
.star-rating i.active, .star-rating:hover i { color: var(--warning); }

/* Comments */
.comment-item { display: flex; gap: 0.75rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.comment-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.comment-content { flex: 1; }
.comment-meta { font-size: 0.8rem; color: var(--text-muted); }

/* ---------- Toast ---------- */
.toast-container { position: fixed; top: calc(var(--header-height) + 0.75rem); right: 1rem; left: 1rem; z-index: 200; display: flex; flex-direction: column; gap: 0.6rem; align-items: flex-end; pointer-events: none; }
.toast {
  pointer-events: auto; background: var(--card); border-left: 4px solid var(--primary); box-shadow: var(--shadow-lg);
  border-radius: var(--radius-sm); padding: 0.85rem 1rem; display: flex; align-items: center; gap: 0.6rem;
  min-width: 16rem; max-width: 22rem; font-size: 0.9rem; animation: toast-in 0.25s ease;
}
.toast.success { border-color: var(--success); }
.toast.danger { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ---------- Loading Spinner ---------- */
.spinner { width: 2.5rem; height: 2.5rem; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; margin: 2rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-bar-track { width: 100%; height: 6px; background: var(--border); border-radius: var(--radius-full); overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--primary); transition: width 0.2s ease; }

/* Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state i { font-size: 3rem; opacity: 0.4; margin-bottom: 0.75rem; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 0.4rem; margin-top: 2rem; flex-wrap: wrap; }
.pagination button {
  min-width: 44px; min-height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--card);
  cursor: pointer; font-weight: 600; color: var(--text);
}
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
