/* ==========================================================================
   1. STRUKTUR DASAR & TIPOGRAFI
   ========================================================================== */

body {
  font-family: "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #2c3e50;
  background-color: #f9f9f9;
}

.book-langs-index {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #f0f0f0;
  box-shadow: #121212 0px 0px 10px;
  color: #333;
  padding: 50px;
}

.book-langs-index .inner {
  border-radius: 20px 20px 20px 20px;
}

.book-langs-index img {
  width: 100%;
  height: auto;
  margin: 10px;
}

.book-langs-index .inner h3 {
  text-align: center;
  color: #2c3e50;
}

.book-langs-index a[href="en/"],
.book-langs-index a[href="id/"] {
  color: black;
  background-color: white;
  box-shadow: #121212 0px 0px 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: bold;
  padding: 20px;
  border-radius: 20px 20px 20px 20px;
  flex-wrap: wrap;
  height: 200px;
}

.book-langs-index a[href="en/"]:hover,
.book-langs-index a[href="id/"]:hover {
  background-color: #e0e0e0;
  transform: translateY(-5px);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: #2c3e50;
  margin-top: 24px;
  margin-bottom: 16px;
  font-weight: 600;
}

a {
  color: #1abc9c;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

pre {
  background: #2d3436;
  color: #ecf0f1;
  padding: 12px;
  overflow: auto;
  border-radius: 5px;
  font-family: "Courier New", monospace;
}

code {
  background: #dfe6e9;
  color: #2c3e50;
  padding: 2px 5px;
  border-radius: 4px;
}

/* ==========================================================================
   2. HEADER BUKU (FIXED)
   ========================================================================== */

/* .book-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 999;
  color: #000000;
} */

.book-header {
  display: none !important;
}

/* Tampilan judul di header (menimpa default GitBook yang menyembunyikannya) */
.book-header h1,
.book-header .title {
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
  font-weight: bold;
  font-size: 22px;
  padding: 10px 15px;
  margin: 0;
}

/* Wrapper logo + judul di sidebar */
.doc-title {
  display: flex;
  align-items: center;
  padding: 20px 15px;
  gap: 12px;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 10px;
}

.doc-title .logo {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.doc-title h1 {
  font-size: 20px;
  margin: 0;
  font-weight: 600;
  color: #333;
}

/* Tombol Pengaturan Font di Header */
.book-header .font-settings {
  display: flex;
  align-items: center;
  margin-right: auto;
  color: #333;
  z-index: 9999;
}

.book-header .font-settings button {
  color: #333;
  font-weight: 500;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.book-header .font-settings button:hover {
  color: #333;
}

.book-header .font-settings * {
  color: inherit !important;
}

/* ==========================================================================
   3. SIDEBAR NAVIGASI (SUMMARY)
   ========================================================================== */

.book-summary {
  background: #ffffff;
  color: #34495e;
  border-right: 1px solid #bdc3c7;
  padding: 1% 1% 0 1%;
  margin-top: 80px;
}

.book-summary ul.summary li a {
  color: #2c3e50;
  padding: 5px 15px;
  margin: 0 3px;
  display: block;
  text-decoration: none;
  border-radius: 10px;
  width: 100%;
  transition: background 0.3s, color 0.3s;
}

.book-summary ul.summary li a:hover {
  background: #f0efef;
  color: black;
  text-decoration: none;
}

/* Style untuk link yang sedang aktif di sidebar */
.book-summary ul.summary li.active > a,
.book-summary .chapter.active > a,
.book-summary .chapter.active > .chapter-title > a {
  color: #3d73dc;
  font-weight: bold;
}

.book-summary ul.summary li.active > a:hover,
.book-summary .chapter.active > a:hover,
.book-summary .chapter.active > .chapter-title > a:hover {
  background: #e8f0ff;
  color: #7f93bb;
}

.summary-group-header {
  font-size: 14px;
  text-transform: uppercase;
  font-weight: bold;
  padding: 12px 20px 4px 20px;
  color: #6c757d;
  border-top: 1px solid #dee2e6;
}

/* Ikon di sidebar */
.summary-icon {
  width: 1.25em;
  min-width: 1.25em;
  display: inline-block;
  text-align: center;
  margin-right: 0.5em;
  color: #555;
  opacity: 0.9;
}

/* Collapsible Menu di Sidebar */
.chapter-title {
  display: flex;
  align-items: center;
}

.has-children > .chapter-title {
  justify-content: space-between;
  cursor: pointer;
}

.toggle-btn {
  font-size: 12px;
  margin-left: auto;
  padding-left: 10px;
  color: #888;
  transition: transform 0.2s ease;
}

.collapsible {
  display: none;
  padding-left: 20px;
}

.chapter.open > .collapsible {
  display: block;
}

.chapter.open > .chapter-title .toggle-btn {
  transform: rotate(90deg);
}

/* ==========================================================================
   4. LAYOUT & KONTEN UTAMA
   ========================================================================== */

.book-body {
  margin-top: 80px;
  padding: 24px;
  background: none !important;
}

.book-body .page-wrapper .page-inner section.normal {
  padding: 30px;
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.cover {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

iframe {
  display: flex;
  justify-content: center;
}

/* ==========================================================================
   5. KOMPONEN UI (TABEL, BLOCKQUOTE, MODAL)
   ========================================================================== */

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

th,
td {
  padding: 10px;
  border: 1px solid #bdc3c7;
}

th {
  background: #ecf0f1;
  font-weight: bold;
}

blockquote {
  border-left: 4px solid #1abc9c;
  padding-left: 16px;
  color: #555;
  background: #f1f1f1;
  margin: 20px 0;
}

@keyframes fadeIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(44, 62, 80, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 8px;
  width: 80%;
  max-height: 80%;
  overflow-y: auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  position: relative;
  animation: fadeIn 0.2s ease-out;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 20px;
  font-size: 28px;
  color: #888;
  cursor: pointer;
}

.modal-close:hover {
  color: #e74c3c;
}

.search-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.5);
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 100px;
}

.search-modal-content {
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  overflow-y: auto;
}

#modalSearchInput {
  width: 100%;
  padding: 10px 14px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-bottom: 15px;
}

#searchResultsList,
#modalSearchResults {
  list-style: none;
  padding: 0;
  margin: 0;
}

#searchResultsList li,
#modalSearchResults li {
  margin-bottom: 10px;
}

#searchResultsList li a,
#modalSearchResults li a {
  color: #1abc9c;
  font-weight: bold;
  text-decoration: none;
}

#searchResultsList li a:hover,
#modalSearchResults li a:hover {
  text-decoration: underline;
}

/* ============================= */
/* SEARCH RESULTS STYLING - CARD */
/* ============================= */

.search-results {
  padding: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.search-results-title {
  font-size: 24px;
  margin-bottom: 20px;
  color: #2c3e50;
  border-bottom: 2px solid #ddd;
  padding-bottom: 10px;
}

/* List hasil */
.search-results-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr; /* Atau bisa 1fr 1fr untuk 2 kolom */
  gap: 16px;
}

/* Kartu hasil */
.search-results-list li {
  background: #ffffff;
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  border-left: 4px solid #1abc9c; /* Aksen warna */
}

.search-results-list li:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

/* Tautan hasil */
.search-results-list li a {
  color: #1abc9c;
  font-weight: bold;
  font-size: 18px;
  text-decoration: none;
  display: block;
  margin-bottom: 6px;
}

.search-results-list li a:hover {
  text-decoration: underline;
}

/* Deskripsi atau cuplikan isi */
.search-results-list li p {
  margin: 0;
  font-size: 14px;
  color: #555;
  line-height: 1.5;
}

/* ==========================================================================
   6. KOTAK PENCARIAN (SEARCH BOX)
   ========================================================================== */

/* Gaya dasar yang berlaku untuk SEMUA kemungkinan selector kotak pencarian */
#book-search-input input[type="text"],
.custom-search-box input[type="text"],
.search-box-with-icon input {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transition: all 0.25s ease;
  font-family: "Segoe UI", sans-serif;
  box-sizing: border-box;
}

/* Gaya :focus dasar */
#book-search-input input[type="text"]:focus,
.custom-search-box input[type="text"]:focus,
.search-box-with-icon input:focus {
  outline: none;
  transform: scale(1.02);
}

/* Wrapper jika menggunakan ikon */
.search-box-with-icon {
  position: relative;
  max-width: 400px;
  margin: 16px auto;
}

.search-box-with-icon i.fa-search {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
}

.search-box-with-icon input {
  padding-left: 40px; /* Ruang untuk ikon */
}

/* ==========================================================================
   7. MODE TEMA (COLOR THEMES)
   ========================================================================== */

/* ----------------- Mode Terang / Default (Theme 0) ----------------- */
.book.color-theme-0 #book-search-input input[type="text"],
.book.color-theme-0 .custom-search-box input[type="text"],
.book.color-theme-0 .search-box-with-icon input {
  background-color: #fff;
  color: #333;
  border: 1px solid #ccc;
}

.book.color-theme-0 #book-search-input input[type="text"]:focus,
.book.color-theme-0 .custom-search-box input[type="text"]:focus,
.book.color-theme-0 .search-box-with-icon input:focus {
  border-color: #7f93bb;
  box-shadow: 0 2px 8px rgba(26, 188, 156, 0.2);
}

.book.color-theme-0 .search-box-with-icon i.fa-search {
  color: #888;
}

/* ----------------- Mode Sepia (Theme 1) ----------------- */
.book.color-theme-1 {
  background-color: #f4ecd8 !important;
  color: #5b4636 !important;
}
.book.color-theme-1 a {
  color: #b85c00 !important;
}

.book.color-theme-1 #book-search-input input[type="text"],
.book.color-theme-1 .custom-search-box input[type="text"],
.book.color-theme-1 .search-box-with-icon input {
  background-color: #fdf6e3 !important;
  color: #5b4636 !important;
  border: 1px solid #d6c6a7 !important;
  box-shadow: 0 2px 5px rgba(91, 70, 54, 0.05) !important;
}

.book.color-theme-1 #book-search-input input[type="text"]:focus,
.book.color-theme-1 .custom-search-box input[type="text"]:focus,
.book.color-theme-1 .search-box-with-icon input:focus {
  background-color: #fffaf1 !important;
  border-color: #c9a66b !important;
  box-shadow: 0 4px 12px rgba(91, 70, 54, 0.15) !important;
}

.book.color-theme-1 .search-box-with-icon i.fa-search {
  color: #a8885e !important;
}

/* ----------------- Mode Gelap (Theme 2) ----------------- */
/* ================= DARK MODE STYLING ================= */
.book.color-theme-2 {
  background-color: #121212 !important;
  color: #e0e0e0 !important;
  font-family: "Segoe UI", "Inter", sans-serif;
  transition: background-color 0.3s ease;
}

/* Link: sedikit lebih biru neon */
/* ----------------- SIDEBAR (SUMMARY) - PERBAIKAN ----------------- */
.book.color-theme-2 .book-summary {
  background: #1e1e1e !important;
  border-right: 1px solid #333333 !important;
}

/* Gaya untuk link yang TIDAK aktif */
.book.color-theme-2 .book-summary ul.summary li:not(.active) > a {
  color: #b0b0b0 !important; /* Warna abu-abu untuk link biasa */
}

/* Gaya untuk link saat di-hover (jika tidak aktif) */
.book.color-theme-2 .book-summary ul.summary li:not(.active) > a:hover {
  color: #ffffff !important;
  background: rgba(88, 166, 255, 0.1) !important;
  border-radius: 8px;
}

/* Gaya untuk link yang AKTIF (baik di li atau di chapter) */
.book.color-theme-2 .book-summary ul.summary li.active > a,
.book.color-theme-2 .book-summary .chapter.active > a,
.book.color-theme-2 .book-summary .chapter.active > .chapter-title > a {
  color: #58a6ff !important; /* Warna BIRU AKSEN untuk yang aktif */
  font-weight: bold;
  background: rgba(88, 166, 255, 0.15) !important;
  border-radius: 8px;
}

/* Gaya untuk judul dokumen di sidebar */
.book.color-theme-2 .doc-title {
  border-bottom: 1px solid #333333;
}
.book.color-theme-2 .doc-title h1 {
  color: #ffffff;
  border-bottom: none;
  padding-bottom: 0;
}

/* ================= SEARCH INPUT ================= */
.book.color-theme-2 #book-search-input input[type="text"],
.book.color-theme-2 .custom-search-box input[type="text"],
.book.color-theme-2 .search-box-with-icon input {
  background-color: #1f1f1f !important;
  color: #eee !important;
  border: 1px solid #333 !important;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
  transition: all 0.25s ease;
}

.book.color-theme-2 #book-search-input input[type="text"]:focus,
.book.color-theme-2 .custom-search-box input[type="text"]:focus,
.book.color-theme-2 .search-box-with-icon input:focus {
  background-color: #2a2a2a !important;
  border-color: #4ea5f9 !important;
  box-shadow: 0 4px 14px rgba(78, 165, 249, 0.25) !important;
  outline: none !important;
}

/* Icon pencarian */
.book.color-theme-2 .search-box-with-icon i.fa-search {
  color: #aaa !important;
}

/* ================= DROPDOWN PENGATURAN TEMA ================= */
.book.color-theme-2 .font-settings .dropdown-menu {
  background-color: #252525 !important;
  border: 1px solid #333 !important;
  border-radius: 6px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.book.color-theme-2 .font-settings .dropdown-menu li a {
  color: #ddd !important;
  padding: 10px 16px;
  display: block;
  transition: background 0.2s ease;
}

.book.color-theme-2 .font-settings .dropdown-menu li a:hover {
  background-color: #333 !important;
  border-radius: 4px;
}

/* ================= LAYOUT OVERRIDES ================= */
.book .navigation {
  display: none !important;
}

.book .book-body .body-inner {
  margin: 0 !important;
  padding: 0 !important;
}

.book .book-body .page-wrapper .page-inner {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 24px !important;
  box-sizing: border-box;
}

/* Sidebar aktif */
body.with-summary .book-summary {
  display: block;
}

body.with-summary .book-body {
  margin-left: 240px;
}

/* Sidebar nonaktif */
body.without-summary .book-summary {
  display: none !important;
}

body.without-summary .book-body {
  margin-left: 0 !important;
}
