/* 🌈 공통 색상 변수 */
:root {
  --bg: #ffffff;
  --text: #222222;
  --primary: #FF7920; /* 개혁신당 컬러 적용 */
  --accent: #cc5200;  /* 톤다운 컬러 */
  --card: #fef7f3;
  --muted: #666666;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.dark-mode {
  --bg: #121212;
  --text: #eeeeee;
  --card: #1e1e1e;
  --muted: #aaaaaa;
  --shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
}

/* 기본 스타일 */
body {
  font-family: 'Pretendard', 'Noto Sans KR', sans-serif;
  font-size: 17px;
  line-height: 1.7;
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  transition: background-color 0.3s, color 0.3s;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s;
}
a:hover {
  text-decoration: underline;
  color: var(--accent);
}

/* 헤더, 푸터 및 컨테이너 */
header, footer {
  background-color: var(--primary);
  color: white;
  padding: 1rem 0;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* 네비게이션 */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1rem;
  padding-left: 0;
  margin: 0;
}

nav li a {
  color: white;
  font-weight: bold;
}

button#darkToggle {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: 5px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}
.dark-mode button#darkToggle {
  background: var(--card);
  color: white;
  border-color: white;
}

/* 섹션 및 제목 */
main section {
  margin: 2rem 0;
}
h2 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

/* 카드 스타일 및 애니메이션 */
.card {
  background-color: var(--card);
  padding: 1rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  transition: transform 0.3s, box-shadow 0.3s;
  animation: fadeIn 0.6s ease forwards;
  opacity: 0;
  transform: translateY(10px);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
@keyframes fadeIn {
  to {
    opacity: 1;
    transform: none;
  }
}

/* 텍스트 관련 */
ul {
  padding-left: 1rem;
}
#newsList .card a,
#pollNews .card a,
#youtubeList .card a {
  color: var(--text);
  font-weight: 500;
  transition: color 0.3s;
}
#newsList .card p,
#pollNews .card p {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

/* 유튜브 카드 설정 */
#youtubeList .card {
  display: flex;
  gap: 1rem;
  align-items: center;
}
#youtubeList img {
  width: 120px;
  border-radius: 10px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}
#youtubeList img:hover {
  transform: scale(1.05);
}

/* 불필요한 트렌드 섹션은 나중에 배포 시 비활성화 */

/* 링크 아이콘 */
.link-icons {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 1rem 0;
  text-align: center;
}
.link-icons a {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
  transition: transform 0.2s ease;
}
.link-icons a:hover {
  transform: translateY(-4px);
}
.link-icons img {
  width: 64px;
  height: 64px;
  margin-bottom: 0.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}
.link-icons img:hover {
  transform: scale(1.05);
}

/* 반응형 스타일 */

/* 모바일 (max-width: 600px) */
@media (max-width: 600px) {
  body {
    font-size: 14px;
  }
  .container {
    padding: 0 0.5rem;
  }
  nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  nav li a {
    font-size: 14px;
  }
  .filter-bar {
    justify-content: center;
    margin-bottom: 0.75rem;
  }
  .filter-input {
    width: 100%;
    max-width: 250px;
  }
  .card {
    padding: 0.75rem;
    border-radius: 10px;
  }
  #youtubeList img {
    width: 100px;
  }
  .pagination {
    gap: 4px;
    margin-top: 1rem;
  }
  .pagination button {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
}

/* 태블릿 (min-width: 601px and max-width: 1024px) */
@media (min-width: 601px) and (max-width: 1024px) {
  body {
    font-size: 16px;
  }
  .container {
    padding: 0 1rem;
  }
  nav ul {
    flex-direction: row;
    gap: 0.75rem;
  }
  nav li a {
    font-size: 15px;
  }
  .filter-input {
    width: 100%;
    max-width: 300px;
  }
  .card {
    padding: 1rem;
    border-radius: 12px;
  }
  #youtubeList img {
    width: 110px;
  }
  .pagination {
    gap: 6px;
    margin-top: 1rem;
  }
  .pagination button {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }
}

/* PC (min-width: 1025px) */
@media (min-width: 1025px) {
  .card {\n    padding: 1.5rem;\n    margin: 1rem 0;\n  }\n  #newsList .card a,\n  #pollNews .card a,\n  #youtubeList .card a {\n    font-size: 20px;\n  }\n  nav ul {\n    display: flex;\n  }\n}

/* 위로가기 버튼 */
#scrollToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999;
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 12px 16px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: opacity 0.3s ease;
}
#scrollToTop:hover {
  background-color: var(--accent);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.pagination button {
  background: white;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
}
.pagination button.active,
.pagination button:hover {
  background: var(--primary);
  color: white;
}
.pagination button:disabled {
  opacity: 0.3;
  cursor: default;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
}
.filter-input {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  transition: box-shadow 0.3s, border 0.3s;
}
.filter-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 121, 32, 0.2);
}

/* Action Buttons */
.action-btn {
  background: white;
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
  margin-right: 8px;
  transition: background 0.3s, color 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.action-btn:hover {
  background: var(--primary);
  color: white;
}

/* Loader */
.loader {
  width: 32px;
  height: 32px;
  border: 3px solid var(--card);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
