/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #10b981;
  --accent: #f59e0b;
  --dark: #1e293b;
  --gray-900: #0f172a;
  --gray-700: #334155;
  --gray-500: #64748b;
  --gray-300: #cbd5e1;
  --gray-100: #f1f5f9;
  --white: #ffffff;
  --danger: #ef4444;
  --success: #22c55e;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --radius: 12px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  color: var(--dark);
  background: var(--white);
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

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

/* Header */
.header {
  position: sticky;
  top: 0;
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  z-index: 1000;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.nav {
  display: flex;
  gap: 32px;
}

.nav a {
  font-weight: 500;
  color: var(--gray-700);
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--primary);
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.mobile-menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--dark);
  transition: 0.3s;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 50%, var(--secondary) 100%);
  color: var(--white);
  padding: 80px 0;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.3;
}

.hero > .container > p {
  font-size: 1.125rem;
  opacity: 0.9;
  margin-bottom: 32px;
}

.hero-search {
  display: flex;
  max-width: 500px;
  margin: 0 auto;
  background: var(--white);
  border-radius: 50px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero-search input {
  flex: 1;
  border: none;
  padding: 16px 24px;
  font-size: 1rem;
  outline: none;
}

.hero-search button {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 16px 32px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.hero-search button:hover {
  background: var(--primary-dark);
}

/* Ad Container */
.ad-container {
  padding: 24px 0;
  background: var(--gray-100);
}

.ad-placeholder {
  background: var(--white);
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  color: var(--gray-500);
  font-size: 0.875rem;
}

/* Section Title */
.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 32px;
  text-align: center;
}

/* Categories */
.categories {
  padding: 60px 0;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.category-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  transition: all 0.3s;
  box-shadow: var(--shadow);
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.category-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.category-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
  color: var(--dark);
}

.category-card p {
  color: var(--gray-500);
  font-size: 0.9375rem;
  margin-bottom: 16px;
  line-height: 1.5;
}

.category-link {
  color: var(--primary);
  font-weight: 500;
  font-size: 0.875rem;
}

/* Popular Content */
.popular-content {
  padding: 60px 0;
  background: var(--gray-100);
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.content-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  cursor: pointer;
}

.content-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.content-badge {
  display: inline-block;
  background: var(--primary);
  color: var(--white);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 12px;
}

.content-card h3 {
  font-size: 1.125rem;
  margin-bottom: 12px;
  line-height: 1.4;
  color: var(--dark);
}

.content-card p {
  color: var(--gray-500);
  font-size: 0.875rem;
  margin-bottom: 16px;
  line-height: 1.5;
}

.content-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--gray-500);
}

/* Latest Content */
.latest-content {
  padding: 60px 0;
}

.latest-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.latest-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.2s;
  cursor: pointer;
}

.latest-card:hover {
  border-color: var(--primary);
  background: var(--gray-100);
}

.latest-category {
  background: var(--secondary);
  color: var(--white);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.latest-card h3 {
  flex: 1;
  font-size: 1rem;
  font-weight: 500;
  color: var(--dark);
}

.latest-card time {
  color: var(--gray-500);
  font-size: 0.8125rem;
  white-space: nowrap;
}

/* Newsletter */
.newsletter {
  background: linear-gradient(135deg, var(--dark) 0%, var(--gray-900) 100%);
  color: var(--white);
  padding: 60px 0;
  text-align: center;
}

.newsletter h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.newsletter > .container > p {
  opacity: 0.8;
  margin-bottom: 24px;
}

.newsletter-form {
  display: flex;
  max-width: 450px;
  margin: 0 auto;
  gap: 12px;
}

.newsletter-form input {
  flex: 1;
  padding: 14px 20px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
}

.newsletter-form button {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 14px 28px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.newsletter-form button:hover {
  background: var(--primary-dark);
}

/* Footer */
.footer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: 40px 0 24px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gray-700);
  margin-bottom: 24px;
}

.footer-brand .logo {
  color: var(--white);
  font-size: 1.25rem;
}

.footer-brand p {
  margin-top: 4px;
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--white);
}

.footer-bottom {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.footer-bottom p + p {
  margin-top: 8px;
}

/* Responsive */
@media (max-width: 1024px) {
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .hero {
    padding: 60px 0;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero-search {
    flex-direction: column;
    border-radius: var(--radius);
  }

  .hero-search button {
    border-radius: 0 0 var(--radius) var(--radius);
  }

  .category-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

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

  .latest-card {
    flex-wrap: wrap;
  }

  .latest-card h3 {
    order: 3;
    width: 100%;
    margin-top: 8px;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .footer-content {
    flex-direction: column;
    gap: 24px;
    text-align: center;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Mobile Menu Active State */
.nav.active {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 70px;
  left: 0;
  right: 0;
  background: var(--white);
  padding: 20px;
  gap: 16px;
  border-bottom: 1px solid var(--gray-100);
  box-shadow: var(--shadow);
}

/* Stock Ticker Styles (for investment focus) */
.stock-ticker {
  background: var(--gray-900);
  color: var(--white);
  padding: 10px 0;
  overflow: hidden;
}

.ticker-wrap {
  display: flex;
  animation: ticker 30s linear infinite;
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
  white-space: nowrap;
  font-size: 0.875rem;
}

.ticker-item .name {
  font-weight: 500;
}

.ticker-item .price {
  color: var(--gray-300);
}

.ticker-item .change.up {
  color: var(--danger);
}

.ticker-item .change.down {
  color: var(--primary);
}

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Investment Card Styles */
.invest-highlight {
  background: linear-gradient(135deg, #1e3a5f 0%, #0f2744 100%);
  color: var(--white);
  padding: 40px 0;
}

.invest-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.stat-card {
  text-align: center;
  padding: 20px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.875rem;
  opacity: 0.8;
}

@media (max-width: 768px) {
  .invest-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========================================
   공모주, 경제소식, 주식상식 섹션 스타일
   ======================================== */

/* 3열 카테고리 그리드 */
.category-grid.three-col {
  grid-template-columns: repeat(3, 1fr);
}

.category-card.featured {
  background: linear-gradient(135deg, var(--white) 0%, var(--gray-100) 100%);
  border: 2px solid var(--gray-100);
}

.category-card.featured:hover {
  border-color: var(--primary);
  background: var(--white);
}

/* Section Subtitle & More */
.section-subtitle {
  text-align: center;
  color: var(--gray-500);
  margin-top: -24px;
  margin-bottom: 32px;
  font-size: 0.9375rem;
}

.section-more {
  text-align: center;
  margin-top: 32px;
}

.more-btn {
  display: inline-block;
  padding: 12px 32px;
  background: var(--white);
  border: 2px solid var(--primary);
  color: var(--primary);
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.2s;
}

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

/* ========================================
   공모주 IPO 섹션
   ======================================== */
.ipo-section {
  padding: 60px 0;
  background: var(--gray-100);
}

.ipo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.ipo-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  position: relative;
  transition: all 0.3s;
}

.ipo-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.ipo-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.ipo-status.upcoming {
  background: #fef3c7;
  color: #d97706;
}

.ipo-status.ongoing {
  background: #dcfce7;
  color: #16a34a;
}

.ipo-status.closed {
  background: var(--gray-100);
  color: var(--gray-500);
}

.ipo-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 16px;
}

.ipo-info {
  margin-bottom: 16px;
}

.ipo-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.875rem;
}

.ipo-row:last-child {
  border-bottom: none;
}

.ipo-row .label {
  color: var(--gray-500);
}

.ipo-row .value {
  font-weight: 500;
  color: var(--dark);
}

.ipo-detail-btn {
  display: block;
  text-align: center;
  padding: 12px;
  background: var(--primary);
  color: var(--white);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  transition: background 0.2s;
}

.ipo-detail-btn:hover {
  background: var(--primary-dark);
}

/* ========================================
   오늘의 경제 소식 섹션
   ======================================== */
.daily-news-section {
  padding: 60px 0;
}

.news-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.news-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.2s;
  cursor: pointer;
}

.news-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.news-card.main-news {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f2744 100%);
  color: var(--white);
  padding: 32px;
}

.news-card.main-news h3 {
  font-size: 1.5rem;
  color: var(--white);
}

.news-card.main-news p {
  color: rgba(255,255,255,0.8);
  font-size: 1rem;
  line-height: 1.7;
}

.news-card.main-news .news-meta {
  color: rgba(255,255,255,0.6);
}

.news-tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--gray-100);
  color: var(--gray-700);
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 12px;
}

.news-tag.hot {
  background: var(--danger);
  color: var(--white);
}

.news-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 8px;
  line-height: 1.4;
}

.news-card p {
  color: var(--gray-500);
  font-size: 0.875rem;
  margin-bottom: 12px;
  line-height: 1.5;
}

.news-card time {
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.news-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin-top: 12px;
}

/* ========================================
   주식 상식 섹션
   ======================================== */
.tips-section {
  padding: 60px 0;
  background: var(--gray-100);
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.tip-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  cursor: pointer;
}

.tip-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.tip-level {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.tip-level.beginner {
  background: #dbeafe;
  color: #2563eb;
}

.tip-level.intermediate {
  background: #fef3c7;
  color: #d97706;
}

.tip-level.advanced {
  background: #fee2e2;
  color: #dc2626;
}

.tip-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 12px;
}

.tip-card p {
  color: var(--gray-500);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.tip-meta {
  font-size: 0.8125rem;
  color: var(--gray-500);
}

/* ========================================
   반응형 추가
   ======================================== */
@media (max-width: 1024px) {
  .ipo-grid,
  .tips-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .category-grid.three-col,
  .ipo-grid,
  .tips-grid,
  .news-grid {
    grid-template-columns: 1fr;
  }

  .news-card.main-news {
    padding: 24px;
  }

  .news-card.main-news h3 {
    font-size: 1.25rem;
  }
}
