/* 🌐 기본 스타일 정의 영역 (PC 중심) */
/* 기본 구조 */
body {
    margin: 0;
    font-family: sans-serif;
    background-color: #f9f9f9;
  }
  
  header {
    
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: #a8a7a7;
    color: rgb(0, 0, 0);
    padding: 40px 20px;
    text-align: center;
    
  }
  
  main {
    padding: 20px 20px;
    max-width: 1200px;
    margin: auto;
  }
  
  /* 카테고리 상단 네비게이션 */
  #categoryNav {
    text-align: center;
    padding: 15px;
    font-weight: bold;
    font-size: 18px;
    min-width: 870px;
  }
  
  /* 분야별 섹션 */
  .section {
    margin-bottom:10px;
    padding: 10px 20px;
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    min-width: 870px;
  }
  
  .section h2 {
    font-size: 20px;
    color: #008035;
    border-left: 6px solid #006e00;
    padding-left: 10px;
    margin-bottom: 10px;
  }


  .category-section {
    border: 2px solid #ccc;
    border-radius: 5px;
    background-color: #fdfdfd;
  }

  .category-section h3 {
    font-size: 20px;
    color: #008035;
    margin: 5px 0px;
  }
  
  /* 선택 항목 */
  .choice-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 기본은 3열 */
    gap: 16px;
  }

  
  .choice {
    display: inline-block;
    flex: 1 1 calc(33% - 20px);
    min-width: 250px;
    box-sizing: border-box;
    background-color: white;
    border: 2px solid #ccc;
    padding: 12px;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;    
  }
  
  .choice:hover {
    border-color: #008035;
    background-color: #e0e0e0;
  }
  
  .choice.selected {
    border-color: #008035;
    background-color: #e6f4ff;
  }

  .intro section {
    max-width: 800px;
    margin: 0 auto 32px;
    padding: 24px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  }
  
  .intro h2 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: #333;
  }
  
  .intro ol {
    padding-left: 20px;
    line-height: 1.7;
  }

  form {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }
  
  fieldset {
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 16px;
  }
  
  legend {
    font-weight: bold;
    margin-bottom: 8px;
  }

  .radio-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

    .radio-group div {
     min-width: 100px;
  
  }
  
  label {
    display: inline-block;
    margin: 0px 5px 2px 0px;    
    cursor: pointer;
  }

  /* 버튼 */
  #submit, #restart, #share-result, #share-start, #toggle-share-btn{
    display: inline-block;
    margin: 20px;
    padding: 10px 20px;
    font-size: 16px;
    background-color: #008035;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
  }

    #dashboard{
    display: inline-block;
    margin: 20px;
    padding: 10px 20px;
    font-size: 16px;
    background-color: #6f05e7;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
  }

    #openFeedback{
    display: inline-block;
    margin: 20px;
    padding: 10px 20px;
    font-size: 16px;
    background-color: #ff4d4d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
  }


  #prev {
    display: inline-block;
    margin: 20px;
    padding: 10px 20px;
    font-size: 16px;
    background-color: #7a00cc;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
  }

  #prev:disabled {
    background-color: #999;
    cursor: not-allowed;
  }
  
  #submit:disabled {
    background-color: #999;
    cursor: not-allowed;
  }

  .button-group {
    display: flex;
    justify-content: center;   /* 중앙 정렬 */
    gap: 16px;                 /* 버튼 사이 간격 */
    margin-top: 10px;          /* 상단 여백 */
  }
  
  .button-group button {
    min-width: 120px;
    padding: 12px 20px;
    font-weight: bold;
    font-size: 1.1rem;
    border-radius: 8px;
  }
  
  #categoryNav {
    text-align: center;
    margin: 20px 0;
  }
  
  .category-tab {
    display: inline-block;
    margin: 0 8px;
    font-size: 18px;
    font-weight: normal;
    padding: 4px 8px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease-in-out;
    cursor: default;
  }
  
  .category-tab.active {
    font-size: 22px;
    font-weight: bold;
    border-bottom: 3px solid #008035;
    color: #008035;
  }
  
  /* 결과 페이지 전체 영역 */
.result-page {
  padding: 20px;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.result-stats {
  font-size: 20px;
  line-height: 1.6;
  text-align: left;
  min-width: 200px;
  font-weight: bold;
  margin-right: 20px;
}

/* 결과 리스트 */
.result-list {
  list-style: none;
  padding: 0;
  margin-top: 20px;
  margin-bottom: 30px;
}

.result-list li {
  font-size: 15px;
  margin: 10px 0;
}

/* 그래프 */
#pieChart {
  display: block;
  margin: 0 auto;
  max-width: 300px;
  max-height: 300px;
}



.chart-with-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap; /* 모바일 대응 */
  margin-top: 20px;
}

.selection-summary {
  max-width: 800px;
  margin: auto;
  padding: 20px;
  border-top: 2px solid #ccc;
}

.summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}


.summary-section {
  border-bottom: 1px dashed #ccc;
  padding: 10px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  min-width: 0;
}


.summary-section h3 {
  font-size: 20px;
  color: #02531a;
  margin: 10px;
}

.summary-item {
  margin: 6px 0;
  font-size: 14px;
  color: #000000;
  font-weight: bold;
}

.summary-candidate {
  font-size: 14px;
  font-weight: bold;
  margin-left: 4px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1rem;
}

/* 후보별 글씨 색상 */
.candidate-이재명 {
  color: #36a2eb; /* 하늘색 */
}
.candidate-김문수 {
  color: #ff4d4d; /* 붉은색 */
}
.candidate-이준석 {
  color: #ff9900; /* 주황색 */
}

.user-info {
  margin-bottom: 12px;
  font-size: 1rem;
  color: #444;
}
.user-info p {
  margin: 2px 0;
}

.feedback-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5); /* 반투명 배경 */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.feedback-modal {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  text-align: center;
}

.feedback-modal textarea {
  width: 90%;
  padding: 0.75rem;
  resize: vertical;
  font-size: 1rem;
  margin: 1rem 0;
}

.feedback-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}


/* --- Footer Links (추가) --- */
.footer-links {
  margin-bottom: 16px;
}

.footer-links a {
  color: #555555;
  text-decoration: none;
  margin: 0 10px;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* --- Detailed Results Section (추가) --- */
#detailed-results {
  text-align: left;
  margin-top: 40px;
  padding: 20px;
  background-color: #f9f9f9;
  border-radius: 8px;
  border: 1px solid #eee;
}

#detailed-results h2 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 1.5rem;
  color: #333;
}

.detailed-candidate-block {
  margin-bottom: 24px;
}

.detailed-candidate-block h3 {
  font-size: 1.2rem;
  padding-bottom: 8px;
  border-bottom: 2px solid;
  margin-bottom: 12px;
}

.detailed-pledge-list {
  list-style-type: none;
  padding-left: 0;
}

.detailed-pledge-list li {
  background-color: #fff;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 8px;
  border-left: 4px solid #ddd;
  font-size: 1rem;
  line-height: 1.6;
}
/* ------------------------------------ */


/* --- Social Share Buttons (수정) --- */
.social-share-buttons {
  display: none; /* 기본적으로 숨김 */
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
  padding: 0 20px;
}

/* ▼▼▼ [추가] JavaScript가 이 클래스를 추가하면 아이콘들이 보이게 됨 ▼▼▼ */
.social-share-buttons.is-visible {
  display: flex;
}

.social-share-buttons button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background-color: #fff;
  cursor: pointer;
  padding: 10px;
  transition: transform 0.2s ease;
}

.social-share-buttons button:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.social-share-buttons svg {
  width: 100%;
  height: 100%;
}

#kakao-share-btn svg { fill: #3C1E1E; }
#facebook-share-btn svg { fill: #1877F2; }
#twitter-share-btn svg { fill: #1DA1F2; }
/* --------------------------------- */

/* ==================================== */
/* 메인 대시보드 페이지 스타일        */
/* ==================================== */

.main-header {
  background-color: #004098; /* 새 헤더 색상 */
  color: white;
  padding: 40px 20px;
  text-align: center;
  border-bottom: 5px solid #FFD700;
}

.main-header h1 {
  margin: 0;
  font-size: 2rem;
}

.main-header p {
  margin: 8px 0 0;
  font-size: 1.1rem;
  opacity: 0.9;
}

.main-dashboard {
  max-width: 1000px;
  margin: 20px auto;
  padding: 20px;
}

.election-summary {
  background: #f9f9f9;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  margin-bottom: 40px;
  border: 2px solid #004098; /* 파란색 계열의 강조 테두리 */
  background-color: #ffffff; /* 아주 옅은 푸른색 배경 */
}

.election-summary h2 {
  margin: 0 0 24px 0;
  font-size: 1.8rem;
}

.winner-profile {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
}

.winner-photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #ddd;
}

.winner-info .winner-party {
  font-size: 1rem;
  color: #666;
  margin: 0;
}

.winner-info .winner-name {
  font-size: 2.2rem;
  font-weight: bold;
  margin: 4px 0;
}

.winner-info .winner-votes {
  font-size: 1.1rem;
  color: #333;
  margin: 0;
}

.election-stats {
  border-top: 1px solid #e0e0e0;
  padding-top: 16px;
  font-size: 1rem;
}
.election-stats p {
  margin: 4px 0;
}

.nav-button {
  display: block;
  background: white;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  text-decoration: none;
  color: #333;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-button:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.nav-button h3 {
  margin: 0 0 8px 0;
  font-size: 1.3rem;
  color: #004098;
}

.nav-button p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #666;
}


/* ==================================== */
/* 공통 내비게이션 바 (GNB) 스타일      */
/* ==================================== */
.gnb {
  width: 100%;
  background-color: #ffffff;
  border-bottom: 1px solid #e0e0e0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.gnb-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  height: 60px;
}

.gnb-logo {
  font-size: 1.2rem;
  font-weight: bold;
  color: #1a0dab;
  text-decoration: none;
}

.gnb-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 24px;
}

.gnb-menu a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  padding: 8px;
  transition: color 0.2s ease;
}

.gnb-menu a:hover {
  color: #004098;
}

/* ================================= */
/* 중요도 높은 카드 강조 스타일 (추가) */
/* ================================= */
/* 제안 1: 은은하게 빛나는 효과 */
.nav-button.featured {
  background-color: #f0f6ff;
  border: 1px solid #004098;
  position: relative; /* 애니메이션 효과를 위해 추가 */
  z-index: 1; /* 다른 요소 위에 보이도록 */
  animation: pulse-glow 2.5s infinite ease-in-out;
}

/* 빛나는 효과를 위한 애니메이션 정의 */
@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 5px #a0c4ff, 0 0 10px #a0c4ff;
  }
  50% {
    box-shadow: 0 0 15px #8bb5ff, 0 0 25px #8bb5ff;
  }
  100% {
    box-shadow: 0 0 5px #a0c4ff, 0 0 10px #a0c4ff;
  }
}

/* ==================================== */
/* 메인 페이지 2단 구조 및 광고 영역 스타일 */
/* ==================================== */

/* 광고 영역 플레이스홀더 기본 스타일 */
.ad-placeholder {
  background-color: #f0f0f0;
  border: 2px dashed #ccc;
  color: #aaa;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1rem;
  font-weight: bold;
  width: 100%;
  box-sizing: border-box;
}

/* 상단 배너 광고 영역 */
.ad-banner-top {
  min-height: 90px;
  margin-top: 30px;
}

/* 사이드바 광고 영역 */
.ad-sidebar {
  min-height: 250px;
}


/* ===================================== */
/* 인덱스 페이지 메인 콘텐츠 레이아웃 (최종 완성본) */
/* ===================================== */

/* 1. 기본 상태 (모바일): 모든 것을 1열로 쌓는 구조 */
.top-profile-area {
  display: grid;
  gap: 30px;
}

/* 데스크톱: 화면이 992px 이상일 때 2단으로 변경 */
@media screen and (min-width: 992px) {
  .top-profile-area {
    grid-template-columns: 2fr 1fr; /* 프로필 2, 광고 1 비율 */
    align-items: flex-start;
  }
}

/* --- 2. 하단 메뉴 영역 --- */

/* 기본 (모바일): 1열로 쌓기 */
.main-navigation {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
  margin-top: 40px; /* 상단 영역과의 간격 */
}

/* 데스크톱: 화면이 992px 이상일 때 3단으로 변경 */
@media screen and (min-width: 992px) {
  .main-navigation {
    grid-template-columns: repeat(3, 1fr); /* 3개의 열을 1:1:1 비율로 */
  }
}

/* 📱 반응형 스타일 정의 영역 (모바일 대응) */
@media screen and (max-width: 768px) {
  body {
    font-size: 16px;
    padding: 0px;
  }
  .gnb-menu {
    display: none; /* 모바일에서는 메뉴 숨김 (추후 햄버거 메뉴로 개선 가능) */
  }
  .gnb-inner {
    justify-content: center; /* 로고 중앙 정렬 */
  }
  
  .main-dashboard {
    display: flex; /* Flexbox 레이아웃 적용 */
    flex-direction: column; /* 자식 요소들을 세로로 쌓음 */
    align-items: center; /* 자식 요소들을 가로축의 가운데로 정렬 */
  }

  header  {
    min-width: 300px;
    padding: 10% 0%;
    text-align: center;
  }
  header h1 {
    font-size: 2rem !important;
    line-height: 1.3;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    margin: 0;
  }

  h1 {
    font-size: 1.5rem;
    text-align: center;
  }

  h2 {
    padding: 0px 30px;
    font-size: 1.2rem;    
    color: #333;    
  }

  .section {
    margin-bottom: 10px;
    padding: 10px 0px;
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    min-width: 300px;
  }
  
  .section h2 {
    font-size: 1rem;
    color: #008035;
    border-left: 6px solid #006e00;
    padding-left: 10px;
    margin: 0px 10px 10px;
  }

  .section ul {
    padding: 0px;
    margin: 0px;
    list-style: none;
  }
  

  .intro section {
    max-width: 800px;
    margin: 10px 0px;
    padding: 10px 0px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  }
  
  .intro h2 {
    padding-left: 20px;
    font-size: 1.2rem;
    margin-bottom: 5%;
    color: #333;    
  }

  .intro p {
    font-size: 1rem;
    padding : 0px 20px;
    margin-bottom: 5%;
    color: #333;
    font-weight: bold;    
  }
  
  .intro ol {
    margin: auto 10px;
    font-size: 0.8rem;
    padding: auto;
    line-height: 1.5;
    
  }

  form {
    margin: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  fieldset {
    margin-top: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 10px;
    font-size: 0.8rem;
  }

  .radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
  }

  label {
    display: inline-block;
    cursor: pointer;
    margin: 0;
  }

  main {
    max-width: 1200px;
    min-width: 300px;    
    padding: 0px;
  }

  #categoryNav {
    text-align: center;
    margin: 0;
    padding: 15px 0px;
    min-width: 300px;
  }
  
  .category-tab {
    display: inline-block;
    margin: 0 4px;
    font-size: 0.8rem;
    font-weight: normal;
    padding: 2px 4px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease-in-out;
    cursor: default;
  }
  
  .category-tab.active {
    font-size: 1.1rem;
    font-weight: bold;
    border-bottom: 3px solid #008035;
    color: #008035;
  }

  

  .choice-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    align-items: stretch !important;
    padding: 0px !important;
  }

  .choice {    
    font-size: 0.8rem !important;
    padding: 10px !important;
    box-sizing: border-box;
  }

  #restart, #share-result, #share-start, #toggle-share-btn {
    display: inline-block;
    margin: 4px 0px;
    padding: 10px 0px;
    font-size: 12px;
    background-color: #008035;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
  }

    #submit {
    display: inline-block;
    margin: 10px;
    padding: 10px 10px;
    font-size: 12px;
    background-color: #008035;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
  }

  #prev {
    display: inline-block;
    margin: 10px;
    padding: 10px 10px;
    font-size: 12px;
    background-color: #7a00cc;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
  }

  #prev:disabled {
    background-color: #999;
    cursor: not-allowed;
  }
  
  #submit:disabled {
    background-color: #999;
    cursor: not-allowed;
  }

  .button-group {
    flex-direction: flex;
    gap: 10px;
    margin: 10px 0px;
    justify-content: center;
    min-width: 300px;
  }

    .button-group button {
    min-width: 80px;
  }


  button {
    font-size: 0.8rem;
    padding: 0px;
    margin: 10px 0px;
  }

  canvas {
    width: 100% !important;
    height: auto !important;
  }

  .user-info, .summary-item {
    font-size: 0.95rem;
    padding: 4px 0;
  }
}

.site-footer {
  background-color: #f4f4f4; /* 아주 밝은 회백색 */
  color: #444444;           /* 차분한 어두운 회색 */
  padding: 24px 16px;
  font-size: 14px;
  text-align: center;
  border-top: 2px solid #cccccc;
  margin-top: 40px;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
}

.site-footer a {
  color: #006699; /* 강조는 약간 푸른 기운, 그러나 정당색 아님 */
  text-decoration: none;
  margin: 0 8px;
  font-weight: bold;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* --- [모바일용] 결과 페이지 상세 분석 --- */
  #detailed-results {
    margin-top: 24px;
    padding: 16px;
  }
  #detailed-results h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding: 0; /* 기존 모바일 h2 스타일에 맞게 조정 */
  }
  .detailed-candidate-block h3 {
    font-size: 1.1rem;
  }
  .detailed-pledge-list li {
    font-size: 0.9rem;
    padding: 10px;
  }

  /* --- [모바일용] 소셜 공유 버튼 --- */
  .social-share-buttons {
    gap: 12px;
  }
  .social-share-buttons button {
    width: 44px;
    height: 44px;
    padding: 8px;
  }

  /* ===================================== */
/* 인덱스 페이지 배너형 버튼 스타일 (최종) */
/* ===================================== */

/* --- 공통 스타일: 배경 이미지를 위한 설정 --- */
#ktv-button, #imagine-button {
  position: relative; /* 텍스트와 오버레이의 위치 기준점 */
  background-size: cover; /* 이미지가 버튼을 꽉 채우도록 */
  background-position: center; /* 이미지의 중앙을 표시 */
  color: rgb(255, 255, 255); /* 텍스트 색상을 흰색으로 */
  z-index: 1;
  min-height: 60px; /* 버튼의 최소 높이 설정 */
}

#ktv-button:hover::before, #imagine-button:hover::before {
  background-color: rgba(0, 0, 0, 0.65); /* 마우스를 올리면 더 어둡게 */
}


/* KTV 국민방송 버튼 스타일 */
#ktv-button {
  background-image: url('images/ktv_logo.jpg');
  background-size: contain; /* ▼▼▼ 수정: 이미지가 잘리지 않도록 contain 사용 ▼▼▼ */
  background-repeat: no-repeat; /* ▼▼▼ 추가: 이미지가 반복되지 않도록 설정 ▼▼▼ */
}

/* KTV 이매진 (YouTube) 버튼 스타일 */
#imagine-button {
  background-image: url('images/imagine_logo.jpg');
  background-size: 100%; /* 로고가 너무 크지 않도록 조절 */
  background-size: contain; /* ▼▼▼ 수정: KTV와 통일성을 위해 contain 사용 ▼▼▼ */
  background-repeat: no-repeat;
  /* 로고가 너무 작아보이지 않도록 패딩 조절 */
  padding-top: 30px;
  padding-bottom: 30px;
}