/* Denticle — 광고 전용 스타일 */

/* ── 배너 광고 ── */
.ad-banner-wrap {
  position: relative;
  display: inline-flex;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--color-bg);
}

.ad-banner-wrap a {
  display: block;
  width: 100%;
  line-height: 0;
}

.ad-banner-wrap img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-sm);
}

/* 광고 라벨 오버레이 */
.ad-label {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(245, 158, 11, 0.92);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  line-height: 1.2;
  pointer-events: none;
  z-index: 2;
  letter-spacing: 0.03em;
}

/* ── 네이티브 광고 카드 ── */
.ad-native-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: relative;
  transition: box-shadow var(--transition);
  cursor: pointer;
}
.ad-native-card:hover { box-shadow: var(--shadow-md); }

.ad-native-card .ad-label {
  top: 8px;
  left: 8px;
}

.ad-native-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--color-bg);
}

.ad-native-body {
  padding: 12px 14px;
}

.ad-native-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ad-native-desc {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ad-native-cta {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary);
}

/* ── 프리미엄 광고 ── */
.ad-premium-card {
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: 16px;
  position: relative;
  box-shadow: 0 0 0 4px var(--color-primary-light);
}

.ad-premium-card .ad-label {
  position: static;
  display: inline-flex;
  margin-bottom: 10px;
}

/* ── 광고 슬롯 컨테이너 ── */
.ad-slot-top,
.ad-slot-bottom {
  width: 100%;
  overflow: hidden;
}

/* ── 하단 가로 나열 행 ── */
.ad-banner-row {
  display: flex;
  gap: 8px;
  width: 100%;
}
.ad-row-item {
  flex: 1 1 0;
  min-width: 0;
}
/* 3개 이상일 때 모바일에서 2열 wrap */
@media (max-width: 768px) {
  .ad-banner-row[data-count="3"] {
    flex-wrap: wrap;
  }
  .ad-banner-row[data-count="3"] .ad-row-item {
    flex: 1 1 calc(50% - 4px);
  }
  .ad-banner-row[data-count="3"] .ad-row-item:last-child {
    flex: 1 1 100%;
  }
  .ad-banner-row[data-count="4"] {
    flex-wrap: wrap;
  }
  .ad-banner-row[data-count="4"] .ad-row-item {
    flex: 1 1 calc(50% - 4px);
  }
}

/* Swiper 컨테이너 */
.ad-slot-top .swiper,
.ad-slot-bottom .swiper {
  width: 100%;
  height: auto;
}

.ad-slot-top .swiper-wrapper,
.ad-slot-bottom .swiper-wrapper {
  height: auto;
}

.ad-slot-top .swiper-slide,
.ad-slot-bottom .swiper-slide {
  height: auto;
}

/* 배너 wrap — PC: 4:1, 모바일: 2:1 */
.ad-slot-top .ad-banner-wrap,
.ad-slot-bottom .ad-banner-wrap {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 1;
  overflow: hidden;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
}
@media (max-width: 768px) {
  .ad-slot-top .ad-banner-wrap,
  .ad-slot-bottom .ad-banner-wrap { aspect-ratio: 2 / 1; }
}

/* 가로 행 안의 개별 광고: 각 셀 너비에 따라 비율 유지 */
.ad-row-item .ad-banner-wrap {
  aspect-ratio: 2 / 1;
}

.ad-slot-top .ad-banner-wrap > a,
.ad-slot-bottom .ad-banner-wrap > a {
  display: block;
  width: 100%;
  height: 100%;
  line-height: 0;
}

.ad-slot-top .ad-banner-wrap img,
.ad-slot-bottom .ad-banner-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Swiper 페이지네이션 광고 오버라이드 */
.ad-slot-top .swiper-pagination,
.ad-slot-bottom .swiper-pagination {
  bottom: 6px;
}
.ad-slot-top .swiper-pagination-bullet,
.ad-slot-bottom .swiper-pagination-bullet {
  background: #fff;
  opacity: 0.6;
}
.ad-slot-top .swiper-pagination-bullet-active,
.ad-slot-bottom .swiper-pagination-bullet-active {
  opacity: 1;
}

/* 사이드바 광고: 우측 고정 */
.ad-slot-side {
  position: fixed;
  right: 20px;
  top: 80px;
  width: 300px;
  z-index: 10;
}
.ad-slot-side .ad-banner-wrap {
  max-height: 250px;
  width: 300px;
}
.ad-slot-side .ad-banner-wrap img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}
.ad-slot-side a[href="#/ad-request"] {
  /* placeholder도 사이드바 크기에 맞춤 */
  width: 300px;
}
@media (max-width: 1280px) {
  /* 화면이 좁으면 사이드바 숨김 */
  .ad-slot-side { display: none !important; }
}

/* ── 광고주 대시보드 ── */
.advertiser-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}

.stat-card-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--color-primary);
  display: block;
  margin-bottom: 4px;
}

.stat-card-label {
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* 바 차트 */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 120px;
  padding: 8px 0 0;
}

.bar-chart-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.bar-chart-bar {
  width: 100%;
  background: var(--color-primary);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: height 0.3s ease;
  opacity: 0.8;
}
.bar-chart-bar:hover { opacity: 1; }

.bar-chart-label {
  font-size: 9px;
  color: var(--color-text-secondary);
  writing-mode: vertical-rl;
  white-space: nowrap;
  transform: rotate(180deg);
}

.chart-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.chart-tab {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 100px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all var(--transition);
}
.chart-tab.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* 캠페인 테이블 */
.campaign-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.campaign-table th,
.campaign-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
.campaign-table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-bg);
}
.campaign-table tr:last-child td { border-bottom: none; }
.campaign-table tr:hover td { background: var(--color-bg); }

/* 캠페인 상태 배지 */
.status-draft { background: var(--color-bg); color: var(--color-text-secondary); }
.status-pending_review { background: #FEF3C7; color: #B45309; }
.status-active { background: #D1FAE5; color: var(--color-success); }
.status-paused { background: #E5E7EB; color: #374151; }
.status-ended { background: #F3F4F6; color: #9CA3AF; }
.status-rejected { background: #FEE2E2; color: var(--color-error); }

/* ── 관리자 광고 관리 ── */
.admin-review-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  background: var(--color-surface);
}

.admin-review-card img {
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

@media (max-width: 768px) {
  .advertiser-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
