/* =============================================================
   ManyPerson — Result 페이지 전용 CSS
   차트, 응답 카드, 공유 버튼, 통계
   ============================================================= */

/* ===== 헤더 추가 ===== */
.btn-copy-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--slate-600);
    border: 1px solid var(--slate-200);
    transition: all 0.2s;
}
.btn-copy-link:hover { background: var(--slate-100); }
.btn-copy-link .material-symbols-outlined { font-size: 1.125rem; }

/* ===== 메인 콘텐츠 ===== */
.result-main {
    max-width: 56rem;
    margin: 0 auto;
    padding: 2rem 1rem;
}
@media (min-width: 768px) {
    .result-main { padding: 3rem 1.5rem; }
}

/* ===== AdSense 광고 영역 ===== */
.adsense-container {
    margin-bottom: 1.5rem;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
}
.adsense-banner {
    width: 728px;
    height: 90px;
    max-width: 100%;
    margin: 0 auto;
}
@media (max-width: 767px) {
    .adsense-banner {
        width: 100%;
        height: 90px;
    }
}

/* ===== 질문 헤더 ===== */
.result-header { margin-bottom: 2.5rem; }

.result-title {
    font-size: 1.875rem;
    font-weight: 900;
    letter-spacing: -0.025em;
    line-height: 1.3;
    margin-bottom: 1rem;
}
@media (min-width: 768px) {
    .result-title { font-size: 2.25rem; }
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--slate-400);
}
.result-meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}
.result-meta-item .material-symbols-outlined { font-size: 1.125rem; }

.result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* ===== 선택지 배지 행 ===== */
.result-choices-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.625rem;
}
.result-choices-label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--slate-400);
    white-space: nowrap;
}
.result-choices-label .material-symbols-outlined { font-size: 0.9rem; }
.result-choice-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.2rem 0.625rem 0.2rem 0.25rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1.5px solid;
}
.result-choice-badge-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

/* ===== 참고 조건 ===== */
.result-conditions {
    margin-top: 1.25rem;
    padding: 1.25rem;
    border-radius: 1rem;
    background: var(--slate-50);
    border: 1px solid var(--slate-100);
}
.result-conditions-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--slate-500);
    margin-bottom: 0.75rem;
}
.result-conditions-title .material-symbols-outlined {
    font-size: 1rem;
    color: var(--slate-400);
}
.result-conditions-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.result-condition-item {
    position: relative;
    padding-left: 1rem;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--slate-600);
}
.result-condition-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    background: var(--slate-300);
}

/* ===== 차트 그리드 ===== */
.chart-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}
@media (min-width: 768px) {
    .chart-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 차트 그리드 안의 카드에 패딩 (원본 Tailwind p-6) */
.chart-grid .card { padding: 1.5rem; }

.chart-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
    font-size: 0.875rem;
}
.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.legend-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
}
.legend-dot-primary { background: var(--primary); }
.legend-dot-slate { background: var(--slate-300); }
.legend-dot-red { background: var(--red-400); }

/* ===== 통계 카드 ===== */
.stats-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.stats-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
}
.stat-label { font-weight: 700; color: var(--charcoal); }
.stat-value { font-weight: 900; color: var(--primary); font-size: 1.125rem; }
.stat-value-unit { font-size: 0.75rem; color: var(--slate-400); font-weight: 500; }

.stat-bar {
    height: 0.5rem;
    background: var(--slate-100);
    border-radius: 9999px;
    overflow: hidden;
}
.stat-bar-fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--blue-400));
    border-radius: 9999px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}
.stat-box { text-align: center; padding: 0.75rem; border-radius: 0.75rem; }
.stat-box-positive { background: rgba(0, 127, 255, 0.05); border: 1px solid rgba(0, 127, 255, 0.1); }
.stat-box-neutral { background: var(--slate-50); border: 1px solid var(--slate-100); }
.stat-box-negative { background: var(--red-50); border: 1px solid var(--red-100); }
.stat-box-number { font-size: 1.5rem; font-weight: 900; }
.stat-box-number-primary { color: var(--primary); }
.stat-box-number-slate { color: var(--slate-400); }
.stat-box-number-red { color: var(--red-400); }
.stat-box-label { font-size: 0.625rem; font-weight: 700; color: var(--slate-400); text-transform: uppercase; }

.stat-note {
    font-size: 0.75rem;
    color: var(--slate-400);
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--ivory);
    padding: 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid var(--slate-100);
}
.stat-note .material-symbols-outlined { font-size: 0.875rem; color: var(--emerald-400); }

/* ===== 연령대별 분석 ===== */
.age-chart-section { margin-bottom: 2rem; padding: 1.5rem; }

/* ===== 개별 응답 ===== */
.responses-section { margin-bottom: 2rem; }
.responses-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.responses-title {
    font-size: 1.125rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.responses-title .material-symbols-outlined { color: var(--primary); }
.responses-title-count { font-size: 0.875rem; font-weight: 400; color: var(--slate-400); }

/* 응답 카드 */
.response-list { display: flex; flex-direction: column; gap: 0.75rem; }
.response-card {
    background: #fff;
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(226, 232, 240, 0.6);
    transition: box-shadow 0.2s;
}
.response-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}
.response-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.response-avatar {
    width: 2.5rem; height: 2.5rem;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.response-avatar .material-symbols-outlined { font-size: 1.125rem; }
.response-avatar-pink { background: var(--pink-100); }
.response-avatar-pink .material-symbols-outlined { color: var(--pink-500); }
.response-avatar-violet { background: var(--violet-100); }
.response-avatar-violet .material-symbols-outlined { color: var(--violet-500); }
.response-avatar-amber { background: var(--amber-100); }
.response-avatar-amber .material-symbols-outlined { color: var(--amber-600); }
/* 성별 기본 아이콘 색상 — categoryClass가 없을 때 적용 */
.response-avatar-male { background: rgba(0,127,255,0.08); }
.response-avatar-male .material-symbols-outlined { color: var(--primary); }
.response-avatar-female { background: rgba(236,72,153,0.08); }
.response-avatar-female .material-symbols-outlined { color: var(--pink-500); }

.response-info { flex: 1; min-width: 0; }
.response-name { font-size: 0.875rem; font-weight: 700; color: var(--charcoal); display: block; }
.response-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; margin-top: 0.2rem; }
.response-location { font-size: 0.75rem; color: var(--slate-400); }
.response-tag-inline {
    font-size: 0.7rem; font-weight: 600;
    color: var(--slate-500);
    background: rgba(241, 245, 249, 0.9);
    border-radius: 9999px;
    padding: 0.1rem 0.5rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.response-score {
    display: inline-flex; align-items: center; gap: 0.25rem;
    font-size: 0.75rem; font-weight: 700;
    padding: 0.25rem 0.75rem; border-radius: 9999px;
    flex-shrink: 0;
}
.response-score-positive { color: var(--primary); background: rgba(0, 127, 255, 0.1); }
.response-score-neutral { color: var(--amber-600); background: var(--amber-50); }
.response-score-negative { color: var(--red-500); background: var(--red-50); }

.response-text { font-size: 0.875rem; color: var(--slate-700); line-height: 1.75; white-space: pre-line; }

.btn-more-responses {
    width: 100%;
    padding: 1rem;
    border-radius: 1rem;
    border: 2px dashed var(--slate-200);
    color: var(--slate-400);
    font-size: 0.875rem;
    font-weight: 700;
    transition: all 0.2s;
}
.btn-more-responses:hover {
    border-color: rgba(0, 127, 255, 0.3);
    color: var(--primary);
}

/* ===== 시뮬레이션 정보 ===== */
.sim-info-section { margin-bottom: 2rem; padding: 1.5rem; }
.sim-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    font-size: 0.875rem;
}
@media (min-width: 768px) {
    .sim-info-grid { grid-template-columns: repeat(4, 1fr); }
}
.sim-info-label { font-size: 0.75rem; color: var(--slate-400); margin-bottom: 0.25rem; }
.sim-info-value { font-weight: 700; }

/* ===== 공유 버튼 ===== */
.share-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
}
.btn-share {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-size: 0.875rem; font-weight: 700;
    transition: all 0.2s;
}
.btn-share:hover { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
.btn-share .material-symbols-outlined { font-size: 1.125rem; }
.btn-share-link { border: 1px solid var(--slate-200); background: #fff; color: var(--slate-600); }
.btn-share-kakao { background: #FEE500; color: #3C1E1E; }
.btn-share-x { background: var(--charcoal); color: #fff; }

/* ===== 소유자 공개 상태 배지 (결과 페이지) ===== */
.result-visibility-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.2s;
}
.result-visibility-badge.public {
    background: var(--emerald-50);
    color: var(--emerald-600);
    border-color: rgba(16, 185, 129, 0.25);
}
.result-visibility-badge.public:hover { background: var(--emerald-100); }
.result-visibility-badge.private {
    background: var(--slate-50);
    color: var(--slate-500);
    border-color: var(--slate-200);
}
.result-visibility-badge.private:hover { background: var(--slate-100); }
.result-visibility-badge .material-symbols-outlined { font-size: 0.875rem; }
.result-visibility-badge:disabled { opacity: 0.6; cursor: not-allowed; }

/* ===== 새 공유 버튼 스타일 ===== */
.btn-share-new {
    background: var(--primary);
    color: #fff;
}
.btn-share-new:hover { background: rgba(0,127,255,0.88); }

/* ===== 인사이트 카드 ===== */
.insight-card {
    padding: 1.5rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, rgba(0,127,255,0.03) 0%, rgba(168,85,247,0.03) 100%);
    border: 1px solid rgba(0,127,255,0.12);
}

.insight-title {
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.insight-body {
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--slate-700);
}
.insight-body ul,
.insight-body ol  { padding-left: 1.4rem; margin: 0.4rem 0; }
.insight-body li  { margin-bottom: 0.3rem; }
.insight-body p   { margin: 0.4rem 0; }
.insight-body strong { color: var(--charcoal); }

/* ===== 교차분석 카드 ===== */
.demo-chart-card {
    padding: 1.5rem;
    margin-bottom: 2rem;
}
.demo-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.demo-axis-tabs {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}
.demo-axis-tab {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--slate-400);
    border: 1.5px solid var(--slate-200);
    background: transparent;
    cursor: pointer;
    transition: all 0.18s;
}
.demo-axis-tab .material-symbols-outlined { font-size: 0.875rem; }
.demo-axis-tab:hover { color: var(--slate-600); border-color: var(--slate-300); }
.demo-axis-tab.active {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(0,127,255,0.06);
}
.demo-chart-wrap { position: relative; }

/* ===== multi 선택지 통계 (stats-card 내부) ===== */
.stat-highlight {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    background: rgba(0,127,255,0.05);
    border: 1px solid rgba(0,127,255,0.12);
    margin-bottom: 1rem;
}
.stat-highlight-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--slate-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.stat-highlight-value {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary);
    flex: 1;
}
.stat-highlight-rate {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-choice-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}
.stat-choice-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.8125rem;
}
.stat-choice-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    width: 6rem;
    font-weight: 600;
    color: var(--charcoal);
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stat-choice-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    flex-shrink: 0;
}
.stat-choice-bar-wrap {
    flex: 1;
    height: 0.5rem;
    background: var(--slate-100);
    border-radius: 9999px;
    overflow: hidden;
}
.stat-choice-bar {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.6s ease;
}
.stat-choice-rate {
    font-size: 0.75rem;
    color: var(--slate-400);
    font-weight: 600;
    white-space: nowrap;
    width: 5.5rem;
    text-align: right;
}

/* ===== 응답 아바타 단색 ===== */
.response-avatar {
    background: var(--slate-100);
    color: var(--slate-400);
}
.response-avatar .material-symbols-outlined { font-size: 1.25rem; }

/* ===== multi 응답 점수 뱉지 ===== */
.response-score-choice {
    color: var(--slate-600);
    background: var(--slate-100);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    max-width: 8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== 탭 그룹 (응답 필터) ===== */
.tab-group {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}
.tab-btn {
    padding: 0.4rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--slate-400);
    border: 1.5px solid var(--slate-200);
    background: transparent;
    cursor: pointer;
    transition: all 0.18s;
}
.tab-btn:hover { color: var(--slate-600); border-color: var(--slate-300); }
.tab-btn-active {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(0,127,255,0.06);
}

/* ===== MDIS 데이터 출처 링크 ===== */
.mdis-result-link {
    display: inline-flex;
    align-items: center;
    color: var(--slate-500);
    text-decoration: underline;
    text-decoration-color: var(--slate-200);
    text-underline-offset: 2px;
    transition: all 0.2s;
}
.mdis-result-link:hover {
    color: var(--primary);
    text-decoration-color: var(--primary);
}
