/* ==========================
   PopupAds CSS (최종 완성본)
   - 반응형 / 여백제거 / 썸네일바 / 보지않기 유지
   ========================== */

/* ===== 오버레이 ===== */
.popads-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0.5;
  z-index: 9998;
}

/* ===== 팝업 기본 레이아웃 ===== */
.popads-wrap {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #111;
  color: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  z-index: 9999;
}

.popads-wrap[data-pos="custom"] {
  transform: none;
}

/* ===== 헤더 ===== */
.popads-head {
  padding: 10px 14px;
  font-weight: 700;
  background: #1e1e1e;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.popads-close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

/* ===== 본문 (슬라이드 + 썸네일) ===== */
.popads-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #000;
  position: relative;
}

/* 슬라이더: flex 1로 남은 공간을 모두 차지 */
.popads-slider {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  background: #000;
}

/* 슬라이드 개별 요소 */
.popads-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.35s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 0;
}

.popads-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

/* 이미지: 가로폭 100%, 여백 제거 */
.popads-slide a {
  display: block;
  width: 100%;
  height: 100%;
}

.popads-slide img {
  width: 100%; /* 팝업 가로폭 꽉 채움 */
  height: auto; /* 비율 유지 */
  display: block;
  object-fit: cover; /* 비율 유지를 하면서 꽉 채움 */
  margin: 0;
  border: 0;
}

/* ===== 썸네일 네비게이터 ===== */
.popads-thumbs {
  flex: 0 0 64px; /* 높이 고정 */
  height: 64px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: #0e0e0e;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

.popads-thumb {
  width: 48px;
  height: 48px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.6;
  flex-shrink: 0;
}

.popads-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.popads-thumb:hover {
  opacity: 0.9;
  transform: scale(1.05);
}

.popads-thumb.is-active {
  border-color: var(--hf-color-primary, #5c83ff);
  opacity: 1;
  transform: scale(1.08);
}

/* ===== 푸터 (N시간 보지 않기) ===== */
.popads-foot {
  flex: 0 0 auto;
  padding: 8px 12px;
  background: #1e1e1e;
  font-size: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

.popads-foot label {
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ===== 반응형 대응 ===== */
@media (max-width: 768px) {
  .popads-wrap {
    width: 90% !important;
    max-width: 420px;
  }
  .popads-thumb {
    width: 40px;
    height: 40px;
  }
  .popads-thumbs {
    flex: 0 0 56px;
    height: 56px;
  }
  .popads-foot {
    font-size: 12px;
  }
}

/* slide */
.popads-wrap[data-effect="slide"] .popads-slide {
  transition: transform 0.35s ease, opacity 0.35s ease;
  transform: translateX(100%);
  opacity: 0;
}
.popads-wrap[data-effect="slide"] .popads-slide.is-active {
  transform: translateX(0);
  opacity: 1;
}
.popads-wrap[data-effect="slide"] .popads-slide.is-prev {
  transform: translateX(-100%);
  opacity: 0;
}

/* zoom */
.popads-wrap[data-effect="zoom"] .popads-slide {
  transition: transform 0.35s ease, opacity 0.35s ease;
  transform: scale(0.96);
  opacity: 0;
}
.popads-wrap[data-effect="zoom"] .popads-slide.is-active {
  transform: scale(1);
  opacity: 1;
}
.popads-wrap[data-effect="zoom"] .popads-slide.is-leave {
  transform: scale(1.04);
  opacity: 0;
}

/* flip */
.popads-wrap[data-effect="flip"] .popads-slider {
  perspective: 1000px;
}
.popads-wrap[data-effect="flip"] .popads-slide {
  backface-visibility: hidden;
  transform: rotateY(90deg);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
}
.popads-wrap[data-effect="flip"] .popads-slide.is-active {
  transform: rotateY(0);
  opacity: 1;
}
.popads-wrap[data-effect="flip"] .popads-slide.is-leave {
  transform: rotateY(-90deg);
  opacity: 0;
}

/* none */
.popads-wrap[data-effect="none"] .popads-slide {
  transition: none;
}
