/* ===== Result Section Background ===== */
.result-section {
  min-height: calc(100vh - 100px);
  background: #F4F6F8; 
  /* 💡 위쪽 여백을 40px로 늘려서 헤더와 간격 확보 */
  padding: 40px 16px 60px;
}

.result-container {
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ===== 1. Hero Section (결과 타이틀) ===== */
.result-hero {
  text-align: center;
  padding: 60px 24px;
  background: linear-gradient(135deg, #FF6B35 0%, #FF8C5A 100%);
  border-radius: 32px;
  box-shadow: 0 20px 40px rgba(255, 107, 53, 0.2);
  color: #FFFFFF;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.result-hero::after {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
  border-radius: 50%;
}

/* 💡 추가: 큼지막하고 귀여운 대표 이모지 */
.result-hero-emoji {
  font-size: 80px;
  margin-bottom: 16px;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.15));
  animation: popIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s both;
}

/* 💡 변경: '다정한 평화주의자' 같은 키워드를 가장 크게 노출 */
.result-alias {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 900;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  text-shadow: 0 4px 12px rgba(0,0,0,0.1);
  animation: scaleIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s both;
  word-break: keep-all;
}

/* 💡 변경: 'INFP' 코드는 작고 흐릿한 서브 정보로 강등 */
.result-type-code {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.15em;
  margin-bottom: 24px;
  animation: fadeInUp 0.5s ease 0.4s both;
  text-transform: uppercase;
}

.result-summary {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.8;
  max-width: 500px;
  margin: 0 auto;
  font-weight: 500;
  animation: fadeInUp 0.5s ease 0.5s both;
}

/* ===== Common Card Style ===== */
.result-core-traits,
.result-keywords,
.result-daily-life {
  background: #FFFFFF;
  border-radius: 24px;
  padding: 40px 32px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.04); /* 고급스러운 부드러운 그림자 */
  border: 1px solid rgba(0,0,0,0.02);
  animation: fadeInUp 0.6s ease both;
  box-sizing: border-box;
}

.result-section-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 32px;
  text-align: center;
  position: relative;
}

/* 모바일에서 텍스트 왼쪽 정렬 */
@media (max-width: 480px) {
  .result-section-title {
    text-align: center; /* 제목은 중앙 유지 */
  }
  
  .trait-card {
    text-align: left; /* 모바일에서 왼쪽 정렬 */
    padding: 24px 20px;
  }
  
  .trait-description,
  .daily-life-description {
    text-align: left;
  }
  
  .daily-life-content {
    text-align: left;
  }
  
  .result-core-traits,
  .result-keywords,
  .result-daily-life {
    padding: 32px 20px;
  }
  
  .result-stats {
    padding: 32px 20px;
  }
}

/* 제목 아래 귀여운 포인트 점 */
.result-section-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  background: var(--color-accent);
  border-radius: 2px;
  margin: 12px auto 0;
}

/* =========================================
   Premium Personality Stats UI
========================================= */

.result-stats {
  background: #FFFFFF;
  border-radius: 28px;
  padding: 40px 32px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.axis-bars {
  display: flex;
  flex-direction: column;
  gap: 28px; /* 행 사이 간격을 넉넉히 */
  margin-top: 10px;
}

.axis-row {
  display: flex;
  flex-direction: column; /* 모바일/웹 공용으로 가독성 좋은 세로 배치 혼합 */
  gap: 10px;
}

/* ===== Axis Header — 3단 Grid 레이아웃 ===== */
.axis-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 4px;
  padding: 0;
  margin-bottom: 6px;
  box-sizing: border-box;
}

/* 왼쪽 trait (예: Introvert) — 왼쪽 정렬 */
.axis-label-left {
  font-size: 13px;
  font-weight: 600;
  color: #9CA3AF;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 중앙 퍼센트 값 */
.axis-value-center {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  color: var(--color-primary);
  text-align: center;
  white-space: nowrap;
  min-width: 48px;
  letter-spacing: -0.02em;
}

/* 오른쪽 trait (예: Extrovert) — 오른쪽 정렬 */
.axis-label-right {
  font-size: 13px;
  font-weight: 600;
  color: #9CA3AF;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 우세한 쪽 강조 */
.axis-label-left.dominant {
  color: var(--color-primary);
  font-weight: 800;
  font-size: 14px;
}

.axis-label-right.dominant {
  color: var(--color-primary);
  font-weight: 800;
  font-size: 14px;
}

/* 기존 클래스들 (하위 호환성 유지) */
.axis-traits {
  display: none; /* 더 이상 사용하지 않음 */
}

.axis-percent-wrapper {
  display: none; /* 더 이상 사용하지 않음 */
}

.axis-value {
  display: none; /* 더 이상 사용하지 않음 */
}

/* 그래프 바 스타일 업그레이드 */
.axis-bar-container {
  position: relative;
  height: 18px; /* 바 두께를 조금 더 키웁니다 */
  background: #F1F3F5;
  border-radius: 4px; /* 컨테이너는 약간 각진 느낌으로 변경 */
  margin: 8px 0;
  overflow: visible; /* 중앙선 표시를 위해 */
}

.axis-center-line {
  position: absolute;
  left: 50%;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: #ADB5BD; /* 중앙선을 조금 더 명확하게 */
  z-index: 5;
  border-radius: 2px;
}

.axis-fill {
  position: absolute;
  height: 100%;
  /* 💡 포인트: 중앙 쪽은 0, 바깥쪽만 둥글게 (isRightDominant에 따라 JS에서 제어할 수도 있음) */
  border-radius: 2px; 
  z-index: 10;
  transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  /* 💡 기존 width 애니메이션 대신 scaleX 애니메이션 권장 */
  animation: barGrow 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: 0.3s;
}

/* 💡 중앙에서 바깥으로 뻗어 나가는 애니메이션 */
@keyframes barGrow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* 축별 그라데이션 방향 조정 (중앙에서 바깥으로 흐르게) */
.axis-fill.axis-e { background: linear-gradient(to right, #FF9A8B, #FF6B35); }
.axis-fill.axis-s { background: linear-gradient(to right, #84FAB0, #8FD3F4); }
.axis-fill.axis-f { background: linear-gradient(to right, #A18CD1, #FBC2EB); }
.axis-fill.axis-j { background: linear-gradient(to right, #4FACFE, #00F2FE); }

/* 기존 trait-left, trait-right, vs-text는 더 이상 사용하지 않음 (하위 호환성) */
.trait-left, .trait-right {
  display: none;
}

.vs-text {
  display: none;
}

/* ===== 3. Core Traits (핵심 특징) ===== */
.traits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.trait-card {
  padding: 28px 24px;
  background: #F9FAFB;
  border-radius: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-align: center;
  box-sizing: border-box;
}

.trait-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.06);
  background: #FFFFFF;
}

.trait-icon {
  width: 64px; height: 64px;
  border-radius: 20px;
  background: var(--color-accent-glow);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  transform: rotate(-5deg); /* 살짝 비틀어 위트있게 */
}

.trait-icon .material-symbols-outlined {
  font-size: 32px;
  color: var(--color-accent);
}

.trait-title {
  font-size: 18px; 
  font-weight: 800; 
  color: var(--color-primary); 
  margin-bottom: 12px;
  line-height: 1.4;
}

.trait-description {
  font-size: 15px; 
  color: var(--color-primary-60); 
  line-height: 1.8;
  margin-bottom: 0;
}

/* 중요 키워드 하이라이트 */
.text-highlight {
  background: linear-gradient(120deg, var(--color-accent-glow) 0%, var(--color-accent-glow) 100%);
  padding: 2px 4px;
  border-radius: 4px;
  font-weight: 700;
  color: var(--color-primary);
}

/* ===== 4. Keywords (해시태그) ===== */
.keywords-list {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}

.keyword-tag {
  display: inline-block;
  padding: 12px 20px;
  background: #FFFFFF;
  color: var(--color-accent);
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 800;
  border: 1px solid rgba(255, 107, 53, 0.2);
  box-shadow: 0 4px 10px rgba(255, 107, 53, 0.05);
  transition: all 0.2s ease;
}

.keyword-tag:hover {
  background: var(--color-accent);
  color: #FFFFFF;
  transform: scale(1.05);
}

/* ===== 5. Daily Life (일상 묘사) ===== */
.daily-life-list {
  display: flex; flex-direction: column; gap: 16px;
}

.daily-life-item {
  display: flex; 
  gap: 20px; 
  align-items: flex-start;
  padding: 24px;
  background: #FFFFFF;
  border-radius: 20px;
  border: 1px solid #F3F4F6;
  transition: all 0.2s;
  box-sizing: border-box;
  margin-bottom: 0;
}

.daily-life-item:hover {
  border-color: var(--color-accent);
  background: var(--color-bg-warm);
}

.daily-life-icon {
  flex-shrink: 0; width: 48px; height: 48px;
  border-radius: 16px;
  background: var(--color-accent-glow);
  display: flex; align-items: center; justify-content: center;
}

.daily-life-icon .material-symbols-outlined {
  font-size: 24px;
  color: var(--color-accent);
}

.daily-life-content { 
  flex: 1; 
  min-width: 0;
}

.daily-life-title {
  font-size: 16px; 
  font-weight: 800; 
  color: var(--color-primary); 
  margin-bottom: 8px;
  line-height: 1.4;
}

.daily-life-description {
  font-size: 15px; 
  color: var(--color-primary-60); 
  line-height: 1.8;
  margin-bottom: 0;
}

/* daily-life-description에도 하이라이트 적용 */
.daily-life-description .text-highlight {
  background: linear-gradient(120deg, var(--color-accent-glow) 0%, var(--color-accent-glow) 100%);
  padding: 2px 4px;
  border-radius: 4px;
  font-weight: 700;
  color: var(--color-primary);
}

/* ===== Action Buttons (하단 고정/공유 버튼) ===== */
.result-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}

.result-btn {
  display: flex; 
  align-items: center; 
  justify-content: center; 
  gap: 8px;
  padding: 18px 24px;
  min-height: 48px; /* 터치 영역 확보 */
  border-radius: 20px;
  font-size: 16px; 
  font-weight: 800;
  transition: all var(--transition-fast);
  border: none; 
  cursor: pointer;
  -webkit-tap-highlight-color: transparent; /* 모바일 파란색 하이라이트 제거 */
  user-select: none;
}

.result-btn-primary {
  grid-column: span 2; /* 공유 버튼은 풀 사이즈로 강조 */
  background: var(--color-accent); color: white;
  box-shadow: 0 8px 24px rgba(255, 107, 53, 0.3);
}

.result-btn-primary:hover {
  background: #E85A28; transform: translateY(-2px);
}

.result-btn-secondary {
  background: #FFFFFF; color: var(--color-primary);
  border: 1px solid var(--color-border);
}

.result-btn-secondary:hover { background: #F9FAFB; }

/* ===== Animations ===== */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes barFill {
  from {
    width: 0%;
  }
}

/* 모바일 대응 */
@media (max-width: 480px) {
  .result-section {
    padding: 40px 20px 60px;
  }
  
  /* ===== Hero 섹션 ===== */
  .result-hero {
    padding: 36px 20px;
    border-radius: 24px;
  }
  .result-hero-emoji {
    font-size: 60px;
  }
  .result-alias {
    font-size: 26px;
    word-break: keep-all;
    overflow-wrap: break-word;
  }
  .result-summary {
    font-size: 14px;
    line-height: 1.7;
  }
  
  /* ===== 공통 카드 컨테이너 ===== */
  .result-core-traits,
  .result-keywords,
  .result-daily-life {
    padding: 24px 16px;
    border-radius: 20px;
  }
  .result-section-title {
    font-size: 19px;
    margin-bottom: 20px;
  }
  .result-section-title::after {
    width: 32px;
    height: 3px;
    margin: 8px auto 0;
  }
  
  /* ===== Stats 바 ===== */
  .result-stats {
    padding: 24px 16px;
  }
  .axis-bars {
    gap: 24px;
  }
  .axis-header {
    gap: 3px;
  }
  .axis-label-left, .axis-label-right {
    font-size: 12px;
  }
  .axis-label-left.dominant, .axis-label-right.dominant {
    font-size: 13px;
  }
  .axis-value-center {
    font-size: 16px;
    min-width: 42px;
  }
  .axis-bar-container {
    height: 14px;
  }
  
  /* ===== Core Traits ===== */
  .trait-card {
    padding: 20px 16px;
    text-align: left;
  }
  .trait-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    margin: 0 0 14px 0;
  }
  .trait-icon .material-symbols-outlined {
    font-size: 24px;
  }
  .trait-title {
    font-size: 16px;
    margin-bottom: 8px;
  }
  .trait-description {
    font-size: 14px;
    line-height: 1.7;
    margin-top: 0;
  }
  
  /* ===== Keywords ===== */
  .keyword-tag {
    padding: 8px 14px;
    font-size: 13px;
  }
  .keywords-list {
    gap: 8px;
  }
  
  /* ===== Daily Life (핵심: 세로 배치) ===== */
  .daily-life-item {
    flex-direction: column;
    gap: 12px;
    padding: 20px 16px;
  }
  .daily-life-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }
  .daily-life-icon .material-symbols-outlined {
    font-size: 20px;
  }
  .daily-life-title {
    font-size: 15px;
    margin-bottom: 6px;
  }
  .daily-life-description {
    font-size: 14px;
    line-height: 1.7;
    margin-top: 0;
  }
  
  /* ===== 버튼 ===== */
  .result-buttons {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .result-btn-primary {
    grid-column: span 1;
  }
  .result-btn {
    padding: 14px 20px;
    font-size: 14px;
    border-radius: 16px;
  }
}

/* 매우 작은 화면 (320px 이하) */
@media (max-width: 360px) {
  .result-section {
    padding: 32px 16px 50px;
  }
  .result-hero {
    padding: 32px 16px;
  }
  .result-hero-emoji {
    font-size: 48px;
  }
  .result-alias {
    font-size: 28px;
  }
  .result-stats {
    padding: 24px 16px;
  }
  .axis-bars {
    gap: 20px;
  }
  .axis-label-left, .axis-label-right {
    font-size: 11px;
  }
  .axis-label-left.dominant, .axis-label-right.dominant {
    font-size: 12px;
  }
  .axis-value-center {
    font-size: 14px;
    min-width: 36px;
  }
  .axis-bar-container {
    height: 12px;
  }
}

/* ===== Desktop Optimization ===== */
@media (min-width: 768px) {
  /* 💡 상단 패딩을 40px로 줄여서 헤더 바로 아래에 결과 카드가 자연스럽게 배치되도록 함 */
  .result-section { padding: 40px 40px 80px; }
  .result-hero { padding: 80px 40px; }
  .result-hero-emoji { font-size: 100px; }
  .result-alias { font-size: 48px; }
  .result-type-code { font-size: 18px; }
  .result-summary { font-size: 18px; max-width: 600px; }
  
  .result-buttons { grid-template-columns: 1fr 1fr 1fr; }
  .result-btn-primary { grid-column: span 1; } 
}

