/* Animasi Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: #ef4444;
  /* Merah Bunny Scans */
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Overlay untuk loading layar penuh (Opsional) */
.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
  width: 100%;
}

/* Kontainer Utama Horizontal */
.horizontal-scroll-wrapper {
  position: relative;
  width: 100%;
}

.horizontal-scroll-container {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 16px;
  padding: 10px 5px 20px 5px;
  scroll-snap-type: x mandatory;
  /* Kartu akan 'menempel' saat di-scroll */
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Menghilangkan scrollbar default di Chrome/Safari */
.horizontal-scroll-container::-webkit-scrollbar {
  height: 6px;
}

.horizontal-scroll-container::-webkit-scrollbar-track {
  background: rgba(31, 41, 55, 0.5);
  border-radius: 10px;
}

.horizontal-scroll-container::-webkit-scrollbar-thumb {
  background: #ef4444;
  /* Merah Bunny Scans */
  border-radius: 10px;
}

/* Ukuran kartu tetap di mode horizontal */
.manga-card-horizontal {
  flex: 0 0 160px;
  /* Lebar kartu tetap 160px */
  scroll-snap-align: start;
  transition: transform 0.2s;
}

@media (min-width: 768px) {
  .manga-card-horizontal {
    flex: 0 0 200px;
    /* Lebar kartu di desktop 200px */
  }
}

/* Efek gradasi di ujung kanan untuk petunjuk scroll */
.horizontal-scroll-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 50px;
  background: linear-gradient(to left, rgba(17, 24, 39, 0.8), transparent);
  pointer-events: none;
}

/* Tambahan untuk navigasi tombol */
.nav-scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: none;
  /* Sembunyikan di HP */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
}

.nav-scroll-btn:hover {
  background: #ef4444;
  /* Merah saat hover */
  border-color: #ef4444;
  scale: 1.1;
}

/* Tampilkan hanya di layar komputer (Desktop) */
@media (min-width: 1024px) {
  .nav-scroll-btn {
    display: flex;
  }
}

.btn-left {
  left: -20px;
}

.btn-right {
  right: -20px;
}

/* Pastikan wrapper punya overflow visible untuk tombol yang menonjol keluar */
.horizontal-scroll-wrapper {
  position: relative;
}
