/* ── 기본 리셋 & 폰트 ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html {
  overflow-x: hidden;
}
body {
  min-height: 100%;
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0d0d1e;
  color: #c0c0ee;
  overflow-x: hidden;
}

/* ── 레이아웃 ── */
.report-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ── 헤더 ── */
.report-header {
  margin-bottom: 36px;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
}

.report-header-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  flex: 1;
}

.member-name {
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-size: 2.6rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
}

/* 이름 왼쪽 정당 색상 띠 */
.name-party-strip {
  display: block;
  width: 14px;
  align-self: stretch;
  flex-shrink: 0;
  margin-right: 12px;
}

.page-title {
  font-size: 2rem;
  font-weight: 900;
  color: #aaaaff;
  letter-spacing: -0.02em;
}
.page-subtitle {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  color: #5566aa;
  letter-spacing: 0;
  margin-top: 4px;
  margin-bottom: 0;
}

.party-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: bold;
  flex-shrink: 0;
}
.party-minjoo  { background: rgba(58,123,213,0.2); border: 1px solid rgba(58,123,213,0.5); color: #7aadff; }
.party-power   { background: rgba(224,48,48,0.2);  border: 1px solid rgba(224,48,48,0.5);  color: #ff8888; }
.party-joguk   { background: rgba(155,89,182,0.2); border: 1px solid rgba(155,89,182,0.5); color: #cc88ff; }
.party-gaehyuk { background: rgba(230,126,34,0.2); border: 1px solid rgba(230,126,34,0.5); color: #ffaa66; }
.party-other   { background: rgba(85,102,136,0.15);border: 1px solid rgba(85,102,136,0.4); color: #9999cc; }

.district-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.76rem;
  color: #7788aa;
  background: rgba(255,255,255,0.05);
  border: 1px solid #2a2a5a;
  flex-shrink: 0;
}

.report-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.back-link a {
  color: #5566aa;
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}
.back-link a:hover { color: #aaaaff; }

/* ── 크레딧 박스 ── */
.credit-box {
  display: inline-block;
  background: rgba(10,10,26,0.85);
  border: 1px solid #2a2a5a;
  border-radius: 8px;
  padding: 6px 13px;
  font-size: 12px;
  color: #9999cc;
  white-space: nowrap;
  user-select: none;
}
.credit-box a { color: #8888ff; text-decoration: none; }
.credit-box a:hover { color: #aaaaff; text-decoration: underline; }

.report-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #1a1a3a;
}

/* ── 요약 통계 ── */
.stats-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 32px;
}

.stat-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid #2a2a5a;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: center;
}

.stat-label { font-size: 0.68rem; color: #5566aa; margin-bottom: 4px; letter-spacing: 0.04em; }
.stat-value { font-size: 1.15rem; font-weight: 800; color: #aaaaff; letter-spacing: -0.02em; }

/* ── 섹션 ── */
.restaurant-section { margin-bottom: 44px; }
.restaurant-section h2 {
  font-size: 1.05rem;
  color: #7788cc;
  margin-bottom: 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid #2a2a5a;
}
.section-note { font-size: 0.72rem; color: #445566; margin-bottom: 14px; margin-top: 4px; }

/* ── 식당 리스트 ── */
.restaurant-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 14px;
}

.restaurant-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  min-height: 60px;
}
.restaurant-item:hover { background: rgba(255,255,255,0.06); border-color: #2a2a5a; }
.r-rank { font-size: 0.8rem; font-weight: 800; color: #3a3a7a; min-width: 26px; text-align: right; flex-shrink: 0; }
.restaurant-item:nth-child(1) .r-rank { color: #e8c44a; }
.restaurant-item:nth-child(2) .r-rank { color: #aaaaaa; }
.restaurant-item:nth-child(3) .r-rank { color: #c88850; }
.r-info { flex: 1; min-width: 0; }
.r-name {
  display: block;
  font-size: 0.96rem;
  font-weight: 700;
  color: #c0c0ee;
  text-decoration: none;
  transition: color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.r-name:hover { color: #aaaaff; text-decoration: underline; }
.r-addr { display: block; font-size: 0.72rem; color: #445566; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.r-visits { font-size: 0.9rem; font-weight: 700; color: #8888ff; }
.r-avg    { font-size: 0.7rem; color: #445566; }
.r-spend  { font-size: 0.82rem; font-weight: 700; color: #e08888; }

/* ── 인덱스 컨트롤 ── */
.index-controls {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

#idx-search {
  background: rgba(255,255,255,0.06);
  border: 1px solid #3a3a7a;
  border-radius: 8px;
  padding: 9px 16px;
  color: #c0c0ee;
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
  flex: 1;
  max-width: 320px;
}
#idx-search::placeholder { color: #334455; }
#idx-search:focus { border-color: #5555ff; background: rgba(255,255,255,0.09); }

.idx-count { font-size: 0.78rem; color: #445566; white-space: nowrap; }

/* ── 필터 행 ── */
.filter-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.filter-label {
  font-size: 0.72rem;
  color: #445566;
  padding-top: 5px;
  flex-shrink: 0;
  min-width: 24px;
}

/* ── 지역 칩 ── */
.rf-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.rf-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.74rem;
  border: 1px solid #2a2a5a;
  background: rgba(255,255,255,0.03);
  color: #7788aa;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.rf-chip em { font-style: normal; color: #445566; font-size: 0.65rem; }
.rf-chip:hover { background: rgba(255,255,255,0.08); border-color: #5555aa; color: #aaaaff; }
.rf-chip:hover em { color: #7788aa; }
.rf-chip.on {
  background: rgba(85,85,255,0.18);
  border-color: #5555ff;
  color: #c0c0ff;
  font-weight: 600;
}
.rf-chip.on em { color: #8888cc; }

/* ── 정당 칩 (색상 띠 포함) ── */
.pf-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.pf-chip {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0 10px 0 0;
  border-radius: 12px;
  font-size: 0.74rem;
  border: 1px solid #2a2a5a;
  background: rgba(255,255,255,0.03);
  color: #7788aa;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  overflow: hidden;
}
.pf-chip em { font-style: normal; color: #445566; font-size: 0.65rem; margin-left: 3px; }
.pf-party-strip {
  width: 14px;
  align-self: stretch;
  flex-shrink: 0;
  margin-right: 7px;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.pf-chip:hover { background: rgba(255,255,255,0.08); border-color: #5555aa; color: #aaaaff; }
.pf-chip:hover .pf-party-strip { opacity: 1; }
.pf-chip:hover em { color: #7788aa; }
.pf-chip.on {
  background: rgba(85,85,255,0.18);
  border-color: #5555ff;
  color: #c0c0ff;
  font-weight: 600;
}
.pf-chip.on .pf-party-strip { opacity: 1; }
.pf-chip.on em { color: #8888cc; }

/* ── 의원 리스트 ── */
.member-index-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 6px;
  margin-top: 16px;
}

.member-index-list li { display: block; }

/* 의원 링크 (색상 띠 스타일) */
.member-link {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #c0c0ee;
  text-decoration: none;
  background: rgba(255,255,255,0.04);
  border: 1px solid #2a2a5a;
  transition: all 0.15s;
  overflow: hidden;
  width: 100%;
  min-height: 48px;
}
.member-link:hover { background: rgba(255,255,255,0.1); border-color: #5555aa; color: #ffffff; }

.member-party-strip {
  width: 14px;
  flex-shrink: 0;
  opacity: 0.8;
  transition: opacity 0.15s;
}
.member-link:hover .member-party-strip { opacity: 1; }

.member-link-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 10px;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.member-link-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-link-district {
  display: block;
  font-size: 0.68rem;
  color: #5566aa;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.member-link:hover .member-link-district { color: #8899bb; }

/* ── 툴팁 & 모달 ── */
.tip-name  { font-size: 1.4rem; font-weight: bold; color: #aaaaff; display: block; margin-bottom: 15px; }
.tip-popular { color: #ff6666; font-weight: bold; font-size: 0.75rem; }
.tip-row   { font-size: 1rem; color: #9999cc; display: block; margin-bottom: 8px; }
.tip-val   { color: #ffffff; font-weight: bold; }
.tip-btn {
  display: block;
  padding: 5px 15px;
  background: #2a2a5a;
  border: 1px solid #4a4a8a;
  color: #aaaaff;
  border-radius: 6px;
  text-align: center;
  text-decoration: none;
  font-size: 1rem;
  font-weight: bold;
  transition: all 0.2s;
}
.tip-btn:hover { background: #3a3a7a; border-color: #6a6aaa; color: #ffffff; }

/* ── 오버레이 & 고정 모달 ── */
#overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.55);
  z-index: 2000;
  display: none;
}
#modal-fixed {
  position: fixed;
  top: 0; left: 0;
  width: 34%; height: 100%;
  z-index: 2100;
  display: none;
  background: rgba(10,10,30,0.96);
  border-right: 1px solid #4a4a8a;
  padding: 60px 30px;
  box-shadow: 10px 0 40px rgba(0,0,0,0.8);
  overflow-y: auto;
  color: #c0c0ee;
  line-height: 1.7em;
}
#modal-close {
  position: absolute;
  top: 20px; right: 20px;
  cursor: pointer;
  color: #8888ff;
  transition: color 0.2s;
  width: 24px; height: 24px;
}
#modal-close:hover { color: #ffffff; }

/* ── 방문 의원 목록 ── */
.visitors-section {
  margin-top: 18px;
  border-top: 1px solid #2a2a5a;
  padding-top: 14px;
}
.visitors-title { font-size: 0.8rem; color: #6677aa; margin-bottom: 10px; }
.visitors-list { display: flex; flex-wrap: wrap; gap: 5px; }
.visitor-chip {
  display: inline-flex;
  align-items: center;
  padding: 0 7px 0 0;
  border-radius: 12px;
  font-size: 0.72rem;
  border: 1px solid #2a2a5a;
  background: rgba(255,255,255,0.04);
  color: #b0b0cc;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
}
.visitor-party-dot {
  width: 15px;
  align-self: stretch;
  flex-shrink: 0;
  margin-right: 6px;
}
.visitor-more-btn {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  border: 1px dashed #3a3a6a;
  color: #7788bb;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.visitor-more-btn:hover { color: #aaaaff; border-color: #5555aa; }

/* ── 공유하기 버튼 ── */
.share-section {
  display: flex;
  justify-content: center;
  margin: 32px 0 0;
  padding-bottom: 8px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: rgba(85,85,255,0.12);
  border: 1px solid rgba(85,85,255,0.35);
  border-radius: 24px;
  color: #aaaaff;
  font-size: 0.92rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}
.share-btn:hover {
  background: rgba(85,85,255,0.24);
  border-color: rgba(85,85,255,0.6);
  color: #ffffff;
}
.share-btn svg { flex-shrink: 0; }

/* ── 반응형 ── */
@media (max-width: 768px) {
  .stats-summary { grid-template-columns: repeat(2, 1fr); }
  #modal-fixed { width: 60%; padding: 40px 20px; }
  .tip-name { font-size: 1.1rem; }
  .tip-row { font-size: 0.88rem; }
  .member-index-list { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

@media (max-width: 500px) {
  .report-wrap { padding: 24px 16px 60px; }
  .member-name { font-size: 1.8rem; }
  .report-header { gap: 10px; margin-bottom: 24px; }
  .page-subtitle { margin-bottom: 20px; }
  .stats-summary { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  #modal-fixed {
    width: 100%; height: 72%;
    top: auto; bottom: 0;
    border-right: none;
    border-top: 1px solid #4a4a8a;
    padding: 40px 18px 24px;
  }
  .restaurant-item { padding: 10px; gap: 10px; }
  .r-addr { font-size: 0.65rem; }
  .member-index-list { grid-template-columns: 1fr; }
  #idx-search { max-width: 100%; }
  .filter-row { flex-wrap: wrap; }
}
