/* ========== 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;
}

/* 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: #e50914;
  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: #e50914;
}

/* 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: #e50914;
}

/* 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;
}

.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: #e50914;
}

/* Tombol Back to Top */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #e50914;
    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: #e50914;
  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: #e50914; /* 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: #e50914;
  color: #fff;
}

.pagination span.current-page {
  background-color: #e50914;
  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: #e50914;
    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);
}
