/* DiaperGuys Watch — PH-style dense grid + hover previews (DG dark theme) */

body.theme-grid .dg-watch-page {
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

body.theme-grid .dg-watch-search .form-control {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--grid-text);
  border-radius: 999px;
  padding-left: 1rem;
}

body.theme-grid .dg-watch-search .btn {
  border-radius: 999px;
}

body.theme-grid .dg-watch-search .form-control::placeholder {
  color: var(--grid-muted);
}

body.theme-grid .dg-watch-search .form-control:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
  color: var(--grid-text);
}

/* Toolbar + sort pills */
body.theme-grid .dg-watch-toolbar {
  flex-wrap: wrap;
  gap: 0.75rem;
}

body.theme-grid .dg-watch-toolbar__left {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
}

body.theme-grid .dg-watch-sort-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

body.theme-grid .dg-watch-sort-pill {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--grid-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

body.theme-grid .dg-watch-sort-pill:hover,
body.theme-grid .dg-watch-sort-pill.is-active {
  color: var(--grid-text);
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.12);
}

body.theme-grid .dg-watch-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

body.theme-grid .dg-watch-cats-mobile__scroll {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

body.theme-grid .dg-watch-cats-mobile__scroll::-webkit-scrollbar {
  display: none;
}

body.theme-grid .dg-watch-cat-chip {
  flex-shrink: 0;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  text-decoration: none;
  color: var(--grid-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

body.theme-grid .dg-watch-cat-chip.is-active,
body.theme-grid .dg-watch-cat-chip:hover {
  color: var(--grid-text);
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
}

/* Grid density */
body.theme-grid .dg-watch-grid {
  --bs-gutter-x: 10px;
  --bs-gutter-y: 14px;
}

@media (min-width: 1400px) {
  body.theme-grid .dg-watch-grid > .col-xxl-2 {
    flex: 0 0 auto;
    width: 20%;
  }
}

/* Card */
body.theme-grid .dg-watch-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  overflow: hidden;
  background: transparent;
  border: none;
  transition: transform 0.18s ease;
}

body.theme-grid .dg-watch-card:hover {
  transform: translateY(-3px);
  color: inherit;
}

body.theme-grid .dg-watch-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0a0a0a;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

body.theme-grid .dg-watch-card:hover .dg-watch-thumb,
body.theme-grid .dg-watch-card.is-previewing .dg-watch-thumb {
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

body.theme-grid .dg-watch-thumb__poster,
body.theme-grid .dg-watch-thumb__preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

body.theme-grid .dg-watch-thumb__poster {
  transition: opacity 0.2s ease;
}

body.theme-grid .dg-watch-thumb__preview {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 2;
}

body.theme-grid .dg-watch-thumb__preview.is-playing,
body.theme-grid .dg-watch-card.is-previewing .dg-watch-thumb__preview.is-playing {
  opacity: 1;
}

body.theme-grid .dg-watch-card.is-previewing .dg-watch-thumb__poster {
  opacity: 0;
}

body.theme-grid .dg-watch-thumb__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.55) 100%);
}

body.theme-grid .dg-watch-thumb__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: linear-gradient(145deg, #0d1117 0%, #151b24 50%, #0a0e14 100%);
}

body.theme-grid .dg-watch-thumb__placeholder-label {
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}

body.theme-grid .dg-watch-play {
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.85);
}

body.theme-grid .dg-watch-duration {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 4;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.82);
  line-height: 1.3;
  letter-spacing: 0.02em;
}

body.theme-grid .dg-watch-thumb__views {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 4;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(0, 0, 0, 0.72);
  line-height: 1.3;
}

body.theme-grid .dg-watch-thumb__views i {
  margin-right: 0.25rem;
  opacity: 0.85;
  font-size: 0.62rem;
}

body.theme-grid .dg-watch-privacy {
  position: absolute;
  left: 6px;
  top: 6px;
  z-index: 4;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 0.65rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.65);
}

body.theme-grid .dg-watch-privacy--paid {
  left: auto;
  right: 6px;
  top: 6px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

body.theme-grid .dg-watch-card__play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.95rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

body.theme-grid .dg-watch-card:hover .dg-watch-card__play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.05);
}

body.theme-grid .dg-watch-card.is-previewing .dg-watch-card__play {
  opacity: 0;
}

/* Meta — PH-style: creator row, then title */
body.theme-grid .dg-watch-meta {
  padding: 0.55rem 0.15rem 0.25rem;
}

body.theme-grid .dg-watch-meta__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  min-width: 0;
}

body.theme-grid .dg-watch-creator {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  flex: 1;
}

body.theme-grid .dg-watch-creator__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

body.theme-grid .dg-watch-creator__name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--grid-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.theme-grid .dg-watch-verified {
  flex-shrink: 0;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.95);
}

body.theme-grid .dg-watch-card__title {
  margin-top: 0.3rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.theme-grid .dg-watch-card:hover .dg-watch-card__title {
  color: #fff;
}

body.theme-grid .dg-watch-card__tag {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.theme-grid .dg-watch-empty__icon {
  color: rgba(255, 255, 255, 0.5);
}

body.theme-grid .dg-watch-empty__title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--grid-text);
}

/* ---- Watch detail page ---- */
body.theme-grid .dg-watch-detail {
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

body.theme-grid .dg-ad-slot {
  display: block;
  min-height: 90px;
  margin-bottom: 1rem;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.015);
  font-size: 0;
  line-height: 0;
  color: transparent;
  overflow: hidden;
}

/* Hide empty reserved slots from layout until admin ads are wired */
body.theme-grid .dg-ad-slot:empty {
  min-height: 72px;
}

body.theme-grid .dg-ad-slot:not(:empty) {
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.08);
  background: transparent;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

body.theme-grid .dg-ad-slot--watch-top,
body.theme-grid .dg-ad-slot--video-top {
  min-height: 72px;
}

body.theme-grid .dg-ad-slot--watch-row {
  min-height: 72px;
  margin: 0.5rem 0 1rem;
}

body.theme-grid .dg-ad-slot--watch-sidebar,
body.theme-grid .dg-ad-slot--video-sidebar {
  min-height: 250px;
}

body.theme-grid .dg-ad-slot--video-below,
body.theme-grid .dg-ad-slot--related {
  min-height: 90px;
}

body.theme-grid .dg-watch-notice {
  border-radius: 10px;
  background: rgba(255, 193, 7, 0.12);
  border-color: rgba(255, 193, 7, 0.25);
  color: #f8f9fa;
}

body.theme-grid .dg-watch-detail__player .post-body .post-media,
body.theme-grid .dg-watch-detail__player .post-body video {
  border-radius: 12px;
  overflow: hidden;
}

body.theme-grid .dg-watch-creator-card {
  padding: 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

body.theme-grid .dg-watch-creator-card__row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

body.theme-grid .dg-watch-creator-card__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

body.theme-grid .dg-watch-creator-card__name {
  font-weight: 600;
  color: var(--grid-text);
  text-decoration: none;
}

body.theme-grid .dg-watch-creator-card__name:hover {
  color: rgba(255, 255, 255, 0.9);
}

body.theme-grid .dg-watch-creator-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

body.theme-grid .dg-watch-related__title {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
  color: var(--grid-text);
}

/* Watch detail visual hierarchy */
body.theme-grid .dg-watch-detail__player { border: 1px solid rgba(255, 255, 255, .22); border-radius: 16px; overflow: hidden; background: linear-gradient(145deg, rgba(10,18,26,.96), rgba(4,8,12,.98)); box-shadow: 0 18px 48px rgba(0,0,0,.28); }
body.theme-grid .dg-watch-detail__player .post { margin: 0; border: 0; border-radius: 0; background: transparent; }
body.theme-grid .dg-watch-detail__player video { background: #000; }
body.theme-grid .dg-watch-related__title { display: flex; align-items: center; gap: .55rem; font-size: 1.08rem; letter-spacing: .01em; }
body.theme-grid .dg-watch-related__title::before { content: "04b"; font-family: "Font Awesome 5 Free"; font-weight: 900; color: rgb(255,255,255); font-size: .8em; }
body.theme-grid .dg-watch-creator-card { border-color: rgba(255, 255, 255, .18); box-shadow: 0 10px 26px rgba(0,0,0,.18); }
 (min-width: 992px) { body.theme-grid .dg-watch-detail__player { min-height: 0; } }
