/* POJOK BACA DIGITAL — MAIN STYLESHEET */
:root {
  --primary-color: #1266E8;
  --primary-hover: #0d52be;
  --primary-light: #EAF4FF;
  --text-main: #12213A;
  --text-muted: #64748B;
  --bg-soft: #F6F8FC;
  --bg-white: #FFFFFF;
  --success-color: #10B981;
  --danger-color: #EF4444;
  --warning-color: #F59E0B;
  --border-color: #E2E8F0;
  --card-radius: 16px;
  --pill-radius: 50px;
  --shadow-sm: 0 2px 8px rgba(18, 33, 58, 0.04);
  --shadow-md: 0 6px 20px rgba(18, 102, 232, 0.08);
  --shadow-lg: 0 12px 32px rgba(18, 33, 58, 0.12);
  --font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  font-family: var(--font-family);
  color: var(--text-main);
  background-color: var(--bg-soft);
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6, .fw-bold {
  color: var(--text-main);
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: all 0.2s ease-in-out;
}

a:hover {
  color: var(--primary-hover);
}

/* NAVBAR */
.navbar-custom {
  background-color: var(--bg-white);
  box-shadow: var(--shadow-sm);
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #1266E8 0%, #00B4D8 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 4px 10px rgba(18, 102, 232, 0.3);
}

.navbar-nav .nav-link {
  font-weight: 600;
  color: #475569;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.2s;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--primary-color);
  background-color: var(--primary-light);
}

.navbar-search-box {
  position: relative;
  max-width: 320px;
}

.navbar-search-box input {
  padding-left: 2.2rem;
  border-radius: var(--pill-radius);
  border: 1px solid var(--border-color);
  font-size: 0.88rem;
  background-color: var(--bg-soft);
  transition: all 0.2s;
}

.navbar-search-box input:focus {
  background-color: #fff;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(18, 102, 232, 0.15);
}

.navbar-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94A3B8;
  font-size: 0.95rem;
}

/* BUTTONS */
.btn-primary-custom {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
  font-weight: 600;
  border-radius: var(--pill-radius);
  padding: 0.6rem 1.4rem;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(18, 102, 232, 0.25);
}

.btn-primary-custom:hover,
.btn-primary-custom:focus {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(18, 102, 232, 0.35);
}

.btn-outline-custom {
  border: 1.5px solid var(--primary-color);
  color: var(--primary-color);
  font-weight: 600;
  border-radius: var(--pill-radius);
  padding: 0.55rem 1.3rem;
  background-color: transparent;
  transition: all 0.2s ease;
}

.btn-outline-custom:hover {
  background-color: var(--primary-color);
  color: #fff;
  transform: translateY(-2px);
}

/* HERO SECTION */
.hero-section {
  padding: 3.5rem 0 2.5rem;
  position: relative;
}

.hero-card {
  background: linear-gradient(135deg, #FFFFFF 0%, #F0F6FF 100%);
  border-radius: 28px;
  border: 1px solid rgba(18, 102, 232, 0.12);
  padding: 3rem 3.5rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.hero-title {
  font-size: 2.85rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-main);
  margin-bottom: 1.25rem;
}

.hero-description {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 500px;
}

.hero-search-form {
  background: #fff;
  border-radius: var(--pill-radius);
  padding: 6px 8px 6px 20px;
  border: 1.5px solid #E2E8F0;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  max-width: 540px;
}

.hero-search-form input {
  border: none;
  outline: none;
  font-size: 1rem;
  width: 100%;
  color: var(--text-main);
}

.hero-search-form input::placeholder {
  color: #94A3B8;
}

.hero-img-wrap {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 4px solid #fff;
}

/* CATEGORY PILL FILTER */
.category-filter-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0.5rem 0.2rem 1.5rem;
  scrollbar-width: thin;
}

.category-pill {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.55rem 1.25rem;
  border-radius: var(--pill-radius);
  background-color: #fff;
  color: #475569;
  border: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.category-pill:hover,
.category-pill.active {
  background-color: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(18, 102, 232, 0.25);
  transform: translateY(-2px);
}

/* BOOK CARDS */
.book-card {
  background: var(--bg-white);
  border-radius: var(--card-radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease-in-out;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.book-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: rgba(18, 102, 232, 0.3);
}

.book-cover-container {
  aspect-ratio: 3/4;
  position: relative;
  background-color: #F1F5F9;
  overflow: hidden;
}

.book-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.book-card:hover .book-cover-img {
  transform: scale(1.03);
}

.book-badge-format {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: rgba(239, 68, 68, 0.92);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(4px);
}

.book-badge-featured {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(245, 158, 11, 0.95);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.book-info-body {
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.book-category-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.book-card-title {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.35rem;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.7em;
}

.book-card-author {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-card-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #F1F5F9;
  padding-top: 0.75rem;
  font-size: 0.82rem;
  color: #64748B;
}

/* SECTION HEADERS */
.section-header-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-main);
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-view-all {
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* READER VIEW */
.reader-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #2F3337;
  overflow: hidden;
}

.reader-header {
  background-color: #1E2226;
  color: #fff;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #3A3F45;
  z-index: 10;
}

.reader-toolbar {
  background-color: #262A2E;
  color: #fff;
  padding: 0.5rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border-bottom: 1px solid #3A3F45;
  flex-wrap: wrap;
}

.reader-viewport {
  flex-grow: 1;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px;
  position: relative;
}

#pdf-canvas {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  max-width: 100%;
  background-color: #fff;
  border-radius: 4px;
}

.reader-nav-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(30, 34, 38, 0.75);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 20;
}

.reader-nav-btn:hover {
  background: var(--primary-color);
  color: #fff;
}

.reader-nav-prev { left: 24px; }
.reader-nav-next { right: 24px; }

/* ADMIN SIDEBAR & LAYOUT */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 260px;
  background-color: #0F172A;
  color: #94A3B8;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: all 0.3s;
  border-right: 1px solid #1E293B;
}

.admin-sidebar-header {
  padding: 1.4rem 1.25rem;
  border-bottom: 1px solid #1E293B;
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-nav-item {
  color: #94A3B8;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  font-size: 0.92rem;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.admin-nav-item:hover {
  color: #F8FAFC;
  background-color: rgba(255, 255, 255, 0.05);
}

.admin-nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(18, 102, 232, 0.2) 0%, rgba(18, 102, 232, 0.05) 100%);
  border-left-color: var(--primary-color);
  font-weight: 600;
}

.admin-content-area {
  flex-grow: 1;
  background-color: #F8FAFC;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.admin-topbar {
  background-color: #fff;
  border-bottom: 1px solid #E2E8F0;
  padding: 0.85rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-card {
  background: #fff;
  border-radius: var(--card-radius);
  border: 1px solid #E2E8F0;
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* FOOTER */
.footer-custom {
  background-color: #fff;
  border-top: 1px solid var(--border-color);
  padding: 3.5rem 0 1.5rem;
  margin-top: auto;
}

@media (max-width: 768px) {
  .hero-title { font-size: 2rem; }
  .hero-card { padding: 1.75rem; }
  .admin-sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    z-index: 1040;
  }
  .admin-sidebar.show {
    left: 0;
  }
  .reader-nav-btn { display: none; }
}
