/* news.twolegend.com - 다크모드 포털 스타일 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* 다크 테마 색상 */
  --bg-primary: #0f1419;
  --bg-secondary: #1a1f2e;
  --bg-tertiary: #242b3d;
  --bg-card: #1e2433;
  --primary: #3b82f6;
  --secondary: #8b5cf6;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --text-primary: #e4e6eb;
  --text-secondary: #b0b3b8;
  --text-muted: #65676b;
  --border: #2d3748;
  --hover: #2a3142;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 헤더 */
.header {
  background: var(--bg-secondary);
  color: white;
  padding: 15px 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo h1 {
  font-size: 24px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo p {
  font-size: 12px;
  color: var(--text-secondary);
}

.header-stats {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.stat-value {
  color: var(--primary);
  font-weight: bold;
}

.nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.nav-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
  font-weight: 500;
}

.nav-btn:hover {
  background: var(--hover);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.nav-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.search-bar {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.search-bar input {
  flex: 1;
  padding: 10px 15px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-primary);
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--primary);
}

.search-bar button {
  padding: 10px 20px;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s;
}

.search-bar button:hover {
  background: var(--secondary);
  transform: scale(1.05);
}

/* Crypto Price Ticker */
.crypto-ticker {
  display: flex;
  gap: 12px;
  margin-top: 15px;
  padding: 12px 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.crypto-ticker::-webkit-scrollbar {
  height: 6px;
}

.crypto-ticker::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 3px;
}

.crypto-ticker::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.crypto-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  min-width: 140px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s;
  cursor: pointer;
}

.crypto-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.crypto-card.loading {
  min-width: 200px;
  justify-content: center;
  color: var(--text-secondary);
}

.crypto-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: white;
  padding: 2px;
  flex-shrink: 0;
}

.crypto-info {
  flex: 1;
  min-width: 0;
}

.crypto-symbol {
  font-size: 13px;
  font-weight: bold;
  color: var(--text-primary);
  text-transform: uppercase;
}

.crypto-name {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crypto-price {
  text-align: right;
  min-width: 0;
}

.crypto-amount {
  font-size: 14px;
  font-weight: bold;
  color: var(--text-primary);
  white-space: nowrap;
}

.crypto-change {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.crypto-change.positive {
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
}

.crypto-change.negative {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

/* 메인 레이아웃 */
.main {
  padding: 30px 0;
}

.portal-layout {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 30px;
  margin-top: 20px;
}

.main-content {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
}

/* 위젯 공통 스타일 */
.widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.widget-title {
  font-size: 18px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.widget-badge {
  background: var(--primary);
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: bold;
}

/* 트렌딩 섹션 */
.trending-section {
  margin-bottom: 40px;
}

.trending-section h2 {
  font-size: 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}

.trending-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* 뉴스 그리드 */
.news-section {
  margin-top: 30px;
}

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

.section-header h2 {
  font-size: 24px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.stats {
  font-size: 14px;
  color: var(--text-secondary);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

/* 뉴스 카드 */
.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s;
  cursor: pointer;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
  border-color: var(--primary);
}

.news-card img {
  width: 100%;
  max-width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  background: var(--bg-tertiary);
}

.news-card .content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.news-card .category {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: bold;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.news-card .category.blockchain { background: #f59e0b; }
.news-card .category.ai { background: #8b5cf6; }
.news-card .category.security { background: #ef4444; }
.news-card .category.startup { background: #10b981; }

.news-card h3 {
  font-size: 16px;
  margin-bottom: 10px;
  color: var(--text-primary);
  line-height: 1.4;
  flex: 1;
}

.news-card .description {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 10px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.news-card .source {
  font-weight: 500;
  color: var(--primary);
}

.news-card .sentiment {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
}

.sentiment.positive { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.sentiment.negative { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.sentiment.neutral { background: rgba(107, 114, 128, 0.2); color: #9ca3af; }

/* 사이드바 위젯들 */
.trending-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-tag {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  border: 1px solid var(--border);
  transition: all 0.3s;
  cursor: pointer;
}

.keyword-tag:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-2px);
}

.stat-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  transition: all 0.3s;
}

.stat-list li:hover {
  border-color: var(--primary);
  background: var(--hover);
  transform: translateX(2px);
}

.stat-list .label {
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-list .value {
  color: var(--primary);
  font-weight: bold;
  margin-left: 5px;
}

.quick-links {
  list-style: none;
}

.quick-links li {
  margin-bottom: 10px;
}

.quick-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.3s;
}

.quick-links a:hover {
  background: var(--hover);
  border-color: var(--primary);
  transform: translateX(5px);
}

/* 로딩 */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  font-size: 16px;
}

/* 더보기 버튼 */
.load-more {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 30px auto;
  padding: 12px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.load-more:hover {
  background: var(--secondary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.load-more:disabled {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* 푸터 */
.footer {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  text-align: center;
  padding: 30px 0;
  margin-top: 50px;
  border-top: 1px solid var(--border);
}

.footer p {
  margin: 5px 0;
  font-size: 14px;
}

/* 반응형 */
@media (max-width: 1200px) {
  .portal-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .news-grid,
  .trending-grid {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .header-stats {
    display: none;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .portal-layout {
    gap: 20px;
  }
}

/* 스크롤바 스타일 */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}
