/* HDHentai Theme Clone */
:root {
  --bg-primary: #0d0d12;
  --bg-secondary: #151520;
  --bg-card: #1c1c28;
  --bg-input: #252535;
  --text-primary: #ffffff;
  --text-secondary: #a8a8b8;
  --accent: #e91e8c;
  --accent-hover: #c41775;
  --danger: #dc3545;
  --warning: #ffc107;
  --border: #2e2e40;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0,0,0,.4);
  --font: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --transition: .25s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  direction: ltr;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; display: block; }

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

.container.single-content {
  max-width: 1400px;
}

/* Header */
.site-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-top { padding: 12px 0; }

.header-top-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
}

.site-branding { order: 1; }
.header-search { order: 2; }
.header-actions { order: 3; display: flex; gap: 8px; }

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 800;
}

.logo-text { white-space: nowrap; }

.header-search {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 50px;
  overflow: hidden;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}

.header-search input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  padding: 12px 16px;
  font-family: var(--font);
  font-size: .95rem;
  outline: none;
}

.header-search input::placeholder { color: var(--text-secondary); }

.header-search button {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 12px 16px;
  cursor: pointer;
}

.search-scope select {
  background: var(--bg-card);
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text-primary);
  padding: 12px 14px;
  font-family: var(--font);
  cursor: pointer;
}

.header-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 50px;
  font-size: .85rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.header-pill-recent { border-color: var(--warning); color: var(--warning); }
.header-pill-trend { color: var(--text-secondary); }

/* Navigation */
.main-nav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 4px;
  padding: 8px 0;
}

.nav-menu li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .9rem;
  white-space: nowrap;
  transition: background var(--transition);
}

.nav-menu li a:hover,
.nav-menu .current-menu-item a {
  background: rgba(40,167,69,.15);
  color: var(--accent);
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  background: currentColor;
  mask-size: contain;
  -webkit-mask-size: contain;
}

/* Hero */
.hero-section {
  padding: 48px 0 32px;
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.hero-content { text-align: center; }

.hero-content h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 12px;
}

.hero-content p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 20px;
}

.hero-tags {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-tag {
  background: rgba(40,167,69,.15);
  color: var(--accent);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: .85rem;
  font-weight: 600;
}

/* Sections */
.content-section { padding: 32px 0; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-more {
  color: var(--accent);
  font-size: .9rem;
  font-weight: 600;
}

/* Content Grid */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 22px;
}

@media (min-width: 768px) {
  .content-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
}

/* Cards */
.content-card { position: relative; }

.card-link { display: block; }

.card-poster {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-card);
}

.card-poster img,
.poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}

.content-card:hover .card-poster img { transform: scale(1.05); }

.card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.content-card:hover .card-overlay { opacity: 1; }

.card-badges {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 2;
}

.badge {
  font-size: .7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
}

.badge-dubbed { background: #17a2b8; }
.badge-subbed { background: #6f42c1; }
.badge-episode { background: var(--warning); color: #000; }

.card-info { padding: 10px 4px 0; }

.card-title {
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-year {
  font-size: .8rem;
  color: var(--text-secondary);
}

.poster-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 3rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-hover); color: #fff; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c82333; color: #fff; }

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label { font-size: .8rem; color: var(--text-secondary); }

.filter-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  min-width: 160px;
}

/* Category pills */
.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 4px;
  overflow-x: auto;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 50px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: .85rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--transition);
}

.category-pill:hover,
.category-pill.active {
  background: rgba(40,167,69,.15);
  border-color: var(--accent);
  color: var(--accent);
}

.archive-header { margin-bottom: 20px; }
.archive-title { font-size: 1.8rem; font-weight: 800; }
.archive-desc { color: var(--text-secondary); margin-top: 8px; }

/* Single page */
.single-content { padding: 24px 0 40px; }

.single-header {
  margin-bottom: 20px;
  text-align: center;
}

.single-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  margin-top: 28px;
}

@media (max-width: 768px) {
  .single-layout { grid-template-columns: 1fr; }
  .single-header { text-align: right; }
  .header-top-inner { grid-template-columns: 1fr; }
  .site-branding { order: 1; justify-self: center; }
  .header-search { order: 2; }
  .header-actions { order: 3; justify-content: center; }
}

.single-poster-wrap img,
.single-poster-wrap .poster-img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.single-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  margin-bottom: 12px;
}

.single-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.meta-item {
  background: var(--bg-card);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: .85rem;
}

.meta-rating { color: var(--warning); }

.single-taxonomies { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

.tag {
  background: rgba(40,167,69,.15);
  color: var(--accent);
  padding: 4px 12px;
  border-radius: 50px;
  font-size: .8rem;
}

.single-description {
  color: var(--text-secondary);
  margin-bottom: 28px;
  line-height: 1.8;
}

/* Player */
.single-player-block,
.player-section {
  width: 100%;
  margin-bottom: 8px;
}

.player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: clamp(520px, 62vw, 920px);
  max-height: 90vh;
  background: #000;
  border-radius: calc(var(--radius) + 8px);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
}

.player-wrap iframe,
.player-wrap video.native-player,
.player-wrap .player-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.player-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

@media (min-width: 992px) {
  .player-wrap {
    min-height: 720px;
  }

  .container.single-content {
    max-width: 1680px;
  }
}

@media (max-width: 768px) {
  .container.single-content {
    padding: 0 10px;
  }

  .single-player-block {
    margin-left: -4px;
    margin-right: -4px;
    width: calc(100% + 8px);
  }

  .player-wrap {
    min-height: clamp(220px, 58vw, 400px);
    max-height: none;
    border-radius: 10px;
  }

  .servers-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .servers-list {
    gap: 6px;
  }

  .server-btn {
    padding: 12px 14px;
    font-size: .9rem;
  }
}

.servers-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.tab-btn.active,
.tab-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.servers-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.servers-list.hidden { display: none; }

.server-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.server-btn:hover,
.server-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.server-quality {
  font-size: .75rem;
  opacity: .8;
}

.btn-download-page {
  width: 100%;
  padding: 16px;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.download-note {
  text-align: center;
  color: var(--text-secondary);
  font-size: .85rem;
  margin-bottom: 16px;
  width: 100%;
}

/* Episodes */
.episodes-section { margin-top: 32px; }
.episodes-section h2 { margin-bottom: 16px; font-size: 1.2rem; }

.episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.episode-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.episode-card:hover {
  border-color: var(--accent);
  background: rgba(40,167,69,.1);
}

.ep-num {
  background: var(--accent);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.ep-title {
  font-size: .9rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Breadcrumb */
.breadcrumb {
  padding: 16px 0;
  font-size: .85rem;
  color: var(--text-secondary);
}

.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 6px; }

/* Archive */
.archive-header { padding: 24px 0 16px; }
.archive-title { font-size: 1.6rem; font-weight: 800; }

.page-content { padding: 24px 0 48px; }

.no-results {
  text-align: center;
  color: var(--text-secondary);
  padding: 48px 0;
  grid-column: 1 / -1;
}

/* Footer */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
  margin-top: 48px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}

.footer-brand h3 { font-size: 1.2rem; margin-bottom: 8px; }
.footer-brand p { color: var(--text-secondary); font-size: .9rem; }
.footer-links h4, .footer-social h4 { margin-bottom: 12px; font-size: 1rem; }

.footer-menu { list-style: none; }
.footer-menu li { margin-bottom: 8px; }
.footer-menu a { color: var(--text-secondary); font-size: .9rem; }
.footer-menu a:hover { color: var(--accent); }

.social-links { display: flex; gap: 12px; }
.social-links a {
  background: var(--bg-card);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: .85rem;
}

.footer-bottom {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: .85rem;
}

/* Adblock notice */
.adblock-notice {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #0d1b2a;
  border-top: 2px solid var(--accent);
  padding: 20px;
  z-index: 9999;
  box-shadow: 0 -4px 20px rgba(0,0,0,.5);
}

.adblock-content { max-width: 800px; margin: 0 auto; text-align: center; }
.adblock-content p { margin-bottom: 16px; font-size: .95rem; }
.adblock-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 44px;
  height: 44px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  z-index: 100;
  box-shadow: var(--shadow);
}

.back-to-top.visible { opacity: 1; visibility: visible; }

/* Pagination */
.pagination,
.nav-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 32px 0;
  flex-wrap: wrap;
}

.page-numbers {
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.page-numbers.current,
.page-numbers:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* 404 */
.error-404 { text-align: center; padding: 80px 0; }
.error-404 h1 { font-size: 6rem; font-weight: 800; color: var(--accent); }
.error-404 p { color: var(--text-secondary); margin: 16px 0 32px; }

/* Filters section */
.filters-section { padding: 32px 0 48px; }
