:root {
  --bg: #0d0d12;
  --bg-elevated: #16161e;
  --bg-card: #1c1c26;
  --border: #2a2a38;
  --text: #e8e8f0;
  --text-dim: #9898a8;
  --accent: #e94560;
  --accent-hover: #ff5a78;
  --radius: 10px;
}

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

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* Age gate */
.age-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(5, 5, 10, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.age-gate[hidden] { display: none; }
.age-gate-card {
  max-width: 420px;
  text-align: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
}
.age-gate-card h1 {
  font-size: 48px;
  color: var(--accent);
  margin-bottom: 16px;
}
.age-gate-card p { color: var(--text-dim); margin-bottom: 12px; line-height: 1.5; }
.age-gate-note { font-size: 13px; }
.age-gate-card button { width: 100%; margin-top: 12px; padding: 14px; font-size: 16px; border-radius: 8px; cursor: pointer; border: none; font-weight: 600; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border) !important; }
.btn-ghost:hover { color: var(--text); }

/* Header */
.site-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.logo { font-size: 24px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.logo span { color: var(--accent); }
.search-form { flex: 1; display: flex; min-width: 220px; max-width: 560px; }
.search-form input {
  flex: 1;
  padding: 10px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px 0 0 8px;
  color: var(--text);
  font-size: 15px;
  outline: none;
}
.search-form input:focus { border-color: var(--accent); }
.search-form button {
  padding: 10px 20px;
  background: var(--accent);
  border: none;
  border-radius: 0 8px 8px 0;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.search-form button:hover { background: var(--accent-hover); }
.header-nav { display: flex; gap: 4px; }
.sort-link {
  padding: 8px 14px;
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
}
.sort-link:hover { color: var(--text); background: var(--bg-card); }
.sort-link.active { color: var(--accent); background: var(--bg-card); }

/* Layout */
.layout {
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
}

/* Sidebar */
.sidebar h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin: 20px 0 10px;
}
.sidebar h2:first-child { margin-top: 0; }
.category-list { list-style: none; }
.category-list a {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 14px;
}
.category-list a:hover { background: var(--bg-card); color: var(--text); }
.category-list a.active { background: var(--bg-card); color: var(--accent); font-weight: 600; }
.category-list .count { font-size: 12px; opacity: 0.7; }

/* Instant-feedback loading state while a filtered fetch is in flight */
.video-grid.is-loading { opacity: 0.45; pointer-events: none; transition: opacity 0.15s ease; }

/* Grid */
.results-meta { margin-bottom: 16px; color: var(--text-dim); font-size: 14px; }
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.video-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 1px solid transparent;
}
.video-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border-color: var(--border);
}
.video-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: var(--bg-elevated);
}
.card-thumb {
  position: relative;
  overflow: hidden;
  background: var(--bg-elevated);
}
.card-thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: var(--bg-elevated);
  transition: opacity 0.2s ease;
}
.card-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  background: transparent;
}
.duration-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 1;
}
.card-info {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 4px;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 2;
}
.video-card:hover .card-info { opacity: 1; }
.video-card:hover .card-info:hover { background: var(--accent); }
.video-card:hover .card-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.12);
  pointer-events: none;
}
.video-card .card-body { padding: 12px 14px 14px; }
.video-card h3 {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta { font-size: 12px; color: var(--text-dim); display: flex; gap: 10px; flex-wrap: wrap; }
.card-cats { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.card-cats span {
  font-size: 11px;
  padding: 3px 8px;
  background: var(--bg-elevated);
  border-radius: 999px;
  color: var(--text-dim);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 32px 0;
  flex-wrap: wrap;
}
.pagination button {
  min-width: 38px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
}
.pagination button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pagination button:disabled { opacity: 0.35; cursor: default; }
.pagination button.current { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }

/* Footer */
.site-footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 24px;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.7;
}
.footer-inner p { margin-bottom: 10px; }
.footer-links a { margin: 0 4px; }

/* Footer columns (Support / Legal / Advertisers) + badges */
.footer-cols {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(240px, 1.4fr) auto;
  gap: 32px;
  align-items: start;
}
.footer-second { margin-top: 22px; }
.footer-col h4 {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 10px;
}
.footer-col a {
  display: block;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.95;
}
.footer-col a:hover { color: var(--text); text-decoration: underline; }
.footer-badges { justify-self: end; text-align: right; }
.footer-badges img { display: inline-block; margin: 10px 0; opacity: .85; }
.footer-badges img:hover { opacity: 1; }
.footer-bottom {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px 26px;
  font-size: 11px;
  color: var(--text-dim);
}
@media (max-width: 760px) {
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .footer-badges { justify-self: start; text-align: left; grid-column: 1 / -1; }
}

/* Legal document pages */
.legal-doc {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 20px 48px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.75;
}
.legal-doc h1 { font-size: 24px; margin-bottom: 6px; }
.legal-doc h2 { font-size: 16px; margin: 26px 0 8px; color: var(--accent); }
.legal-doc p { margin: 10px 0; color: var(--text-dim); }
.legal-doc strong { color: var(--text); }
.legal-doc ul { margin: 10px 0 10px 20px; color: var(--text-dim); }
.legal-doc li { margin-bottom: 6px; }
.legal-doc code { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 13px; }
.legal-doc a { text-decoration: underline; }
.legal-updated { font-size: 12px; color: var(--text-dim); opacity: .8; }
.legal-table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 13px; }
.legal-table th, .legal-table td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; color: var(--text-dim); vertical-align: top; }
.legal-table th { color: var(--text); background: var(--bg-elevated); }

/* Popular Categories / Pornstars sections (below pagination on the index) */
.popular-wrap { margin-top: 36px; padding-bottom: 12px; border-top: 1px solid var(--border); }
.popular-h { font-size: 15px; margin: 26px 0 14px; color: var(--text); }
.popular-grid {
  columns: 5 210px;
  column-gap: 32px;
}
.pop-group {
  break-inside: avoid;
  margin: 0 0 18px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--border);
}
.pop-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  margin-bottom: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}
.pop-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 2.1;
}
.pop-row:hover { color: var(--accent); }
.pop-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pop-views { color: var(--text-dim); opacity: .72; font-size: 11px; flex: none; }

/* Responsive */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
  .category-list { display: flex; flex-wrap: wrap; gap: 6px; }
  .category-list a { background: var(--bg-card); }
  .header-nav { order: 3; width: 100%; justify-content: center; }
}
