/* ===== 홈 컨테이너 ===== */
.home-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

@media (min-width: 768px) {
  .home-container {
    width: 80%;
    padding: 40px 0;
  }
}

/* ===== 히어로 섹션 ===== */
.hero-section {
  text-align: center;
  padding: 32px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  color: white;
}

@media (min-width: 768px) {
  .hero-section {
    border-radius: 20px;
    padding: 48px 0;
  }
}

.hero-title {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 12px;
}

.hero-subtitle {
  font-size: 16px;
  opacity: 0.95;
  font-weight: 400;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 42px;
  }

  .hero-subtitle {
    font-size: 18px;
  }
}

/* ===== 장기 투표 카드 섹션 ===== */
.featured-votes-section {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.featured-votes-carousel {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  padding: 8px 0 24px 0;
}

.featured-votes-carousel::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
}

/* 모바일: 카드가 화면의 90% 차지 */
@media (max-width: 767px) {
  .featured-vote-card {
    flex: 0 0 90%;
    scroll-snap-align: center;
  }
}

/* 데스크톱: 카드가 화면의 70% 차지 */
@media (min-width: 768px) {
  .featured-vote-card {
    flex: 0 0 70%;
    scroll-snap-align: start;
  }
}

/* 스크롤 인디케이터 (dots) */
.carousel-indicators {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d0d0d0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-dot.active {
  background: #667eea;
  width: 24px;
  border-radius: 4px;
}

/* ===== 투표 카드 디자인 ===== */
.featured-vote-card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 16px;
  padding: 32px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}

/* 모바일: 카드 패딩 축소 */
@media (max-width: 767px) {
  .featured-vote-card {
    padding: 20px;
    border-radius: 12px;
  }
}

/* 배지 */
.vote-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 모바일: 배지 크기 축소 */
@media (max-width: 767px) {
  .vote-badge {
    top: 12px;
    right: 12px;
    padding: 4px 8px;
    font-size: 10px;
    letter-spacing: 0.3px;
  }
}

.vote-badge.hot {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
  color: white;
}

.vote-badge.close {
  background: linear-gradient(135deg, #ffd93d 0%, #ffb900 100%);
  color: #333;
}

.vote-badge.rising {
  background: linear-gradient(135deg, #6bcf7f 0%, #51b56d 100%);
  color: white;
}

.vote-badge.new {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
}

/* 카드 헤더 */
.vote-card-header {
  margin-bottom: 20px;
}

.vote-card-title {
  font-size: 24px;
  font-weight: 700;
  color: #222;
  margin-bottom: 12px;
  line-height: 1.4;
}

.vote-card-description {
  font-size: 15px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 16px;
}

.vote-card-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #888;
}

.vote-card-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vote-card-meta-icon {
  font-size: 16px;
}

/* 모바일: 카드 헤더 폰트 축소 */
@media (max-width: 767px) {
  .vote-card-header {
    margin-bottom: 16px;
  }

  .vote-card-title {
    font-size: 18px;
    margin-bottom: 8px;
  }

  .vote-card-description {
    font-size: 13px;
    margin-bottom: 12px;
  }

  .vote-card-meta {
    gap: 12px;
    font-size: 11px;
  }

  .vote-card-meta-icon {
    font-size: 14px;
  }
}

/* 진행률 바 섹션 */
.vote-progress-section {
  margin: 24px 0;
}

.vote-progress-bars {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.vote-progress-item {
  position: relative;
}

.vote-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 14px;
}

.vote-progress-text {
  font-weight: 600;
  color: #333;
}

.vote-progress-stats {
  display: flex;
  gap: 12px;
  align-items: center;
}

.vote-progress-percentage {
  font-size: 18px;
  font-weight: 700;
}

.vote-progress-count {
  font-size: 13px;
  color: #666;
}

.vote-progress-change {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

/* 모바일: 진행률 바 섹션 간격 축소 */
@media (max-width: 767px) {
  .vote-progress-section {
    margin: 16px 0;
  }

  .vote-progress-bars {
    gap: 12px;
  }

  .vote-progress-label {
    margin-bottom: 6px;
    font-size: 12px;
  }

  .vote-progress-percentage {
    font-size: 15px;
  }

  .vote-progress-count {
    font-size: 11px;
  }

  .vote-progress-change {
    font-size: 10px;
    padding: 2px 4px;
  }
}

.vote-progress-change.positive {
  background: #e8f5e9;
  color: #2e7d32;
}

.vote-progress-change.negative {
  background: #ffebee;
  color: #c62828;
}

/* 진행률 바 */
.vote-progress-bar-container {
  width: 100%;
  height: 48px;
  background: #f5f5f5;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

/* 2개 선택지 높이 */
.vote-progress-item.option-count-2 .vote-progress-bar-container {
  height: 48px;
}

/* 3개 선택지 높이 */
.vote-progress-item.option-count-3 .vote-progress-bar-container {
  height: 40px;
}

/* 4-5개 선택지 높이 */
.vote-progress-item.option-count-4 .vote-progress-bar-container,
.vote-progress-item.option-count-5 .vote-progress-bar-container {
  height: 36px;
}

/* 모바일: 진행률 바 높이 조정 */
@media (max-width: 767px) {
  .vote-progress-item.option-count-2 .vote-progress-bar-container {
    height: 44px;
  }

  .vote-progress-item.option-count-3 .vote-progress-bar-container {
    height: 40px;
  }

  .vote-progress-item.option-count-4 .vote-progress-bar-container,
  .vote-progress-item.option-count-5 .vote-progress-bar-container {
    height: 36px;
  }
}

.vote-progress-bar-fill {
  height: 100%;
  width: 0;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
  color: white;
  font-weight: 700;
  font-size: 16px;
  position: relative;
  overflow: hidden;
}

/* 진행률 바 애니메이션 효과 */
.vote-progress-bar-fill::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* 2개 선택지 색상 */
.vote-progress-bar-fill.option-0.total-2 {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.vote-progress-bar-fill.option-1.total-2 {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* 3개 선택지 색상 */
.vote-progress-bar-fill.option-0.total-3 {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.vote-progress-bar-fill.option-1.total-3 {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.vote-progress-bar-fill.option-2.total-3 {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

/* 4-5개 선택지 색상 (그라데이션) */
.vote-progress-bar-fill.option-0.total-4,
.vote-progress-bar-fill.option-0.total-5 {
  background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
}

.vote-progress-bar-fill.option-1.total-4,
.vote-progress-bar-fill.option-1.total-5 {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.vote-progress-bar-fill.option-2.total-4,
.vote-progress-bar-fill.option-2.total-5 {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.vote-progress-bar-fill.option-3.total-4,
.vote-progress-bar-fill.option-3.total-5 {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.vote-progress-bar-fill.option-4.total-5 {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
}

/* 카드 푸터 */
.vote-card-footer {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vote-card-stats {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

.vote-card-cta {
  padding: 10px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.vote-card-cta:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 모바일: 카드 푸터 간격 축소 */
@media (max-width: 767px) {
  .vote-card-footer {
    margin-top: 16px;
    padding-top: 16px;
  }

  .vote-card-stats {
    font-size: 12px;
  }

  .vote-card-cta {
    padding: 8px 16px;
    font-size: 12px;
  }
}

/* ===== 게시판 탭 섹션 ===== */
.board-tabs-section {
  width: 100%;
}

.tabs-header {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 20px;
}

.tab-button {
  padding: 12px 20px;
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  position: relative;
  transition: color 0.3s;
}

.tab-button.active {
  color: var(--primary-color);
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-color);
}

.tab-button:hover {
  color: var(--primary-color);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* 게시판 리스트 */
.board-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 공지사항 행 (심플한 스타일) */
.notice-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  padding: 12px 16px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  align-items: center;
}

.notice-row:hover {
  background: #f9f9f9;
  border-color: var(--primary-color);
  transform: translateX(4px);
}

.notice-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  background: #ff4444;
  color: white;
  font-size: 11px;
  font-weight: 700;
  border-radius: 3px;
  white-space: nowrap;
}

.notice-title {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice-title .comment-count {
  color: var(--primary-color);
  font-size: 13px;
  margin-left: 6px;
  font-weight: 600;
}

.notice-time {
  font-size: 13px;
  color: #888;
  white-space: nowrap;
}

@media (max-width: 767px) {
  .notice-row {
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto;
    gap: 6px;
    padding: 10px 12px;
  }

  .notice-badge {
    font-size: 10px;
    padding: 3px 6px;
    grid-row: 1;
    grid-column: 1;
  }

  .notice-title {
    font-size: 13px;
    grid-row: 1;
    grid-column: 2;
  }

  .notice-time {
    font-size: 11px;
    grid-row: 1;
    grid-column: 3;
  }
}

/* 일반 게시글 행 */
.board-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  padding: 12px 16px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  align-items: center;
}

.board-row:hover {
  background: #f9f9f9;
  border-color: var(--primary-color);
  transform: translateX(4px);
}

.post-title {
  font-size: 15px;
  font-weight: 500;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-count {
  color: var(--primary-color);
  font-size: 13px;
  margin-left: 6px;
  font-weight: 600;
}

.post-views {
  font-size: 13px;
  color: #888;
  white-space: nowrap;
}

.post-time {
  font-size: 13px;
  color: #888;
  white-space: nowrap;
}

@media (max-width: 767px) {
  .board-row {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .post-views {
    display: none;
  }
}

.board-more {
  margin-top: 20px;
  text-align: center;
}

.board-more-link {
  display: inline-block;
  padding: 10px 24px;
  color: var(--primary-color);
  text-decoration: none;
  border: 1px solid var(--primary-color);
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s;
}

.board-more-link:hover {
  background: var(--primary-color);
  color: white;
}

/* 로딩 스피너 */
.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
}

.spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 빈 상태 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state-text {
  font-size: 16px;
}

.empty-message {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 14px;
}

.error-message {
  text-align: center;
  padding: 40px 20px;
  color: #e74c3c;
  font-size: 14px;
}

/* ===========================
   투표 카드 2행 레이아웃
   =========================== */

/* 1행: 투표 결과 + 세부 이슈 (2컬럼) */
.vote-card-top-row {
  display: flex;
  gap: 16px;
  margin-top: 16px;
}

.vote-progress-section {
  flex: 1;
  min-width: 0;
}

/* 관련 이슈 사이드바 */
.vote-related-issues-sidebar {
  width: 200px;
  flex-shrink: 0;
  padding: 14px;
  background-color: #f5f5f5;
  border-radius: 6px;
}

.related-issues-title {
  font-size: 11px;
  font-weight: 600;
  color: #888;
  margin: 0 0 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.vote-related-issues-sidebar .related-issue-item {
  font-size: 11px;
  color: #666;
  line-height: 1.6;
  padding: 4px 0;
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.vote-related-issues-sidebar .related-issue-item:first-child {
  padding-top: 0;
}

.related-issue-more {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e0e0e0;
  font-size: 11px;
  color: #17a589;
  text-align: center;
  cursor: pointer;
  font-weight: 500;
}

.related-issue-more:hover {
  color: #138f73;
}

/* 2행: 목표 달성률 + 버튼 */
.vote-card-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.vote-card-stats {
  flex: 1;
  font-size: 13px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 6px;
}

.vote-card-cta {
  flex-shrink: 0;
}

/* 반응형 - 모바일에서는 세로 배치 */
@media (max-width: 900px) {
  .vote-card-top-row {
    flex-direction: column;
    gap: 12px;
  }

  .vote-related-issues-sidebar {
    width: 100%;
    padding: 12px;
  }

  .vote-card-bottom-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .vote-card-stats {
    font-size: 12px;
    justify-content: center;
  }

  .vote-card-cta {
    width: 100%;
  }
}
