/* Reset & Base */
html, body {
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  background-color: #000;
  color: #fff;
}

body > .container {
  flex: 1;
}

/* === Navbar === */
.navbar-dark {
  color: #f8f9fa;
}

.navbar-dark .navbar-brand {
  font-weight: bold;
  color: #ff4d4f !important;
}

.navbar-dark .nav-link {
  color: inherit !important;
  transition: color 0.3s;
}

.navbar-dark .nav-link:hover {
  color: #ff4d4f !important;
}

/* === Form === */
.form-control:focus {
  border-color: #ff4d4f;
  box-shadow: 0 0 0 0.2rem rgba(255, 77, 79, 0.25);
}

.search-form {
  margin-top: 20px;
  text-align: center;
}

.search-form input[type="text"] {
  padding: 8px;
  width: 250px;
  border-radius: 4px;
  border: none;
}

.search-form button {
  padding: 8px 12px;
  margin-left: 5px;
  background-color: #f39c12;
  border: none;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.search-form button:hover {
  background-color: #e67e22;
}

/* === Buttons === */
.btn-outline-danger {
  color: #ff4d4f;
  border-color: #ff4d4f;
  transition: background-color 0.3s, color 0.3s;
}

.btn-outline-danger:hover {
  background-color: #ff4d4f;
  color: #fff;
  cursor: pointer;
}

/* === Card Grid & Cards === */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 15px;
}

.card {
  background-color: #1e1e1e;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.1);
}

.card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  flex-shrink: 0;
}

.card .title {
  padding: 8px;
  font-size: 14px;
  text-align: center;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.card .text-muted {
  font-size: 12px;
  text-align: center;
  color: #aaa !important;
}

/* === Utilities === */
.shadow-sm {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.fw-semibold {
  font-weight: 600;
}

.p-2 {
  padding: 8px;
}

.text-center {
  text-align: center;
}

/* === Pagination === */
.pagination {
  text-align: center;
  margin-top: 20px;
}

.pagination a,
.pagination span {
  margin: 0 5px;
  padding: 6px 12px;
  background-color: #333;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  user-select: none;
  transition: background-color 0.3s;
}

.pagination a.active {
  background-color: #f39c12;
  font-weight: bold;
}

.pagination a:hover:not(.active) {
  background-color: #555;
}

.pagination span {
  background-color: transparent;
  color: #aaa;
}

/* === Responsive Card Image === */
.card-img-top {
  height: 280px;
  object-fit: cover;
  border-radius: 10px;
}

@media (max-width: 768px) {
  .card-img-top,
  .carousel-item img {
    height: 200px;
  }
}

/* === Carousel === */
.carousel-container {
  max-width: 1140px;
  margin: 0 auto;
}

.carousel-item img {
  height: 300px;
  object-fit: cover;
  border-radius: 10px;
}

/* === Poster Image === */
.poster-img {
  border-radius: 8px;
  width: 100%;
  max-width: 250px;
  object-fit: cover;
}

/* === Genre Badge === */
.genre-badge {
  background-color: #e0e0e0;
  color: #000;
  border-radius: 16px;
  padding: 4px 10px;
  font-size: 12px;
  margin-right: 5px;
  display: inline-block;
  user-select: none;
}

/* === Play Button === */
.btn-play {
  background-color: #ff4d4f;
  color: #fff;
  padding: 10px 25px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  margin-top: 15px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.btn-play:hover {
  background-color: #e6393e;
}

/* === Episode List & Buttons === */
.episode-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

.episode-button {
  background-color: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: background-color 0.3s;
}

.episode-button:hover {
  background-color: #ddd;
}

/* === Recommended Section === */
.recommended-grid {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 15px;
  padding-bottom: 10px;
  -webkit-overflow-scrolling: touch;
}

.recommended-card {
  width: 130px;
  flex: 0 0 auto;
  text-align: center;
  font-size: 13px;
  user-select: none;
}

.recommended-card img {
  width: 100%;
  border-radius: 6px;
  margin-bottom: 5px;
}

/* === Responsive Flex === */
@media (max-width: 768px) {
  .flex-md-row {
    flex-direction: column !important;
    align-items: center;
  }

  .poster-img {
    max-width: 180px;
  }
}
  .grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
  }

  .card {
    background-color: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: block;
  }

  .card:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
  }

  .card img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    display: block;
  }

  .title {
    padding: 8px;
    font-size: 14px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .pagination {
    text-align: center;
    margin-top: 30px;
  }

  .pagination a {
    display: inline-block;
    padding: 8px 12px;
    margin: 2px;
    background: #333;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
  }

  .pagination a.active {
    background: #f39c12;
  }

  .pagination a:hover {
    background: #555;
  }

  .pagination span {
    display: inline-block;
    padding: 8px 12px;
    margin: 2px;
    color: #999;
  }

  .genre-chip {
  background-color: #333;
  color: #fff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
  margin: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
  display: inline-block;
}

.genre-chip:hover,
.genre-chip.active {
  background-color: #555;
}

/* Desktop - tampil grid fleksibel */
.genre-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  background-color: #111;
}

/* Mobile - sembunyikan scroll bar */
@media (max-width: 767px) {
  .genre-scroll {
    display: none;
  }
}

/* Desktop - sembunyikan mobile collapse */
@media (min-width: 768px) {
  #mobileGenreCollapseBtn,
  #mobileGenreCollapse {
    display: none;
  }
}
  a {
    color: #ff4d4f;
    text-decoration: none;
  }
  a:hover {
    text-decoration: underline;
  }
  .container {
    max-width: 1100px;
    margin: auto;
    padding: 1rem;
  }
  .breadcrumb {
    font-size: 0.85rem;
    color: #ccc;
    margin-bottom: 0.5rem;
  }
  .breadcrumb a {
    color: #ccc;
  }
  .video-player {
    width: 100%;
    max-width: 450px;
    height: 800px;
    background: black;
    margin: 0 auto;
    display: block;
  }
  video {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .episode-info {
    max-width: 450px;
    margin: 0 auto;
    padding: 0.75rem 0;
    font-size: 0.9rem;
  }
  .episode-info h1 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
  }
  .category-label {
    background: #222;
    color: #ccc;
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 0.75rem;
  }
  .share-icons {
    margin-top: 1rem;
  }
  .share-icons a {
    display: inline-block;
    margin-right: 0.5rem;
    width: 24px;
    height: 24px;
  }
  .episodes-sidebar {
    max-width: 440px;
    margin: 1rem auto 2rem;
    padding: 0.5rem;
    background: #222;
    border-radius: 6px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    font-size: 0.8rem;
  }
  .episodes-sidebar a {
    background: #121212;
    border: 1px solid #ff4d4f;
    border-radius: 3px;
    padding: 5px;
    text-align: center;
    color: #ff4d4f;
    font-weight: bold;
    transition: background-color 0.3s;
    display: block;
  }
  .episodes-sidebar a.active,
  .episodes-sidebar a:hover {
    background-color: #ff4d4f;
    color: #121212;
  }
  .related-episodes,
  .recommended {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1rem;
  }
  .section-title {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
  }
  .episode-thumb-list,
  .recommended-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .episode-thumb {
    width: 80px;
    font-size: 0.75rem;
    text-align: center;
    color: #ccc;
  }
  .episode-thumb img {
    width: 100%;
    border-radius: 4px;
    border: 1px solid #444;
    display: block;
  }
  .recommended-item {
    width: 140px;
    font-size: 0.8rem;
    text-align: center;
    color: #ccc;
  }
  .recommended-item img {
    width: 100%;
    border-radius: 6px;
    border: 1px solid #444;
    display: block;
  }
  .recommended-item .ep-count {
    font-size: 0.7rem;
    margin-top: 0.25rem;
    color: #999;
  }
  /* Responsive */
  @media (max-width: 600px) {
    .video-player {
      max-width: 100%;
      height: auto;
    }
    .episodes-sidebar {
      max-width: 100%;
      grid-template-columns: repeat(8, 1fr);
      overflow-x: auto;
      padding-bottom: 0.5rem;
    }
    .episode-thumb-list {
      justify-content: center;
    }
    .recommended-list {
      justify-content: center;
    }
  }
  .video-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}
 
    .grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
  }

  .card {
    background-color: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: block;
  }

  .card:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
  }

  .card img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    display: block;
  }

  .title {
    padding: 8px;
    font-size: 14px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .pagination {
    text-align: center;
    margin-top: 30px;
  }

  .pagination a {
    display: inline-block;
    padding: 8px 12px;
    margin: 2px;
    background: #333;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
  }

  .pagination a.active {
    background: #f39c12;
  }

  .pagination a:hover {
    background: #555;
  }

  .pagination span {
    display: inline-block;
    padding: 8px 12px;
    margin: 2px;
    color: #999;
  }

  .genre-chip {
  background-color: #333;
  color: #fff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
  margin: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
  display: inline-block;
}

.genre-chip:hover,
.genre-chip.active {
  background-color: #555;
}

/* Desktop - tampil grid fleksibel */
.genre-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  background-color: #111;
}

/* Mobile - sembunyikan scroll bar */
@media (max-width: 767px) {
  .genre-scroll {
    display: none;
  }
}

/* Desktop - sembunyikan mobile collapse */
@media (min-width: 768px) {
  #mobileGenreCollapseBtn,
  #mobileGenreCollapse {
    display: none;
  }
}
