/* ============================================================
   PompomHub — Ad Blocker Notice Styles (ENHANCED)
   ============================================================ */

/* ---- Ad Blocker Notice Modal (Modal Mode) ---- */
.pompom-adblock-notice {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html.pompom-adblock-open .pompom-adblock-notice {
  visibility: visible;
  opacity: 1;
}

.pompom-adblock-notice__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.pompom-adblock-notice__panel {
  position: relative;
  z-index: 2;
  width: 90%;
  max-width: 480px;
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 32px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 85vh;
  overflow-y: auto;
}

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

.pompom-adblock-notice__eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent);
  margin: 0 0 12px 0;
}

.pompom-adblock-notice__panel h2 {
  margin: 0 0 16px 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.pompom-adblock-notice__panel p {
  margin: 0 0 12px 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text2);
}

.pompom-adblock-notice__hint {
  margin: 16px 0 0 0;
  padding: 12px 14px;
  background: var(--bg3);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--text2);
}

.pompom-adblock-notice__actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.pompom-adblock-notice__actions .btn {
  flex: 1;
  min-width: 120px;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

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

.pompom-adblock-notice__actions .btn-primary:hover {
  background: var(--accent-h);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(232, 93, 63, 0.3);
}

.pompom-adblock-notice__actions .btn-ghost {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
}

.pompom-adblock-notice__actions .btn-ghost:hover {
  background: var(--border);
  color: var(--text);
}

/* ---- Ad Blocker BLOCKING Mode (Complete Access Denial) ---- */
.pompom-adblock-notice--blocking {
  visibility: visible;
  opacity: 1;
}

.pompom-adblock-notice--blocking .pompom-adblock-notice__panel {
  max-width: 520px;
}

.pompom-adblock-notice--blocking .pompom-adblock-notice__panel h2 {
  color: #e74c3c;
  font-size: 1.6rem;
}

.pompom-adblock-notice--blocking .pompom-adblock-notice__panel p:first-of-type {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 20px;
}

.pompom-adblock-notice__blocking-footer {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text2);
}

.pompom-adblock-notice__blocking-footer p {
  margin: 0 0 8px 0;
  line-height: 1.6;
}

.pompom-adblock-notice__blocking-footer strong {
  color: var(--text);
  display: block;
  margin-top: 8px;
  margin-bottom: 4px;
}

html.pompom-adblock-blocking {
  overflow: hidden;
}

html.pompom-adblock-blocking body {
  overflow: hidden;
  pointer-events: none;
}

html.pompom-adblock-blocking .pompom-adblock-notice {
  pointer-events: all;
}

html.pompom-adblock-blocking main,
html.pompom-adblock-blocking .site-header,
html.pompom-adblock-blocking .site-footer,
html.pompom-adblock-blocking #sidebar {
  filter: blur(3px);
  pointer-events: none;
  opacity: 0.5;
}

/* ---- Prevent body scroll when modal open ---- */
html.pompom-adblock-open {
  overflow: hidden;
}

html.pompom-adblock-open body {
  overflow: hidden;
}

/* ---- Dark Mode Support ---- */
html.dark .pompom-adblock-notice__backdrop {
  background: rgba(0, 0, 0, 0.85);
}

html.dark .pompom-adblock-notice__panel {
  background: var(--bg2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

html.dark .pompom-adblock-notice__panel h2 {
  color: var(--text);
}

html.dark .pompom-adblock-notice__hint {
  background: var(--bg3);
  border-left-color: var(--accent);
}

/* ---- Tablet/Mobile Responsive ---- */
@media (max-width: 640px) {
  .pompom-adblock-notice__panel {
    width: 95%;
    padding: 24px 16px;
    border-radius: 12px;
  }

  .pompom-adblock-notice__panel h2 {
    font-size: 1.3rem;
  }

  .pompom-adblock-notice__panel p {
    font-size: 0.9rem;
  }

  .pompom-adblock-notice__actions {
    flex-direction: column;
    gap: 10px;
  }

  .pompom-adblock-notice__actions .btn {
    width: 100%;
    min-width: unset;
    padding: 14px 16px;
  }

  .pompom-adblock-notice__blocking-footer {
    font-size: 0.85rem;
  }
}

@media (max-width: 360px) {
  .pompom-adblock-notice__panel {
    width: 98%;
    padding: 20px 14px;
  }

  .pompom-adblock-notice__panel h2 {
    font-size: 1.2rem;
  }

  .pompom-adblock-notice__eyebrow {
    font-size: 0.7rem;
  }

  .pompom-adblock-notice__actions .btn {
    font-size: 0.9rem;
    padding: 12px 12px;
  }
}

/* ---- Reduced Motion Support ---- */
@media (prefers-reduced-motion: reduce) {
  .pompom-adblock-notice {
    transition: none;
  }

  .pompom-adblock-notice__panel {
    animation: none;
  }

  .pompom-adblock-notice__actions .btn:hover {
    transform: none;
  }
}

/* ---- Print Styles ---- */
@media print {
  .pompom-adblock-notice {
    display: none !important;
  }
}

/* ---- High Contrast Mode Support ---- */
@media (prefers-contrast: more) {
  .pompom-adblock-notice__backdrop {
    background: rgba(0, 0, 0, 0.9);
  }

  .pompom-adblock-notice__panel {
    border: 2px solid var(--border);
  }

  .pompom-adblock-notice__actions .btn {
    border: 2px solid currentColor;
  }
}

/* ---- Accessibility: Focus Styles ---- */
.pompom-adblock-notice__actions .btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(232, 93, 63, 0.2);
}

.pompom-adblock-notice__actions .btn:focus:not(:focus-visible) {
  outline: none;
}

/* ---- Preroll Ad Overlay (Video Player) ---- */
.preroll-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.preroll-ad-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  overflow: hidden;
}

.preroll-ad-area iframe,
.preroll-ad-area img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.preroll-bar {
  width: 100%;
  background: rgba(0, 0, 0, 0.95);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.preroll-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #999;
  letter-spacing: 1px;
}

.preroll-skip {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.preroll-skip:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.preroll-skip:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

.preroll-skip:not(:disabled):active {
  transform: scale(0.98);
}

/* ---- Player Inline Ad Overlay ---- */
.player-inline-ad {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.player-inline-ad__content {
  position: relative;
  z-index: 1;
  max-width: 90%;
  max-height: 90%;
  overflow: auto;
}

.player-inline-ad__content iframe,
.player-inline-ad__content img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.player-inline-ad__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 44px;
  height: 44px;
  padding: 0;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
}

.player-inline-ad__close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.player-inline-ad__close:active {
  transform: scale(0.95);
}

.player-inline-ad__close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ---- Ad Slot Container Styles ---- */
.pompom-ad-slot {
  margin: 16px 0;
  padding: 12px;
  background: var(--bg3);
  border-radius: var(--radius);
  overflow: hidden;
}

.pompom-ad-slot iframe {
  max-width: 100%;
  display: block;
  margin: 0 auto;
}

.pompom-ad-slot img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* ---- Ad Below Player ---- */
.ad-below-player {
  margin-top: 16px;
  padding: 12px;
  background: var(--bg3);
  border-radius: var(--radius);
}

/* ---- In-Feed Ad ---- */
.in-feed-ad {
  grid-column: 1 / -1;
  padding: 16px;
  background: var(--bg3);
  border-radius: var(--radius);
  text-align: center;
  margin: 16px 0;
}

in-feed-ad iframe {
  max-width: 100%;
}

/* ---- Header Banner Ad ---- */
.header-banner-ad {
  padding: 12px 0;
  text-align: center;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}

.header-banner-ad iframe {
  max-width: 100%;
  height: auto;
}

/* ---- Sidebar Ad ---- */
.sidebar-ad {
  padding: 12px;
  background: var(--bg3);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.sidebar-ad iframe {
  max-width: 100%;
  display: block;
}

/* ---- Loading State for Ads ---- */
.pompom-ad-slot.loading,
.ad-below-player.loading,
.in-feed-ad.loading {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--border) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  min-height: 250px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---- Empty Ad State ---- */
.pompom-ad-slot:empty::before {
  content: "";
  display: block;
  min-height: 1px;
}

/* ---- Responsive Ad Adjustments ---- */
@media (max-width: 768px) {
  .preroll-bar {
    flex-direction: column;
    gap: 8px;
  }

  .preroll-bar > * {
    width: 100%;
  }

  .preroll-skip {
    text-align: center;
  }

  .player-inline-ad__close {
    width: 36px;
    height: 36px;
    font-size: 24px;
    top: 8px;
    right: 8px;
  }
}

/* ---- Print Style ---- */
@media print {
  .preroll-overlay,
  .player-inline-ad,
  .pompom-ad-slot,
  .ad-below-player,
  .in-feed-ad,
  .header-banner-ad,
  .sidebar-ad {
    display: none !important;
  }
}
