@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;600&display=swap");

/* ── reset ───────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  font-family: "Roboto", sans-serif;
  padding: 0;
  margin: 0;
}

body {
  background-color: #0f0f0f;
  color: #e8e8e8;
  min-height: 100vh;
}

/* ── outer wrapper ───────────────────────────────────────── */
.container {
  width: 100%;
  min-height: 100vh;
  background-color: #0f0f0f;
}

/* ── navigation bar ──────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #111;
  border-bottom: 1px solid #222;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 54px;
}

.nav-logo {
  font-size: 17px;
  font-weight: 600;
  color: #e8e8e8;
  text-decoration: none;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  transition: color 0.2s;
}
.nav-logo:hover { color: #fff; }

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

.nav-links li a {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  color: #aaa;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.nav-links li a:hover {
  background: #222;
  color: #e8e8e8;
}
.nav-links li a.active {
  background: #222;
  color: #fff;
  font-weight: 600;
}

/* ── theater player section ──────────────────────────────── */
.player-section {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 0;
  animation: fadeIn 0.35s ease;
}
.player-section.hidden { display: none; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 16:9 responsive iframe wrapper */
.player-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7);
}
.player-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* video title / meta below iframe */
.player-meta {
  padding: 14px 4px 4px;
}
.player-meta h2 {
  font-size: 18px;
  font-weight: 600;
  color: #f0f0f0;
  line-height: 1.4;
  margin-bottom: 6px;
}
.player-meta p {
  font-size: 13px;
  color: #888;
}

/* back to gallery button */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 16px 0 0;
  padding: 7px 16px;
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 20px;
  font-size: 13px;
  color: #ccc;
  cursor: pointer;
  transition: background 0.2s;
}
.back-btn:hover { background: #2a2a2a; }

/* ── related videos ──────────────────────────────────────── */
.related-label {
  font-size: 16px;
  font-weight: 600;
  color: #e0e0e0;
  padding: 24px 4px 12px;
  max-width: 1200px;
  margin: 0 auto;
}
.player-section .related-label { padding-left: 0; }

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  padding-bottom: 40px;
}

.related-card {
  background: #1a1a1a;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s;
  border: 1px solid #222;
}
.related-card:hover {
  transform: translateY(-4px);
  background: #222;
  border-color: #333;
}

.related-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.related-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.related-card:hover .related-thumb-wrap img {
  transform: scale(1.04);
}
.related-duration {
  position: absolute;
  bottom: 6px;
  right: 8px;
  background: rgba(0,0,0,0.82);
  color: #fff;
  font-size: 11px;
  padding: 2px 5px;
  border-radius: 4px;
}

.related-info {
  padding: 10px 12px 12px;
}
.related-title {
  font-size: 13px;
  font-weight: 600;
  color: #e0e0e0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.related-meta {
  font-size: 12px;
  color: #777;
}

.no-related {
  color: #555;
  font-size: 14px;
  padding: 20px 0;
  grid-column: 1 / -1;
}

/* ── main gallery grid ───────────────────────────────────── */
#gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  padding: 20px 16px 10px;
}
#gallery.hidden { display: none; }

.item {
  display: block;
  text-decoration: none;
  background: #1a1a1a;
  border-radius: 12px;
  width: 320px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid #222;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.2s;
  position: relative;
}
.item:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  background: #222;
  z-index: 2;
}

.thumbnail-vid {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.duration {
  position: absolute;
  top: calc(56.25% - 26px); /* bottom of thumbnail */
  right: 8px;
  background: rgba(0,0,0,0.82);
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}

.vid-title {
  font-size: 13px;
  font-weight: 600;
  color: #e0e0e0;
  padding: 10px 12px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

h1.vid-title {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  width: 296px;
  text-align: left;
}

.ch-name {
  font-size: 12px;
  color: #888;
  padding: 2px 12px;
  text-align: left;
}
.ch-name:last-child { padding-bottom: 12px; }

/* ── state boxes ─────────────────────────────────────────── */
.state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 60px 20px;
  color: #666;
  font-size: 15px;
  width: 100%;
}
.state-box .state-icon { font-size: 48px; }
.state-box.error { color: #e74c3c; }
.state-box button {
  margin-top: 6px;
  padding: 8px 22px;
  background: #222;
  color: #e0e0e0;
  border: 1px solid #333;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.state-box button:hover { background: #2d2d2d; }

/* ── spinner ─────────────────────────────────────────────── */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #2a2a2a;
  border-top-color: #aaa;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── pagination ──────────────────────────────────────────── */
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 28px 12px 48px;
}
.pagination.hidden { display: none; }

.pg-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #1a1a1a;
  color: #ccc;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.pg-btn:hover { background: #2a2a2a; border-color: #555; }
.pg-btn.active {
  background: #e0e0e0;
  color: #0f0f0f;
  border-color: #e0e0e0;
  font-weight: 600;
}
.pg-ellipsis {
  font-size: 14px;
  color: #555;
  padding: 0 4px;
  line-height: 38px;
}

/* ── static pages (Privacy / Terms / DMCA) ──────────────── */
.static-page {
  max-width: 780px;
  margin: 40px auto 60px;
  padding: 0 20px;
}

.static-page-title {
  font-size: 28px;
  font-weight: 600;
  color: #f0f0f0;
  margin-bottom: 6px;
  line-height: 1.3;
}

.static-page-updated {
  font-size: 12px;
  color: #555;
  margin-bottom: 36px;
}

.static-section {
  margin-bottom: 32px;
}

.static-section h2 {
  font-size: 15px;
  font-weight: 600;
  color: #ccc;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #1e1e1e;
}

.static-section p {
  font-size: 14px;
  color: #999;
  line-height: 1.75;
  margin-bottom: 10px;
}

.static-section ul {
  padding-left: 22px;
  margin-top: 6px;
}

.static-section ul li {
  font-size: 14px;
  color: #999;
  line-height: 1.75;
  margin-bottom: 6px;
}

.static-section strong {
  color: #ccc;
}

.static-section a {
  color: #8ab4f8;
  text-decoration: none;
}
.static-section a:hover { text-decoration: underline; }

/* DMCA contact box */
.dmca-contact-box {
  background: #161616;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 16px 20px;
  margin: 14px 0;
}
.dmca-contact-box p {
  margin: 0 0 6px;
  font-size: 14px;
  color: #aaa;
}
.dmca-contact-box p:last-child { margin-bottom: 0; }

/* retry link styled like a button */
.retry-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 8px 22px;
  background: #222;
  color: #e0e0e0;
  border: 1px solid #333;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}
.retry-btn:hover { background: #2d2d2d; }

/* ── responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .player-section { padding: 12px 10px 0; }
  .related-grid { grid-template-columns: 1fr; }
  .nav-links li a { padding: 6px 10px; font-size: 12px; }
  .nav-logo { font-size: 15px; }
  .static-page { margin-top: 28px; }
  .static-page-title { font-size: 22px; }
}
