/* ========== GLOBAL RESET ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ========== BODY & CONTAINER ========== */
body {
  font-family: 'Montserrat', sans-serif;
  background-color: #111;
  color: #ccc;
  line-height: 1.6;
background-image: url(https://wp.amelin.us/wp-content/uploads/2025/05/kiri-1.png), url() !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
    background-position: top left, top right !important;
    background-size: auto auto, auto auto !important;
}

/* Container utama dengan batas maksimal 1200px */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* ========== GLOBAL LINK STYLING ========== */
a {
  color: #b0b0b0;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover,
a:focus {
  color: #00a8ff;
  text-decoration: underline;
}

/* ========== HEADER ========== */
header {
  width: 100%;
  background-color: #1a1a1a;
  border-bottom: 1px solid #333;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-size: 2em;
  font-weight: 700;
  text-transform: uppercase;
  color: #00a8ff;
}

/* Navigasi */
nav {
  display: flex;
  align-items: center;
}

nav ul {
  list-style: none;
  display: flex;
}

nav ul li {
  margin-left: 20px;
}

nav ul li a {
  font-size: 0.9em;
  color: #ccc;
  padding: 5px 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.3s;
}

nav ul li a:hover {
  color: #00a8ff;
}

/* Desktop Search Box */
.search-box {
  margin-left: 20px;
}

.search-box input[type="text"] {
  background-color: #222;
  border: none;
  padding: 7px 10px;
  border-radius: 4px;
  color: #ccc;
}

.search-box input[type="text"]::placeholder {
  color: #777;
}

/* Mobile Toggle Menu */
.toggle-menu,
.toggle-search {
  display: none;
  font-size: 1.5em;
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
}

/* Mobile Navigation */
@media (max-width: 768px) {
  nav ul {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100%;
    background-color: #1a1a1a;
    flex-direction: column;
    padding-top: 60px;
    transition: left 0.3s ease;
    z-index: 1001;
  }
  nav ul.active {
    left: 0;
  }
  
  .toggle-menu {
    display: block;
  }
  
  .search-box {
    display: none;
  }
  .toggle-search {
    display: block;
  }
}

/* ========== FOOTER ========== */
footer {
  width: 100%;
  background-color: #1a1a1a;
  border-top: 1px solid #333;
  padding: 20px 0;
    margin-top: 30px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
  text-align: center;
}

footer p {
  font-size: 0.9em;
  color: #777;
}

footer nav {
  display: inline-block;
}

footer nav a {
  margin: 0 12px;
  font-size: 0.85em;
  color: #777;
  transition: color 0.3s;
}

footer nav a:hover {
  color: #00a8ff;
}

/* Tombol Back to Top */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #00a8ff;
    color: white;
    padding: 12px 16px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    transition: background-color 0.3s, transform 0.2s ease-in-out;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.5); /* Tambahkan shadow */
}

/* Saat Hover */
#backToTop:hover {
    background-color: #b20710;
    transform: scale(1.1);
}

/* ========== VIDEO PLAYER (16:9) ========== */
.video-container {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: auto;
  aspect-ratio: 16 / 9;
  background: black;
}

.video-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ========== EPISODE NAVIGATION ========== */
.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-btn {
  background-color: #00a8ff;
  color: white;
  padding: 10px 15px;
  border: none;
  cursor: pointer;
  border-radius: 5px;
  text-decoration: none;
  transition: background-color 0.3s ease;
  flex-shrink: 0;
}

/* Hover tombol */
.nav-btn:hover {
    background-color: #b20710; /* Warna lebih gelap, bukan merah terang */
    color: white;
}

.nav-btn.disabled {
  background-color: #555;
  cursor: default;
  pointer-events: none;
}

.episode-dropdown {
  padding: 8px;
  background-color: #222;
  color: white;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  flex-grow: 1;
  text-align: center;
}

/* Search Box di Mobile (Tersembunyi Default) */
.mobile-search {
    display: none;
    position: absolute;
    top: 60px; /* Sesuaikan dengan header */
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    background-color: #222;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    transition: all 0.3s ease-in-out;
}

/* Ketika Search Box Aktif */
.mobile-search.active {
    display: block;
}

/* Input Search di Mobile */
.mobile-search input {
    width: 100%;
    padding: 10px;
    border: none;
    background-color: #333;
    color: white;
    border-radius: 5px;
    outline: none;
    font-size: 14px;
}

.mobile-search input::placeholder {
    color: #aaa;
}

/* Default H1 - Ukuran Besar */
h1 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 15px;
}

/* Ukuran Lebih Kecil di Mobile */
@media (max-width: 768px) {
    h1 {
        font-size: 1.4rem; /* Lebih kecil untuk HP */
        margin-bottom: 10px;
    }
}

/* Global Styling for Headings */
h2 {
  font-size: 1.6em;
  font-weight: bold;
  margin-bottom: 15px;
}

h3 {
  font-size: 1.3em;
  font-weight: bold;
  color: #ccc; /* Warna abu-abu terang */
  margin-bottom: 10px;
}

/* Hover untuk Judul Link */
.anime-item h3 {
  color: #ccc;
  transition: color 0.3s ease;
}

.anime-item a:hover h3 {
  color: #00a8ff; /* Warna hover merah */
}

.related-anime-section {
  margin-top: 30px; /* Beri jarak dari atas */
  padding-top: 20px;
  border-top: 1px solid #333; /* Tambahkan garis pemisah */
}

/* =================== */
/* PAGINATION STYLES */
/* =================== */
.pagination {
  text-align: center;
  margin-top: 20px;
}

.pagination a,
.pagination span.current-page {
  display: inline-block;
  padding: 10px 15px;
  margin: 0 5px;
  color: #fff;
  background-color: #1a1a1a;
  border-radius: 5px;
  text-decoration: none;
  transition: background-color 0.3s, color 0.3s;
  font-size: 14px;
  font-weight: bold;
}

.pagination a:hover {
  background-color: #00a8ff;
  color: #fff;
}

.pagination span.current-page {
  background-color: #00a8ff;
  color: #fff;
  cursor: default;
}

/* =================== */
/* RESPONSIVE ANIME DESCRIPTION */
/* =================== */
.anime-description-container {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  background-color: #181818;
  padding: 20px;
  margin-top: 30px;
  border-radius: 5px;
  color: #ccc;
  gap: 20px;
  max-width: 100%;
  overflow: hidden;
}

/* Poster Anime */
.anime-poster {
  flex: 0 0 250px; /* Tetap ukuran poster */
  max-width: 250px;
}

.anime-poster img {
  width: 100%;
  height: auto;
  border-radius: 5px;
  object-fit: cover;
}

/* Deskripsi Anime */
.anime-description {
  flex: 1;
  min-width: 280px;
  text-align: left;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* List Detail */
.anime-details {
  list-style: none;
  padding: 0;
  margin-bottom: 15px;
}

.anime-details li {
  font-size: 1em;
  margin-bottom: 5px;
  color: #ddd;
}

/* Labels for Dub/Sub */
.dub-label, .sub-label {
  font-weight: bold;
  padding: 3px 7px;
  border-radius: 3px;
  display: inline-block;
}

.dub-label {
  background-color: #007bff;
  color: white;
}

.sub-label {
  background-color: #28a745;
  color: white;
}

/* RESPONSIVE FIXES */
@media (max-width: 768px) {
  .anime-description-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
  }

  .anime-poster {
    max-width: 180px; /* Kecilkan di mobile */
    margin: 0 auto 15px auto;
  }
  
  .anime-description {
    text-align: left;
    width: 100%;
    max-width: 100%;
  }
  
  .anime-details {
    text-align: left;
    display: inline-block;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
}

/* Grid untuk daftar anime */
.anime-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 15px;
  justify-content: center;
  align-items: stretch;
}

/* Setiap item anime */
.anime-item {
  background-color: #181818;
  padding: 10px;
  border-radius: 5px;
  text-align: center;
  overflow: hidden;
  transition: transform 0.2s;
}

/* Judul di dalam grid (misal untuk anime-item) */
.anime-item h2,
.anime-item h3 {
  font-size: 0.8em; /* Ukuran lebih kecil */
  line-height: 1.2;
  margin: 5px 0;
}

.cover-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Responsive Fix untuk HP */
@media (max-width: 768px) {
  .anime-grid {
    grid-template-columns: repeat(2, 1fr);
    justify-items: center;  /* Tambahkan ini untuk memastikan setiap item di tengah */
  }
  
  .cover-container {
    max-width: 120px;
    margin: 0 auto; /* Pastikan container ditengah */
  }
}

#installButton {
      display: none;
    position: fixed;
    bottom: 10px;
    left: 10px; /* Pindahkan ke kiri */
    padding: 12px 20px;
    background-color: #00a8ff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    z-index: 9999; /* Pastikan tetap di atas navbar */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-wrap {
  text-align: center;
  margin-top: 50px;
  padding: 0 16px;
}

.search-title {
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.search-form {
  display: flex;
  justify-content: center;
  align-items: stretch;
  flex-wrap: wrap;              /* <- kunci agar bisa turun ke bawah di mobile */
  gap: 10px;
  max-width: 720px;
  margin: 0 auto;
}

.search-input {
  background-color: #333;
  border: 1px solid #444;
  color: #fff;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 1rem;
  flex: 1 1 280px;              /* <- fleksibel, basis ~280px */
  min-width: 200px;             /* <- jangan terlalu kecil */
  max-width: 600px;             /* <- plafon lebar */
  box-sizing: border-box;
}

.search-btn {
  background-color: #00a8ff;
  border: none;
  color: #fff;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  flex: 0 0 auto;
}

@media (max-width: 480px) {
  .search-input {
    flex: 1 1 100%;             /* input full width */
  }
  .search-btn {
    width: 100%;                /* tombol ikut full width di layar sempit */
  }
}

/* Kanvas 16:9 responsif */
.video-player{
  position:relative;
  width:100%;
  aspect-ratio:16/9;
  background:#000;
  border-radius:8px;
  overflow:hidden;
}

/* Cover di atas kanvas */
.vp-cover{
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
}

/* Thumbnail portrait -> crop rapi ke 16:9 */
.vp-cover-photo{
  position:absolute; inset:0;
  width:100%; height:100%;
  object-fit:cover;            /* kunci: isi penuh, crop sisanya */
  object-position:center;      /* fokus tengah */
  filter:blur(8px);
  transform:scale(1.06);       /* counter shrink karena blur */
}

/* Overlay gelap tipis untuk kontras tombol */
.vp-cover-overlay{
  position:absolute; inset:0;
  background:linear-gradient(to bottom, rgba(0,0,0,.25), rgba(0,0,0,.45));
}

/* Tombol play */
.vp-play{
  position:relative; z-index:1;
  background:transparent; border:0; padding:0; line-height:0;
  transition:transform .15s ease, filter .15s ease;
}
.vp-play:hover{ transform:scale(1.06); filter:brightness(1.05); }
.vp-play:focus{ outline:2px solid #fff; outline-offset:4px; }

/* Iframe disembunyikan sampai user klik */
.vp-iframe{
  position:absolute; inset:0;
  width:100%; height:100%;
  border:0;
  display:none;
}

/* Saat playing, cover hilang, iframe tampil */
.video-player.is-playing .vp-cover{ display:none; }
.video-player.is-playing .vp-iframe{ display:block; }

/* Kalau mau TANPA blur: hapus 2 baris di .vp-cover-photo di atas,
   atau override begini: */
/* .vp-cover-photo{ filter:none; transform:none; } */

/* ======= FIX POSISI TOMBOL MOBILE (TANPA UBAH HTML) ======= */
@media (max-width: 768px){
  .header-container{
    position: relative; /* buat anchor positioning absolut */
  }

  /* pastikan dua tombol tampil di mobile */
  .toggle-menu,
  .toggle-search{
    display: block !important;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1002;            /* di atas nav/menu panel */
    width: 44px; height: 44px;/* hit area nyaman */
    line-height: 44px;
    text-align: center;
    background: transparent;
    border: none;
    color: #ccc;
  }

  /* urutan di kanan: [search] [menu] */
  .toggle-menu{   right: 16px; }   /* ☰ paling kanan */
  .toggle-search{ right: 64px; }   /* 🔍 di kiri sedikit */

  /* sembunyikan search-box desktop di mobile */
  nav .search-box{ display: none !important; }
}

/* opsi kecil: hover/active biar enak disentuh */
@media (hover:hover){
  .toggle-menu:hover,
  .toggle-search:hover{
    color:#fff;
  }
}
