/* ==========================================================================
   VIET69S.COM - MODERN THEME MATCHING SCREENSHOT EXACTLY
   Red Serif Logo | Dark Minimalist Layout | 4-Column Grid | Eye Views Badge
   ========================================================================== */

:root {
  --bg-main: #141414;
  --bg-header: #181818;
  --bg-card: #1c1c1c;
  --bg-tab-inactive: #282828;
  --bg-tab-hover: #363636;
  --brand-pink: #ff2459;
  --brand-red: #e50914;
  --brand-red-hover: #f01e2c;
  --text-main: #ffffff;
  --text-sub: #b3b3b3;
  --text-dim: #777777;
  --border-color: #262626;
  --radius-sm: 3px;
  --radius-md: 4px;
  --font-serif: "Times New Roman", Times, Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  background-color: var(--bg-main);
  color: #e5e5e5;
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  padding-bottom: 70px;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ================= 1. HEADER & TOP BAR ================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

.header-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 12px 16px 0 16px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  flex-wrap: wrap;
}

/* LOGO: VIET69S.COM */
.site-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 27px;
  letter-spacing: 0.5px;
  line-height: 1;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.site-logo:hover {
  opacity: 0.92;
}
.site-logo .logo-red {
  color: #e50914;
}
.site-logo .logo-white {
  color: #ffffff;
}

/* SEARCH FORM (MATCHING SCREENSHOT) */
.header-search {
  display: flex;
  align-items: center;
  margin-left: auto;
}
.search-form {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
  max-width: 320px;
}
.search-input {
  background: #242424;
  border: 1px solid #333333;
  border-right: none;
  color: #ffffff;
  padding: 8px 14px;
  font-size: 13px;
  outline: none;
  border-radius: 4px 0 0 4px;
  width: 220px;
  transition: all 0.2s;
}
.search-input::placeholder {
  color: #888888;
}
.search-input:focus {
  border-color: #555555;
  background: #2a2a2a;
}
.search-btn {
  background: #ff2459;
  border: none;
  color: #ffffff;
  width: 40px;
  height: 35px;
  border-radius: 0 4px 4px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
  flex-shrink: 0;
}
.search-btn:hover {
  background: #e01e4d;
}

@media (max-width: 640px) {
  .header-top {
    gap: 10px;
  }
  .site-logo {
    font-size: 22px;
  }
  .search-form {
    max-width: 100%;
  }
  .search-input {
    width: 100%;
  }
}

/* NAVIGATION TABS (MATCHING SCREENSHOT) */
.nav-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 6px 0 12px 0;
  white-space: nowrap;
}
.nav-bar::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tab-inactive);
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 15px;
  border-radius: 3px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.nav-tab:hover {
  background: var(--bg-tab-hover);
  color: #ffffff;
}
.nav-tab.active {
  background: var(--brand-pink) !important;
  color: #ffffff !important;
}

/* ================= 2. MAIN LAYOUT & CONTAINER ================= */
.container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 10px 16px;
}

/* SECTION HEADING (MATCHING SCREENSHOT) */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 16px 0;
  padding-bottom: 4px;
}
.section-head-left {
  display: flex;
  align-items: center;
}
.section-accent-bar {
  display: inline-block;
  width: 4px;
  height: 22px;
  background: var(--brand-pink);
  border-radius: 2px;
  margin-right: 10px;
  flex-shrink: 0;
}
.section-title {
  font-size: 19px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-badge-count {
  font-size: 11px;
  font-weight: 600;
  color: #888888;
  background: #242424;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
}
.btn-more-videos {
  background: var(--brand-pink);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 4px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background 0.2s, opacity 0.2s;
  white-space: nowrap;
}
.btn-more-videos:hover {
  background: #e01e4d;
}

/* ================= 3. 4-COLUMN VIDEO GRID (MATCHING SCREENSHOT) ================= */
.video-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px 16px;
}
@media (max-width: 1024px) {
  .video-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px 14px;
  }
}
@media (max-width: 640px) {
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 10px;
  }
}

/* VIDEO CARD */
.video-card {
  display: flex;
  flex-direction: column;
  position: relative;
  background: transparent;
}

.card-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
  border-radius: 4px;
  overflow: hidden;
  display: block;
}
.card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}
.video-card:hover .card-thumb {
  transform: scale(1.04);
}

.thumb-preview-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.card-thumb-wrap.is-previewing .thumb-preview-video {
  opacity: 1;
}

/* VIEWS BADGE (BOTTOM-LEFT, MATCHING SCREENSHOT) */
.card-badge-views {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
  pointer-events: none;
  letter-spacing: 0.3px;
}

/* TITLE BELOW THUMBNAIL (CENTERED, MATCHING SCREENSHOT) */
.card-info {
  padding: 8px 4px 2px 4px;
  text-align: center;
}
.card-title {
  color: #ffffff;
  font-size: 13.5px;
  line-height: 1.4;
  font-weight: 500;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-decoration: none;
  transition: color 0.15s ease;
}
.video-card:hover .card-title {
  color: var(--brand-pink);
}

/* ================= 4. PAGINATION ================= */
.pagination-wrapper {
  margin: 32px 0 24px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  background: #202020;
  border: 1px solid var(--border-color);
  color: #cccccc;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  transition: all 0.15s;
}
.page-btn:hover {
  background: #2c2c2c;
  color: #ffffff;
}
.page-btn.active {
  background: var(--brand-pink);
  color: #ffffff;
  border-color: var(--brand-pink);
}

/* ================= 5. VIDEO PLAYER PAGE & CONTROLS ================= */
.player-theater-target {
  max-width: 1100px;
  margin: 0 auto 20px auto;
}
.theater-mode-active .player-theater-target {
  max-width: 100% !important;
  width: 100vw !important;
  margin-left: calc(-50vw + 50%) !important;
  margin-right: calc(-50vw + 50%) !important;
}

.player-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0,0,0,0.7);
}
.player-box iframe, .player-box video {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.player-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.server-selectors {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.server-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
}
.btn-server {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  background: #242424;
  border: 1px solid var(--border-color);
  color: #e5e5e5;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.15s;
}
.btn-server.active {
  background: var(--brand-pink);
  border-color: var(--brand-pink);
  color: #fff;
}

.player-extra-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-action-tool {
  background: #242424;
  border: 1px solid var(--border-color);
  color: #999999;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn-action-tool:hover { color: #fff; background: #2f2f2f; }
.btn-action-report { color: #f87171; }

.video-detail-header { margin-top: 14px; }
.video-detail-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  margin-bottom: 6px;
}
.video-detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-dim);
  font-size: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.video-desc-box {
  background: #1a1a1a;
  border: 1px solid var(--border-color);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.5;
  margin: 10px 0;
}
.video-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.tag-pill {
  background: #262626;
  border: 1px solid var(--border-color);
  color: #aaaaaa;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}
.tag-pill:hover { color: #fff; }

/* ================= 6. TELEGRAM & BANNER ADS ================= */
.telegram-notice-bar {
  background: #1e1e1e;
  border-bottom: 1px solid #2a2a2a;
  padding: 7px 14px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  color: #aaaaaa;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.telegram-notice-bar a {
  color: #38bdf8;
  text-decoration: underline;
}

.ad-banner-slot {
  width: 100%;
  margin: 10px auto;
  text-align: center;
}
.ad-banner-grid {
  display: grid;
  gap: 10px;
  width: 100%;
  margin: 0 auto;
  align-items: stretch;
}
.ad-banner-grid.grid-cols-1 { grid-template-columns: 1fr; max-width: 760px; }
.ad-banner-grid.grid-cols-2 { grid-template-columns: repeat(2, 1fr); max-width: 1060px; }
.ad-banner-grid.grid-cols-3 { grid-template-columns: repeat(3, 1fr); max-width: 1240px; }
.ad-banner-grid.grid-cols-4 { grid-template-columns: repeat(4, 1fr); max-width: 100%; }
@media (max-width: 768px) {
  .ad-banner-grid.grid-cols-2,
  .ad-banner-grid.grid-cols-3,
  .ad-banner-grid.grid-cols-4 {
    grid-template-columns: 1fr;
  }
}
.ad-banner-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}
.ad-link-wrap { display: block; width: 100%; }
.ad-img-responsive { width: 100%; height: auto; display: block; object-fit: cover; }
.ad-badge-label {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.65);
  color: #94a3b8;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 2px;
  text-transform: uppercase;
  z-index: 2;
  pointer-events: none;
}

/* POPUP MODAL */
#ad-popup-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.popup-modal-content {
  position: relative;
  max-width: 100%;
  width: auto;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.popup-container { position: relative; width: 100%; margin: 0 auto; }
.popup-grid { display: grid; gap: 12px; width: 100%; margin: 0 auto; }
.popup-item {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: #14171e;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.popup-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.popup-close-btn {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #ffffff;
  color: #dc2626;
  border: 2px solid #ffffff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  font-size: 15px;
  font-weight: 900;
}

/* ================= 7. SEO TAGS & FOOTER ================= */
.seo-tags-block {
  margin: 24px 0;
  padding: 14px 0;
  border-top: 1px solid var(--border-color);
}
.seo-block-title {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.seo-block-title .title-prefix { color: var(--brand-pink); font-weight: 900; }
.seo-block-title .title-arrow { color: var(--brand-pink); font-size: 12px; }

.tags-cloud-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-cloud-item {
  display: inline-block;
  background: #202020;
  border: 1px solid #2e2e2e;
  color: #cbd5e1;
  font-size: 12px;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}
.tag-cloud-item:hover {
  background: #2e2e2e;
  color: #ffffff;
}

.site-footer {
  background: #111111;
  border-top: 1px solid var(--border-color);
  padding: 24px 16px;
  color: var(--text-sub);
  font-size: 12px;
  margin-top: 20px;
}
.footer-grid {
  max-width: 1360px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 220px 140px 1fr; }
}
.footer-col-title {
  color: var(--brand-pink);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 10px;
  text-transform: uppercase;
}
.footer-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.footer-links-list a { color: #cbd5e1; }
.footer-links-list a:hover { color: var(--brand-pink); }
.footer-desc-text { line-height: 1.6; color: #949494; }
.footer-desc-text strong { color: #ffffff; }

.dmca-badge {
  display: inline-flex;
  align-items: center;
  background: #111;
  border: 1px solid #333;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 800;
  margin-top: 10px;
  overflow: hidden;
}
.dmca-tag { background: #84cc16; color: #000; padding: 2px 6px; }
.dmca-label { background: #000; color: #fff; padding: 2px 6px; }

/* MODALS */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.8);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal-dialog {
  background: #1c1c1c;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  width: 100%;
  max-width: 400px;
  padding: 18px;
  position: relative;
}
.modal-close-btn {
  position: absolute;
  top: 12px; right: 12px;
  color: var(--text-dim);
  font-size: 18px;
}
.report-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: #262626;
  margin-bottom: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.modal-submit-btn {
  width: 100%;
  background: var(--brand-pink);
  color: #fff;
  padding: 9px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  margin-top: 8px;
}

/* STICKY BOTTOM ADS */
.bottom-sticky-ad {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  max-width: 728px; width: 100%;
  background: rgba(20, 20, 20, 0.95);
  border-top: 1px solid var(--border-color);
  padding: 4px;
  text-align: center;
  display: none;
}
.bottom-sticky-ad.show { display: block; }
.btn-close-sticky-ad {
  position: absolute;
  top: -22px; right: 6px;
  background: #181818;
  color: #fff;
  border: 1px solid var(--border-color);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
