/* 전역 스타일 초기화 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
}

/* 모던 헤더 */
.modern-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
}

.logo-icon {
  font-size: 2rem;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  font-size: 0.75rem;
  color: #666;
  font-weight: 300;
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

.main-nav a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.main-nav a:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  transform: translateY(-2px);
}

.header-actions {
  display: flex;
  gap: 1rem;
}

.search-btn, .theme-toggle {
  background: none;
  border: 2px solid #e0e0e0;
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  text-decoration: none;
}

.search-btn:hover, .theme-toggle:hover {
  border-color: #667eea;
  color: #667eea;
  transform: scale(1.1);
}

/* 메인 컨텐츠 */
.main-content {
  min-height: calc(100vh - 140px);
}

/* 홈페이지 스타일 */
.home-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* 히어로 섹션 */
.hero-section {
  padding: 1.5rem 0;
  text-align: center;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-radius: 20px;
  margin: 1.5rem 0;
}

.hero-title {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.gradient-text {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.highlight {
  color: #1a1a1a;
}

.hero-description {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 2rem;
  font-weight: 300;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 900;
  color: #667eea;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.9rem;
  color: #666;
  font-weight: 500;
}

/* 필터 섹션 */
.filter-section {
  padding: 3rem 0;
}

.filter-container h2 {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}

.section-subtitle {
  text-align: center;
  font-size: 1rem;
  color: #666;
  margin-bottom: 2rem;
  font-weight: 400;
}

.topic-filters {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.topic-btn {
  background: white;
  border: 2px solid #e0e0e0;
  padding: 0.75rem 1.5rem;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.topic-btn:hover {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.05);
  transform: translateY(-2px);
}

.topic-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
}

.topic-count {
  font-size: 0.8rem;
  opacity: 0.8;
  margin-left: 0.25rem;
}

/* 뉴스 섹션 */
.news-section {
  padding: 2rem 0 4rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 700;
  color: #1a1a1a;
}

.news-count {
  color: #666;
  font-size: 0.9rem;
  font-weight: 500;
}

/* 뉴스 그리드 */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

/* 뉴스 카드 */
.news-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  position: relative;
}

.news-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.news-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.news-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.news-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.news-card:hover .news-image img {
  transform: scale(1.05);
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 1rem;
}

.news-card:hover .image-overlay {
  opacity: 1;
}

.read-more {
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
}

.news-content {
  padding: 1.5rem;
}

.news-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  gap: 1rem;
}

.topic-tag {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

/* 주제별 색상 */
.topic-tag.비트코인 {
  background: linear-gradient(135deg, #f7931e 0%, #ff6b35 100%);
}

.topic-tag.삼성전자 {
  background: linear-gradient(135deg, #1f4e96 0%, #034ea2 100%);
}

.topic-tag.AI {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

.meta-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.publish-time {
  font-size: 0.75rem;
  color: #666;
}

.sentiment-indicator {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-weight: 600;
}

.sentiment-indicator.bullish {
  background: rgba(34, 197, 94, 0.1);
  color: #059669;
}

.sentiment-indicator.bearish {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.news-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 0.75rem;
  color: #1a1a1a;
}

.news-summary {
  color: #666;
  line-height: 1.6;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.news-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.journalist-info {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #667eea;
  font-size: 0.75rem;
  font-weight: 600;
}

.confidence-score {
  font-size: 0.75rem;
  color: #666;
  font-weight: 500;
}

/* 로딩 인디케이터 */
.loading-indicator {
  text-align: center;
  padding: 2rem;
}

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

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

/* 더보기 버튼 */
.load-more-section {
  text-align: center;
  padding: 2rem 0;
}

.load-more-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
}

.load-more-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* 뉴스 상세 페이지 스타일 */
.news-detail-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

.news-detail-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.1);
}

.news-detail-image {
  width: 100%;
  height: 400px;
  overflow: hidden;
}

.news-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-detail-content {
  padding: 2rem;
}

.news-detail-header {
  margin-bottom: 2rem;
}

.news-detail-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.news-detail-title {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1.3;
  color: #1a1a1a;
  margin-bottom: 1rem;
}

.news-detail-body {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #333;
  margin-bottom: 2rem;
  white-space: pre-line;
}

.analysis-section {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  border-left: 4px solid #667eea;
  padding: 1.5rem;
  border-radius: 0 15px 15px 0;
  margin-bottom: 2rem;
}

.analysis-section h3 {
  color: #667eea;
  margin-bottom: 1rem;
  font-size: 1.2rem;
  font-weight: 700;
}

.sources-section {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding-top: 2rem;
}

.sources-section h3 {
  color: #1a1a1a;
  margin-bottom: 1rem;
  font-size: 1.2rem;
  font-weight: 700;
}

.source-item {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.5);
}

.source-item h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}

.source-item h4 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.source-item h4 a:hover {
  color: #667eea;
}

.source-meta {
  font-size: 0.85rem;
  color: #666;
}

.action-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  flex-wrap: wrap;
}

.action-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.primary-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.secondary-btn {
  background: #f8f9fa;
  color: #333;
  border: 2px solid #e0e0e0;
}

.secondary-btn:hover {
  border-color: #667eea;
  color: #667eea;
}

/* 모던 푸터 */
.modern-footer {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: white;
  margin-top: 4rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem 1rem;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer-brand h3 {
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-brand p {
  color: #bdc3c7;
  font-size: 0.9rem;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.link-group h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #ecf0f1;
}

.link-group ul {
  list-style: none;
}

.link-group li {
  margin-bottom: 0.5rem;
}

.link-group a {
  color: #bdc3c7;
  text-decoration: none;
  transition: color 0.3s ease;
  font-size: 0.9rem;
}

.link-group a:hover {
  color: #667eea;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  text-align: center;
}

.footer-bottom p {
  color: #bdc3c7;
  font-size: 0.85rem;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .header-container {
    padding: 1rem;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .main-nav ul {
    gap: 0.5rem;
    flex-wrap: nowrap;
    justify-content: center;
    overflow-x: auto;
    padding: 0.5rem 0;
  }
  
  .main-nav a {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    white-space: nowrap;
    min-width: fit-content;
  }
  
  .header-actions {
    gap: 0.5rem;
  }
  
  .search-btn, .theme-toggle {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-stats {
    gap: 2rem;
  }
  
  .news-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .section-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .footer-links {
    grid-template-columns: 1fr;
  }
  
  .home-container {
    padding: 0 1rem;
  }
  
  .news-detail-container {
    padding: 1rem;
  }
  
  .news-detail-title {
    font-size: 2rem;
  }
  
  .news-detail-content {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .topic-filters {
    gap: 0.5rem;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0.5rem 0;
  }
  
  .topic-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    white-space: nowrap;
    min-width: fit-content;
    flex-shrink: 0;
  }
  
  .topic-count {
    font-size: 0.7rem;
  }
  
  .news-card {
    margin: 0 -1rem;
    border-radius: 0;
  }
  
  .news-content {
    padding: 1rem;
  }
  
  .news-detail-title {
    font-size: 1.75rem;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .action-btn {
    justify-content: center;
  }
}

/* 어드민 기능 스타일 */
.admin-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.admin-delete-btn,
.admin-edit-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-delete-btn {
    background: #ef4444;
    color: white;
}

.admin-delete-btn:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.admin-edit-btn {
    background: #3b82f6;
    color: white;
}

.admin-edit-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* 수정 모달 스타일 */
.edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.edit-modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.edit-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.edit-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.edit-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: white;
    transition: transform 0.3s ease;
}

.edit-modal-close:hover {
    transform: rotate(90deg);
}

.edit-modal-body {
    padding: 2rem;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 300px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
    transform: translateY(-2px);
}

/* 뉴스 카드 어드민 스타일 */
.news-card[data-news-card] {
    position: relative;
}

.news-card .admin-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.news-card:hover .admin-controls {
    opacity: 1;
}

/* 다크 테마 어드민 스타일 */
[data-theme="dark"] .edit-modal-content {
    background: #1a1a2e;
    color: #e0e0e0;
}

[data-theme="dark"] .edit-modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .form-control {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #e0e0e0;
}

[data-theme="dark"] .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

[data-theme="dark"] .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

[data-theme="dark"] .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 애니메이션 */
@keyframes fadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.9); }
}