/* ===================== Global Base ===================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html, body {
  height: 100%;
  scroll-behavior: smooth;
}
body {
  font-family: 'Poppins', sans-serif;
  background: #000;
  color: #ddd;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ===================== Header ===================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background: rgba(0,0,0,0.15);
  border-bottom: 1px solid rgba(0,255,255,0.2);
  box-shadow: 0 2px 10px rgba(0,255,255,0.1);
  backdrop-filter: blur(8px);
  z-index: 1000;
}


.header-inner {
  max-width: 1300px;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* --- Logo --- */
.header-logo img {
  height: 150px;
  width: auto;
  display: block;
  transition: transform 0.3s ease;
}
.header-logo img:hover {
  transform: scale(1.05);
}

/* --- Tombol menu --- */
.menu-toggle {
  background: transparent;
  border: 1px solid #0ff;
  color: #0ff;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.3s;
}
.menu-toggle:hover {
  background: rgba(0,255,255,0.1);
}


/* ===================== Sidebar ===================== */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s;
  z-index: 1400;
}
.sidebar-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 270px;
  height: 100%;
  background: rgba(10, 10, 10, 0.25); /* transparan lembut */
  border-right: 1px solid rgba(0, 255, 255, 0.25);
  box-shadow: 4px 0 20px rgba(0, 255, 255, 0.08);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  z-index: 1500;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.35s ease;
  padding: 20px 16px;
  border-top-right-radius: 14px;
  border-bottom-right-radius: 14px;
}
.sidebar.active {
  transform: translateX(0);
}

/* --- Header Sidebar --- */
.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.sidebar-header h2 {
  color: #0ff;
  font-size: 20px;
  font-weight: 600;
  text-shadow: 0 0 6px #00ffff99;
}
.close-btn {
  background: none;
  border: none;
  color: #0ff;
  font-size: 22px;
  cursor: pointer;
  transition: color 0.3s;
}
.close-btn:hover {
  color: #fff;
}

/* --- Sidebar Search --- */
.sidebar-search form {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.sidebar-search input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 6px;
  background: rgba(15, 15, 15, 0.4);
  color: #0ff;
  outline: none;
  transition: all 0.3s;
}
.sidebar-search input:focus {
  border-color: #0ff;
  box-shadow: 0 0 8px #00ffff55;
  background: rgba(20, 20, 20, 0.5);
}
.sidebar-search button {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 255, 255, 0.4);
  color: #0ff;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.3s;
}
.sidebar-search button:hover {
  background: rgba(0, 255, 255, 0.15);
}

/* --- Sidebar Sections --- */
.sidebar-section {
  margin-bottom: 22px;
}
.sidebar-section h3 {
  color: #0ff;
  font-size: 16px;
  border-bottom: 1px solid rgba(0, 255, 255, 0.3);
  padding-bottom: 6px;
  margin-bottom: 8px;
  text-shadow: 0 0 4px #00ffff66;
}
.sidebar-list {
  list-style: none;
  padding: 0;
}
.sidebar-list li a {
  display: block;
  padding: 6px 0;
  color: #ccc;
  text-decoration: none;
  transition: color 0.3s, text-shadow 0.3s;
}
.sidebar-list li a:hover {
  color: #0ff;
  text-shadow: 0 0 6px #00ffffaa;
}

/* ===================== Sidebar Genre Toggle ===================== */
.sidebar-list {
  max-height: 280px;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  opacity: 1;
}
.sidebar-list.expanded {
  max-height: 800px;
  overflow-y: auto;
}

/* Tombol tampil/sembunyi */
.sidebar-more {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: #33ccff;
  text-align: center;
  padding: 8px 0;
  font-size: 0.9em;
  cursor: pointer;
  transition: color 0.3s, transform 0.2s;
}
.sidebar-more:hover {
  color: #ff33cc;
  text-decoration: underline;
  transform: scale(1.02);
}

/* Scrollbar halus untuk sidebar */
.sidebar::-webkit-scrollbar {
  width: 6px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 255, 0.4);
  border-radius: 3px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 255, 255, 0.7);
}


/* ===================== Main ===================== */
main {
  max-width: 1300px;
  margin: 10px auto 40px;
  padding: 10px 16px;
}

/* ===================== Gallery ===================== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  justify-items: stretch; /* ✅ biar semua card isi kolom penuh */
  align-items: stretch;    /* ✅ sejajarkan tinggi */
}

/* --- Card Container --- */
.card {
  display: flex;
  flex-direction: column;
  background: transparent;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #00ffff22;
  transition: transform 0.25s ease, box-shadow 0.3s ease;
  height: 100%; /* ✅ biar semua card sama tinggi dalam grid */
}

/* --- Gambar --- */
.card img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

/* --- Info di bawah gambar --- */
.overlay {
  position: relative;
  background: transparent;
  color: #0ff;
  font-size: 13px;
  text-align: center;
  padding: 10px 6px;
  border-top: 1px solid #00ffff22;
  flex-grow: 1; /* ✅ jaga proporsi & isi ruang bawah */
}

.overlay span {
  display: block;
  margin-top: 4px;
  color: #aaa;
  font-size: 12px;
}

/* --- Hover efek --- */
.card:hover {
  transform: scale(1.03);
  box-shadow: 0 0 12px #00ffff55;
}
.card:hover img {
  transform: scale(1.05);
}

/* --- Responsif --- */
@media (max-width: 600px) {
  .gallery {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
  .card img {
    height: 220px;
  }
  .overlay {
    font-size: 12px;
    padding: 8px 5px;
  }
}


/* ===================== Detail Komik ===================== */
.detail-header {
  margin-bottom: 30px;
  text-align: center;
}
.detail-header h1 {
  color: #0ff;
  font-size: 28px;
  margin-bottom: 10px;
}
.genre-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 12px;
}
.genre-tag {
  background: #00ffff22;
  color: #0ff;
  border: 1px solid #00ffff55;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
  text-decoration: none;
}
.genre-tag:hover {
  background: #00ffff33;
}
.komik-description {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 20px;
  white-space: pre-line;
  color: #ccc;
}
.back-btn {
  display: inline-block;
  background: #00ffff22;
  border: 1px solid #00ffff55;
  color: #0ff;
  border-radius: 6px;
  padding: 6px 10px;
  text-decoration: none;
  transition: all 0.3s;
}
.back-btn:hover {
  background: #00ffff33;
}

/* ===================== Comic Viewer ===================== */
.comic-viewer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.comic-page img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid #00ffff33;
}

/* ===================== Pagination ===================== */
.pagination {
  text-align: center;
  margin: 40px 0 20px;
}
.pagination a {
  display: inline-block;
  padding: 8px 14px;
  margin: 0 3px;
  background: #111;
  color: #0ff;
  border: 1px solid #00ffff44;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.3s;
}
.pagination a:hover {
  background: #00ffff22;
}
.pagination a.active {
  background: #0ff;
  color: #000;
  font-weight: bold;
}

/* ===================== Footer ===================== */
footer {
  text-align: center;
  color: #555;
  font-size: 14px;
  padding: 30px 10px;
  border-top: 1px solid #111;
  background: #111;
}
.ad-banner-top,
.ad-banner-bottom {
  text-align: center;
  margin: 20px 0;
  overflow: hidden;
}

@media (min-width: 768px) {
  
  .ad-banner-top,
  .ad-banner-bottom {
    display: block;
    padding-bottom: 0;
    height: auto;
  }

  .ad-banner-top iframe,
  .ad-banner-bottom iframe {
    position: static;
    width: 728px;
    height: 90px;
    max-width: 100%;
  }

}
/* ===================== Responsive ===================== */
@media (max-width: 900px) {
  .header-inner {
    padding: 10 10px;
  }
  .header-logo img {
    height: 130px;
  }
  main {
    padding: 10px;
  }
  .sidebar {
    width: 80%;
  }
}
@media (max-width: 600px) {
  .gallery {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
  .card img {
    height: 220px;
  }
  .sidebar {
    width: 240px;
  }
  .menu-toggle {
    font-size: 20px;
  }
  .sidebar {
    width: 80%;
  }
}
