/* assets/css/blog_rank_modal.css */
/* 🌟 블로그차트 10주 순위 팝업 모달 — 2번 이미지 스타일 (헤더 + 3색 둥근 카드 + 양끝 정렬 차트) */

.bc-rank-modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Apple SD Gothic Neo", sans-serif;
  letter-spacing: -0.025em;
}
.bc-rank-modal-overlay.active {
  opacity: 1;
}

.bc-rank-modal-container {
  width: 100%;
  max-width: 760px;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15, 23, 42, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}
.bc-rank-modal-overlay.active .bc-rank-modal-container {
  transform: translateY(0) scale(1);
}

/* 1단계-1: 상단 미니 헤더 (블로거 정보 + 우측 닫기 ✕) */
.bc-rank-modal-top-header {
  padding: 14px 18px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  box-sizing: border-box;
}
.bc-modal-blogger-box {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}
.bc-blogger-crown {
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
}
.bc-blogger-name {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bc-blogger-sub {
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  line-height: 1.25;
  margin-left: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 상단 우측 원형 ✕ 닫기 버튼 */
.bc-rank-modal-close-x-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 10px;
  transition: all 0.15s ease-in-out;
}
.bc-rank-modal-close-x-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: scale(1.05);
}
.bc-rank-modal-close-x-btn:active {
  transform: scale(0.95);
}

/* 1단계-2: 3색 가로 스탯 카드 그리드 (2번 이미지 스타일: 1행 3열 나란히) */
.bc-stat-3col-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px 14px;
  background: #ffffff;
  box-sizing: border-box;
}

.bc-stat-card-item {
  border-radius: 12px;
  padding: 9px 10px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  user-select: none;
  box-sizing: border-box;
  min-height: 54px;
}

/* 1번 칸: 다크 골드/오렌지 (#d97706) */
.bc-card-gold {
  background: #d97706 !important;
}
/* 2번 칸: 사파이어 블루 (#2563eb) */
.bc-card-green {
  background: #2563eb !important;
}
/* 3번 칸: 비비드 로즈 핑크 (#db2777) */
.bc-card-blue {
  background: #db2777 !important;
}

.bc-stat-card-lbl {
  font-size: 11.5px;
  font-weight: 500;
  opacity: 0.95;
  margin-bottom: 2px;
  white-space: nowrap;
  line-height: 1.2;
}
.bc-stat-card-val {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-feature-settings: "tnum";
  white-space: nowrap;
  line-height: 1.2;
}
.bc-stat-card-val .unit {
  font-size: 12px;
  font-weight: 500;
  margin-left: 1.5px;
}

/* 주단위 말풍선 툴팁 */
.bc-chart-tooltip {
  position: absolute;
  transform: translate(-50%, -100%);
  background: #0f172a;
  color: #ffffff;
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.35;
  pointer-events: none;
  z-index: 20;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.28);
  white-space: nowrap;
  text-align: center;
  transition: left 0.08s ease-out, top 0.08s ease-out, opacity 0.12s ease-in-out;
  margin-top: -6px;
}
.bc-chart-tooltip::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px 5px 0;
  border-style: solid;
  border-color: #0f172a transparent transparent;
}
.bc-tt-date {
  font-size: 10px;
  color: #94a3b8;
  margin-bottom: 2px;
  font-weight: 500;
}
.bc-tt-rank {
  font-size: 13.5px;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: -0.01em;
}
.bc-tt-unit {
  font-size: 11px;
  color: #ffffff;
  font-weight: 500;
  margin-left: 1.5px;
}
.bc-tt-cat {
  font-size: 10px;
  color: #cbd5e1;
  margin-top: 1px;
}

/* 차트 포인트 호버 반응 및 최신 라벨 */
.bc-chart-point-marker {
  transition: r 0.15s ease-out, stroke-width 0.15s ease-out;
  cursor: pointer;
}
.bc-chart-point-marker:hover,
.bc-chart-point-marker.active {
  r: 7;
  stroke-width: 2.5;
}
.bc-chart-cur-rank-label {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  user-select: none;
  pointer-events: none;
}

/* 2단계: 중간 구글 애드센스 광고 */
.bc-rank-modal-ad-wrap {
  width: 100%;
  background: #f8fafc;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  overflow: hidden;
  height: auto;
  min-height: 0;
  padding: 8px 14px;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
}
.bc-rank-modal-ad-wrap:has(ins[data-ad-status="unfilled"]) {
  display: none !important;
}
.bc-rank-modal-ad-pc {
  width: 100%;
  height: auto;
  min-height: 0;
  display: flex;
  justify-content: center;
}
.bc-rank-modal-ad-m {
  width: 100%;
  height: auto;
  min-height: 0;
  display: flex;
  justify-content: center;
}
.bc-rank-modal-ad-wrap .adsbygoogle {
  width: 100%;
  height: auto;
  display: block;
}

/* 3단계: 하단 10주 차트 */
.bc-rank-modal-chart-section {
  padding: 16px 20px 18px;
  background: #ffffff;
  box-sizing: border-box;
}
.bc-chart-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.bc-chart-sec-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.03em;
}

.bc-rank-chart-svg-wrap {
  width: 100%;
  height: 180px;
  position: relative;
}

/* 로딩 스켈레톤 */
.bc-chart-skeleton {
  width: 100%;
  height: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
.bc-skeleton-pulse {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: bcPulse 1.4s infinite ease-in-out;
}
@keyframes bcPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 🌟 차트 하단 캡션 바 (좌측정렬: 범례 / 우측정렬: 공식 랭킹 — PC/모바일 모두 양끝 정렬 유지) */
.bc-chart-footer-bar {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: center !important;
  width: 100% !important;
  box-sizing: border-box;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  font-size: 11.5px;
  color: #64748b;
  font-weight: 500;
}
.bc-chart-legend-left {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}
.bc-legend-dot-rank {
  width: 14px;
  height: 2px;
  background: #38bdf8;
  display: inline-block;
  position: relative;
}
.bc-legend-dot-rank::after {
  content: '';
  position: absolute;
  top: -2px; left: 4px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #38bdf8;
  border: 1px solid #ffffff;
}
.bc-legend-text {
  font-weight: 700;
  color: #334155;
}
.bc-legend-divider {
  color: #cbd5e1;
  font-size: 10px;
}
.bc-legend-badge-peak,
.bc-legend-badge-cur {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
}
.bc-badge-gold {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffa200;
  display: inline-block;
}
.bc-badge-blue {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4361ee;
  display: inline-block;
}
.bc-chart-legend-right {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #94a3b8;
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}
.bc-chart-icon {
  width: 13px;
  height: 13px;
  color: #cbd5e1;
}

/* 🌟 블로그 카드 랭킹보기 CTA 버튼 (소프트 인디고 캡슐) */
.bc-btn-rank-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3.5px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #4361ee;
  background: #eff2fe;
  border: 1px solid #d0d7fc;
  border-radius: 9999px;
  cursor: pointer;
  flex-shrink: 0;
  letter-spacing: -0.2px;
  line-height: 1.2;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  vertical-align: middle;
}
.bc-btn-rank-cta:hover {
  background: #4361ee;
  color: #ffffff;
  border-color: #4361ee;
  box-shadow: 0 2px 8px rgba(67, 97, 238, 0.28);
}
.bc-btn-rank-cta:active {
  transform: scale(0.97);
}
.bc-btn-rank-cta .bc-btn-arrow {
  font-size: 9px;
  opacity: 0.85;
  transition: transform 0.15s ease-in-out;
}
.bc-btn-rank-cta:hover .bc-btn-arrow {
  transform: translateX(1.5px);
}

/* 반응형 모바일 최적화 (390px ~ 640px) */
@media (max-width: 640px) {
  .bc-rank-modal-overlay {
    padding: 10px;
  }
  .bc-rank-modal-container {
    max-width: 100%;
    border-radius: 14px;
  }
  .bc-rank-modal-top-header {
    padding: 12px 14px 8px;
  }
  .bc-blogger-name {
    font-size: 14.5px;
  }
  .bc-blogger-sub {
    font-size: 11px;
  }
  .bc-stat-3col-grid {
    gap: 6px;
    padding: 0 14px 12px;
  }
  .bc-stat-card-item {
    border-radius: 10px;
    padding: 7px 6px;
    min-height: 48px;
  }
  .bc-stat-card-lbl {
    font-size: 10.5px;
    margin-bottom: 1px;
  }
  .bc-stat-card-val {
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: -0.01em;
  }
  .bc-rank-modal-chart-section {
    padding: 12px 14px 14px;
  }
  .bc-rank-chart-svg-wrap {
    height: 160px;
  }
  /* 모바일에서도 한 줄 양끝 정렬 엄수 */
  .bc-chart-footer-bar {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    font-size: 10px !important;
    padding-top: 8px !important;
    margin-top: 8px !important;
  }
  .bc-chart-legend-left {
    gap: 4px !important;
    font-size: 10px !important;
  }
  .bc-legend-text {
    font-size: 10px !important;
  }
  .bc-legend-badge-peak,
  .bc-legend-badge-cur {
    font-size: 9.5px !important;
  }
  .bc-chart-legend-right {
    font-size: 9.5px !important;
  }
}

/* 데스크탑/모바일 애드센스 스위치 */
@media (min-width: 768px) {
  .bc-rank-modal-ad-pc { display: block !important; }
  .bc-rank-modal-ad-m { display: none !important; }
}
@media (max-width: 767px) {
  .bc-rank-modal-ad-pc { display: none !important; }
  .bc-rank-modal-ad-m { display: flex !important; }
}
