/* =====================================================================
   assets/css/style.css
   Design tokens & komponen kustom — tema "toko buku digital".
   Variabel warna (--primary, --secondary, dst) diinjeksikan dari
   tabel `settings` lewat includes/header.php agar bisa diubah admin
   tanpa mengubah file ini.
   ===================================================================== */

/* ---------------------------------------------------------------
   TYPOGRAPHY BASE
   --------------------------------------------------------------- */
body {
  font-family: var(--font-body), 'Inter', sans-serif;
  background-color: var(--background);
  color: var(--text);
  line-height: 1.6;
}

h1, h2, h3, h4, .font-display {
  font-family: var(--font-display), 'Fraunces', serif;
  color: var(--secondary);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.text-muted-slate { color: var(--muted) !important; }
.bg-paper { background-color: var(--background) !important; }
.bg-navy  { background-color: var(--secondary) !important; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ---------------------------------------------------------------
   BUTTONS
   --------------------------------------------------------------- */
.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
}
.btn-primary:hover, .btn-primary:focus {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-gold {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--secondary);
  font-weight: 600;
}
.btn-gold:hover {
  background-color: var(--accent-dark);
  border-color: var(--accent-dark);
  color: var(--secondary);
}

.btn-outline-navy {
  border: 1.5px solid var(--secondary);
  color: var(--secondary);
  font-weight: 600;
  background: transparent;
}
.btn-outline-navy:hover {
  background-color: var(--secondary);
  color: #fff;
}

.btn, .form-control, .form-select {
  border-radius: 8px;
}

/* Fokus keyboard terlihat jelas (aksesibilitas) */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------
   NAVBAR
   --------------------------------------------------------------- */
.site-topbar {
  background-color: var(--secondary);
  color: #E9ECF2;
  font-size: 0.85rem;
}
.site-topbar a { color: #E9ECF2; opacity: 0.85; }
.site-topbar a:hover { opacity: 1; }

.site-navbar {
  background-color: var(--background);
  border-bottom: 1px solid var(--border);
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.brand-logo {
  font-family: var(--font-display), 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--secondary) !important;
}
.brand-logo .accent-dot { color: var(--accent); }

.nav-link-custom {
  color: var(--text);
  font-weight: 500;
  position: relative;
  padding: 0.4rem 0.75rem;
}
.nav-link-custom::after {
  content: '';
  position: absolute;
  left: 0.75rem; right: 0.75rem; bottom: 0.1rem;
  height: 2px;
  background-color: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
.nav-link-custom:hover::after { transform: scaleX(1); }

.icon-btn {
  position: relative;
  color: var(--secondary);
  font-size: 1.25rem;
  padding: 0.3rem 0.5rem;
}
.icon-btn .badge-count {
  position: absolute;
  top: -2px; right: -2px;
  background-color: var(--accent);
  color: var(--secondary);
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.05rem 0.35rem;
  line-height: 1.4;
}

.search-pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}
.search-pill input {
  border: none;
  box-shadow: none;
}
.search-pill input:focus { box-shadow: none; }
.search-pill button {
  border: none;
  background: var(--primary);
  color: #fff;
  padding: 0 1.1rem;
}

/* ---------------------------------------------------------------
   HERO
   --------------------------------------------------------------- */
.hero {
  position: relative;
  padding: 4.5rem 0 5rem;
  background:
    radial-gradient(circle at 85% 20%, color-mix(in srgb, var(--accent) 18%, transparent) 0%, transparent 55%),
    var(--background);
  overflow: hidden;
}
.hero h1 {
  font-size: clamp(2.1rem, 4vw, 3.1rem);
  max-width: 14ch;
}
.hero p.lead-text {
  color: var(--muted);
  max-width: 46ch;
  font-size: 1.05rem;
}

.hero-shelf {
  position: relative;
  height: 340px;
}
.book-cover {
  position: absolute;
  width: 150px;
  height: 210px;
  border-radius: 4px 8px 8px 4px;
  box-shadow: 0 18px 30px -12px rgba(20, 33, 61, 0.35);
  color: #fff;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  font-family: var(--font-display), serif;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.25;
}
.book-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.book-cover .cover-label {
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 6px rgba(0,0,0,0.45);
}
.book-cover.pos-1 { top: 10px;  left: 40px;  transform: rotate(-6deg);  z-index: 1; }
.book-cover.pos-2 { top: 60px;  left: 190px; transform: rotate(4deg);   z-index: 3; }
.book-cover.pos-3 { top: 0;     left: 330px; transform: rotate(-3deg);  z-index: 2; }

@media (max-width: 991.98px) {
  .hero-shelf { display: none; }
}

/* ---------------------------------------------------------------
   TRUST STRIP
   --------------------------------------------------------------- */
.trust-strip {
  background-color: #fff;
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--secondary);
  font-weight: 600;
  font-size: 0.92rem;
}
.trust-item i { color: var(--primary); font-size: 1.3rem; }

/* ---------------------------------------------------------------
   HOME BANNER SLIDER
   --------------------------------------------------------------- */
.home-banner-slider {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(20, 33, 61, 0.12);
}
.home-banner-slider img {
  width: 100%;
  aspect-ratio: 3 / 1;
  object-fit: cover;
  display: block;
}
.home-banner-slider .carousel-indicators {
  margin-bottom: 0.75rem;
}
.home-banner-slider .carousel-indicators [data-bs-target] {
  background-color: var(--accent);
}
@media (max-width: 767.98px) {
  .home-banner-slider img { aspect-ratio: 16 / 9; }
}

/* ---------------------------------------------------------------
   SECTION HEADING
   --------------------------------------------------------------- */
.section-heading {
  margin-bottom: 2rem;
}
.section-heading h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  margin-bottom: 0.35rem;
}
.section-heading p {
  color: var(--muted);
  margin-bottom: 0;
}

/* ---------------------------------------------------------------
   CATEGORY PILLS
   --------------------------------------------------------------- */
.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  color: var(--secondary);
  font-weight: 600;
  font-size: 0.9rem;
  background: #fff;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.category-pill:hover {
  border-color: var(--accent);
  background-color: var(--accent);
  color: var(--secondary);
}

/* ---------------------------------------------------------------
   EBOOK CARD
   --------------------------------------------------------------- */
.ebook-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.ebook-card:hover {
  box-shadow: 0 14px 28px -16px rgba(20, 33, 61, 0.28);
  transform: translateY(-3px);
}

.ebook-cover-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  background: linear-gradient(160deg, var(--secondary), #24365e);
  display: flex;
  align-items: flex-end;
  padding: 0.9rem;
}
.ebook-cover-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ebook-cover-wrap .cover-title {
  position: relative;
  z-index: 2;
  color: #fff;
  font-family: var(--font-display), serif;
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.25;
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.ribbon-badge {
  position: absolute;
  top: 12px;
  left: -6px;
  background-color: var(--accent);
  color: var(--secondary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.7rem 0.25rem 0.9rem;
  z-index: 3;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 8px 50%);
}

.ebook-card-body {
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.ebook-category-label {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.ebook-title {
  font-weight: 600;
  color: var(--secondary);
  font-size: 0.98rem;
  margin-bottom: 0.4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ebook-rating {
  color: var(--accent-dark);
  font-size: 0.82rem;
  margin-bottom: 0.6rem;
}
.ebook-rating .bi-star-fill,
.ebook-rating .bi-star-half { color: var(--accent); }

.ebook-price-row { margin-top: auto; }
.price-old {
  color: var(--muted);
  text-decoration: line-through;
  font-size: 0.82rem;
  margin-right: 0.4rem;
}
.price-now {
  color: var(--secondary);
  font-weight: 700;
  font-size: 1.05rem;
}

/* ---------------------------------------------------------------
   PROMO BANNER
   --------------------------------------------------------------- */
.promo-banner {
  background-color: var(--secondary);
  border-radius: 14px;
  color: #fff;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}
.promo-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 10%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 60%);
}
.promo-banner .promo-content { position: relative; z-index: 2; }
.promo-banner h3 { color: #fff; }
.promo-banner p { color: #C9D2E3; }

/* ---------------------------------------------------------------
   TESTIMONIALS
   --------------------------------------------------------------- */
.testimonial-card {
  background: #fff;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 1.5rem;
  height: 100%;
}
.testimonial-card .bi-quote {
  font-size: 1.6rem;
  color: var(--accent);
}
.testimonial-name {
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 0;
}

/* ---------------------------------------------------------------
   FAQ ACCORDION
   --------------------------------------------------------------- */
.accordion-custom .accordion-item {
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
}
.accordion-custom .accordion-button {
  background: transparent;
  font-weight: 600;
  color: var(--secondary);
  padding-left: 0;
  padding-right: 0;
}
.accordion-custom .accordion-button:not(.collapsed) {
  color: var(--primary);
  box-shadow: none;
  background: transparent;
}
.accordion-custom .accordion-button:focus { box-shadow: none; }
.accordion-custom .accordion-body {
  padding-left: 0;
  padding-right: 0;
  color: var(--muted);
}

/* ---------------------------------------------------------------
   FOOTER
   --------------------------------------------------------------- */
.site-footer {
  background-color: var(--secondary);
  color: #C9D2E3;
  padding: 3.5rem 0 0;
}
.site-footer h6 {
  color: #fff;
  font-weight: 700;
  margin-bottom: 1.1rem;
  font-size: 0.95rem;
}
.site-footer a { color: #C9D2E3; }
.site-footer a:hover { color: var(--accent); }
.site-footer .footer-brand {
  font-family: var(--font-display), serif;
  color: #fff;
  font-size: 1.4rem;
  font-weight: 600;
}
.site-footer .social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  color: #fff;
  margin-right: 0.5rem;
}
.site-footer .social-icon:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--secondary);
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  margin-top: 2.5rem;
  padding: 1.25rem 0;
  font-size: 0.85rem;
  color: #9FADC7;
}

/* ---------------------------------------------------------------
   MISC
   --------------------------------------------------------------- */
.auth-card { max-width: 440px; margin: 60px auto; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* =====================================================================
   ADMIN LAYOUT
   ===================================================================== */
.admin-body {
  background-color: #F1F3F7;
  font-family: var(--font-body), 'Inter', sans-serif;
}

.admin-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 240px;
  background-color: var(--secondary);
  color: #C9D2E3;
  overflow-y: auto;
  z-index: 1030;
}
.admin-sidebar .sidebar-brand {
  font-family: var(--font-display), serif;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 600;
  padding: 1.25rem 1.25rem;
  display: block;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.admin-sidebar .nav-link {
  color: #C9D2E3;
  padding: 0.65rem 1.25rem;
  font-size: 0.92rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-left: 3px solid transparent;
}
.admin-sidebar .nav-link i { font-size: 1.05rem; width: 20px; }
.admin-sidebar .nav-link:hover { background-color: rgba(255,255,255,0.06); color: #fff; }
.admin-sidebar .nav-link.active {
  background-color: rgba(227, 178, 60, 0.12);
  color: var(--accent);
  border-left-color: var(--accent);
}
.admin-sidebar .nav-link.disabled {
  color: #6B7A99;
  pointer-events: none;
}
.admin-sidebar .nav-section-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6B7A99;
  padding: 1rem 1.25rem 0.35rem;
}
.admin-sidebar .badge-soon {
  font-size: 0.62rem;
  background-color: rgba(255,255,255,0.12);
  color: #C9D2E3;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-left: auto;
}

.admin-main {
  margin-left: 240px;
  min-height: 100vh;
}
.admin-topbar {
  background-color: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-content { padding: 1.75rem; }

@media (max-width: 991.98px) {
  .admin-sidebar { transform: translateX(-100%); transition: transform 0.2s ease; }
  .admin-sidebar.show { transform: translateX(0); }
  .admin-main { margin-left: 0; }
}

.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.4rem;
}
.stat-card .stat-value {
  font-family: var(--font-display), serif;
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--secondary);
}
.stat-card .stat-label { color: var(--muted); font-size: 0.85rem; }
.stat-card .stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  background-color: rgba(20, 33, 61, 0.08);
  color: var(--primary);
}

.admin-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.admin-card .admin-card-header {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-card .admin-card-body { padding: 1.4rem; }

.table-admin thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  border-bottom-width: 1px;
  white-space: nowrap;
}
.table-admin td { vertical-align: middle; }
.table-admin .thumb-sm {
  width: 44px; height: 58px;
  object-fit: cover;
  border-radius: 4px;
  background-color: var(--secondary);
}

.status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
}
.status-badge.status-published { background-color: rgba(22,163,74,0.12); color: #16A34A; }
.status-badge.status-draft { background-color: rgba(107,114,128,0.14); color: #6B7280; }
.status-badge.status-inactive { background-color: rgba(220,38,38,0.12); color: #DC2626; }

/* =====================================================================
   CATALOG (public listing)
   ===================================================================== */
.catalog-filter-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
}
.catalog-filter-card .form-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--secondary);
}
.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.breadcrumb-custom {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.breadcrumb-custom a { color: var(--muted); }
.breadcrumb-custom a:hover { color: var(--primary); }

.pagination-custom .page-link {
  color: var(--secondary);
  border-color: var(--border);
}
.pagination-custom .page-item.active .page-link {
  background-color: var(--primary);
  border-color: var(--primary);
}

/* =====================================================================
   EBOOK DETAIL
   ===================================================================== */
.detail-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  background: linear-gradient(160deg, var(--secondary), #24365e);
  display: flex;
  align-items: flex-end;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px -20px rgba(20,33,61,0.4);
}
.detail-cover img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.detail-cover .cover-title {
  position: relative; z-index: 2;
  color: #fff;
  font-family: var(--font-display), serif;
  font-weight: 600;
  font-size: 1.2rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.45);
}
.detail-meta-item {
  display: flex;
  justify-content: space-between;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.detail-meta-item span:first-child { color: var(--muted); }
.detail-meta-item span:last-child { color: var(--secondary); font-weight: 600; }
