  html, body {
	  height: 100%;
  }

  body {
    margin: 0;
    font-family: 'Open Sans', sans-serif;
    background-color: #f9f9f9;
    color: #333;
    height: 100vh;
    display: flex;
    flex-direction: column;
  }

  /* Overlay full screen */
  #loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgb(0 0 0 / 75%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }
  /* Spinner ring minimalis */
  .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.2); /* ring tipis */
    border-top: 4px solid #3498db;           /* bagian animasi */
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
  }
  /* Loading text */
  #loadingOverlay p {
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    margin: 0;
  }
  /* Animasi putar */
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  /* Fade out overlay */
  #loadingOverlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  /* HEADER */
  header {
    background-color: #004d7a;
    padding: 12px 24px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
  }
  header img {
	height: 50px;
  }
  header p {
	margin: 0;
	font-size: 15px;
	font-weight: 800;
  }

  .main {
	flex: 1;
  }

  /* KATEGORI */
  .category {
    background-color: #ceedff;
    padding: 20px;
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    overflow-x: overlay;
    -webkit-overflow-scrolling: touch;
  }
  .category button {
      flex: 0 0 auto;
      padding: 15px 20px;
      background-color: #fff;
      border: 1px solid #e5e7eb;
      color: #3ca0db;
      border-radius: 8px;
      box-shadow: 2px 3px 5px rgba(0,0,0,0.1);
      cursor: pointer;
      font-weight: 500;
      transition: all 0.25s ease;
      white-space: nowrap;
  }
  .category::-webkit-scrollbar {
      height: 5px;
  }
  .category::-webkit-scrollbar-thumb {
      background-color: rgba(0,0,0,0.2);
      border-radius: 3px;
  }
  .category button:hover {
    background-color: #e0ebff; /* biru muda */
    color: #1e40af; /* biru lebih tua */
  }
  .category button.active {
    background-color: #3ca0db;
    color: #fff;
    box-shadow: 0 3px 6px rgba(59, 112, 229, 0.3);
    border-color: #3ca0db;
  }
  .category button:focus {
    outline: 1.5px solid #3ca0db;
    outline-offset: 0;
  }

  /* SEARCH BAR */
  .search-container {
    padding: 15px 20px;
    text-align: center;
  }
  .search-container input {
    width: 100%;
    max-width: 480px;
    padding: 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
	  outline: none;
    box-sizing: border-box;
	  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s, border-color 0.2s;
  }
  .search-container input:focus {
	border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
  }

  /* GRID KATALOG */
  .catalog {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding: 20px;
  }
  .book-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease-in-out;
	cursor: pointer;
  }
  .book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  }
  .book-cover {
    width: 100%;
    height: 250px;
    background: #fff;
  }
  .book-info {
    padding: 10px;
  }
  .book-info span {
	padding: 3px 5px;
    font-size: 12px;
    border-radius: 15px;
    background-color: #68a0eb;
    color: #fff;
	font-weight: 700;
  }
  .book-info h3 {
    font-size: 15px;
    font-weight: 600;
    color: #000;
    margin: 10px 0px;
  }

  /* PAGINATION */
  .pagination {
    text-align: center;
    padding: 16px;
  }
  .pagination button {
    border: none;
    background-color: #004d7a;
    color: white;
    padding: 8px 14px;
    margin: 0 4px;
    border-radius: 4px;
    cursor: pointer;
  }
  .pagination button.active {
    background: #3ca0db;
    color: white;
    border-color: #3ca0db;
  }
  .pagination button:disabled {
    background-color: #a4b1c0;
    cursor: default;
  }
  .pagination span {
    padding: 6px 12px;
  }

  /* FOOTER */
  footer {
    background-color: #004d7a;
    text-align: center;
    padding: 20px 10px;
    font-size: 13px;
  }
  footer a {
    color: #fff;
    text-decoration: none;
  }
  footer a:hover {
    text-decoration: underline;
  }

  /* Modal */
  .modal {
    display: none;
    position: fixed;
    z-index: 100;
    inset: 0;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
	  transition: opacity 0.3s ease;
  }
  .modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
  }
  .modal-body {
	position: relative;
    background: white;
    padding: 20px;
    border-radius: 12px;
    max-width: 90%;
	max-height: 90%;
    min-width: 40%;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  }
  .modal .modal-md {
    width: 70%;
  }
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  @keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
  }
  .modal-body .book-detail {
    margin-top: 8px;
    display: flex;
    gap: 15px;
    text-align: left;
    align-items: flex-start;
    max-height: 70vh;
    width: 100%;
    overflow-y: overlay;
  }
  .book-detail img {
    width: 200px;
    height: 100%;       /* ✅ batasi tinggi gambar */
    object-fit: contain;       /* ✅ biar proporsi gambar tetap bagus */
    border-radius: 8px;
    flex-shrink: 0; 
  }
  .close-btn {
	  font-size: 18px;
    padding: 5px 15px;
    background: #bababa;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
    position: absolute;
    top: 10px;
    right: 10px;
  }
  .close-btn:hover {
    background: #787575;
  }
  .modal-body .details {
	width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 280px;
  }
  .modal-body .details h3 {
	  margin: 10px 0px;
  }
  .modal-body .details p {
	  margin: 0;
  }
  .modal-body .details .sub-title {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    font-weight: 700;
    color: #3ca0db;
    margin: 10px 0px;
    font-size: 15px;
	  width: 100%;
  }
  .modal-body .details .sub-title::before,
  .modal-body .details .sub-title::after {
    content: "";
    flex: 1;
    height: 1px;
	  opacity: 0.5;
    background-color: #3ca0db;
  }
  .sub-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 5px;
    font-size: 14px;
    flex: 1;
  }
  .sub-info .info-item {
    display: grid;
	  grid-template-columns: 150px 1fr; /* kiri tetap, kanan fleksibel */
	  align-items: center;
	  padding: 8px 0;
	  border-bottom: 1px solid #e5e7eb;
  }
  .sub-info .info-item:last-child {
    border-bottom: none; /* hilangkan garis di item terakhir */
  }
  .sub-info .label {
    color: #6b7280; /* abu lembut */
    font-weight: 500;
  }
  .sub-info .value {
    color: #111827; /* teks utama */
    font-weight: 600;
  }
  .book-actions {
    margin: auto;
    text-align: center;
  }
  .book-actions .read-btn {
    background-color: #3ca0db;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
  }
  .book-actions .read-btn:hover {
    background-color: #2b7cb5;
  }
  .modal-body .loading-modal {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 40px 30px;
    width: 100%;
    box-sizing: border-box;
  }
  .modal-body .spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #e5e7eb; /* abu-abu terang */
    border-top: 5px solid #3ca0db; /* biru animasi */
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }
  .loading-modal p {
    margin: 0;
    color: #aeaeae;
  }
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }

  /* RESPONSIVE */
  @media (max-width: 768px) {
    header h1 {
      font-size: 18px;
    }
    .book-cover {
      height: 200px;
    }
    .catalog {
      grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
  }
  /* Modal PDF */
  .pdf-modal .modal-body {
	padding: 30px 0px !important;
	background-color: transparent !important;
	box-shadow: none !important;
	min-width: 70%;
  }
  .pdf-modal iframe {
    width: 100%;
    height: 85vh;
    border: none;
    border-radius: 10px;
  }

  /* LOADING */
  .skeleton-container {
	/* display: none; */
  	display: grid;
  	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  	gap: 20px;
  	padding: 20px;
  }  
  .skeleton-card {
  	height: 300px;
  	background: linear-gradient(90deg, #f0f0f0 25%, #e6e6e6 50%, #f0f0f0 75%);
  	background-size: 200% 100%;
  	border-radius: 12px;
  	animation: shimmer 1.3s infinite linear;
  	box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  }  
  @keyframes shimmer {
  	0% { background-position: -200% 0; }
  	100% { background-position: 200% 0; }
  }

  /* MEDIA QUERY untuk MOBILE */
  @media (max-width: 768px) {
      .modal-body .book-detail {
          flex-direction: column; /* turun vertikal */
          align-items: center;
          overflow-y: overlay;
      }
      .book-detail img {
          width: 100%;
          max-width: 250px;
          height: auto;
          margin-bottom: 15px;
      }
      .sub-info .info-item {
          grid-template-columns: 100px 1fr;
      }
  }

  @media (max-width: 480px) {
    header {
      flex-direction: column-reverse;
      align-items: flex-start;
    }
    .book-detail img {
        max-width: 100%;
    }
    .sub-info .info-item {
        grid-template-columns: 1fr; /* stack label dan value */
        gap: 5px;
    }

    .book-cover {
      height: 180px;
    }
    .book-info h3 {
      font-size: 14px;
    }
    .book-info p, .book-info a {
      font-size: 12px;
    }
  }
 /* ===========================================================
   HAK CIPTA - sejajar dengan info lainnya
   =========================================================== */
  .note {
      margin-bottom: 8px;
  }
  .note .info-item {
      display: block;
  }
