/* ============================================
   K-POP FANATIC - Main Stylesheet
   ============================================ */

:root {
  --pink: #ff4d8d;
  --pink-light: #ff80b5;
  --pink-dark: #d6005e;
  --purple: #9b5de5;
  --purple-light: #c77dff;
  --cyan: #00c9d4;
  --yellow: #ffd166;

  --bg: #fff5f9;
  --bg-card: #ffffff;
  --bg-section: #fce4f0;
  --text: #1a1a2e;
  --text-muted: #6b6b8a;
  --border: #f0c6da;
  --shadow: rgba(255, 77, 141, 0.15);

  --header-h: 68px;
  --radius: 16px;
  --radius-sm: 8px;

  --font-main: 'Nunito', 'Noto Sans KR', sans-serif;
}

[data-theme="dark"] {
  --bg: #0f0a1e;
  --bg-card: #1a1230;
  --bg-section: #140d24;
  --text: #f0e6ff;
  --text-muted: #9d8fbd;
  --border: #2e1d4e;
  --shadow: rgba(155, 93, 229, 0.2);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ============================================
   HEADER
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-card);
  border-bottom: 2px solid var(--border);
  box-shadow: 0 2px 20px var(--shadow);
}

.header-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  font-size: 1.5rem;
  white-space: nowrap;
}

.logo-star {
  font-size: 1.6rem;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: spin-star 6s linear infinite;
}

@keyframes spin-star {
  0%, 80% { transform: rotate(0deg); }
  90% { transform: rotate(72deg); }
  100% { transform: rotate(72deg); }
}

.logo-accent {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.main-nav { flex: 1; }
.main-nav ul { display: flex; gap: 4px; }

.main-nav a {
  display: block;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--pink);
  background: rgba(255, 77, 141, 0.1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-btn,
.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s;
  background: var(--bg);
}

.search-btn:hover,
.theme-toggle:hover {
  background: rgba(255, 77, 141, 0.1);
  color: var(--pink);
}

.moon-icon { display: none; }
[data-theme="dark"] .sun-icon { display: none; }
[data-theme="dark"] .moon-icon { display: block; }

.search-bar {
  display: none;
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

.search-bar.open { display: block; }

.search-inner {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  gap: 12px;
}

.search-inner input {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border 0.2s;
}

.search-inner input:focus { border-color: var(--pink); }

.search-close {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 1rem;
  transition: all 0.2s;
}

.search-close:hover { background: rgba(255, 77, 141, 0.1); color: var(--pink); }

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 60px 24px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #ffe0f0 0%, #f0e0ff 40%, #e0f0ff 100%);
  z-index: 0;
}

[data-theme="dark"] .hero-bg {
  background: linear-gradient(135deg, #1a0030 0%, #0d0020 40%, #001030 100%);
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(255, 77, 141, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 80% 30%, rgba(155, 93, 229, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 60% 80%, rgba(0, 201, 212, 0.15) 0%, transparent 40%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto 0 max(24px, calc((100vw - 1300px) / 2));
}

.hero-badge {
  display: inline-block;
  padding: 6px 14px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 16px;
  animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 141, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(255, 77, 141, 0); }
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--pink-dark), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="dark"] .hero-title {
  background: linear-gradient(135deg, var(--pink-light), var(--purple-light));
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 6px 14px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--pink);
  transition: all 0.2s;
  cursor: pointer;
}

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

.hero-featured {
  position: absolute;
  right: max(24px, calc((100vw - 1300px) / 2));
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  display: flex;
  gap: 12px;
}

/* ============================================
   TICKER
   ============================================ */
.ticker-wrap {
  background: linear-gradient(90deg, var(--pink), var(--purple));
  color: white;
  display: flex;
  align-items: center;
  height: 40px;
  overflow: hidden;
}

.ticker-label {
  flex-shrink: 0;
  padding: 0 20px;
  font-weight: 900;
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: rgba(0,0,0,0.2);
  height: 100%;
  display: flex;
  align-items: center;
}

.ticker { flex: 1; overflow: hidden; }

.ticker-content {
  display: flex;
  gap: 48px;
  white-space: nowrap;
  animation: ticker-scroll 35s linear infinite;
  font-size: 0.85rem;
  font-weight: 600;
}

.ticker-content span::before { content: '★  '; }

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

/* ============================================
   MAIN LAYOUT
   ============================================ */
.main-content {
  max-width: 1300px;
  margin: 0 auto;
  padding: 48px 24px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  align-items: start;
}

/* ============================================
   SECTION HEADER
   ============================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 900;
  position: relative;
  padding-left: 16px;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 70%;
  background: linear-gradient(180deg, var(--pink), var(--purple));
  border-radius: 3px;
}

/* ============================================
   FILTER TABS
   ============================================ */
.filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg);
  border: 2px solid var(--border);
  transition: all 0.2s;
}

.filter-btn:hover { border-color: var(--pink); color: var(--pink); }
.filter-btn.active {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  border-color: transparent;
  color: white;
}

/* ============================================
   NEWS GRID
   ============================================ */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.news-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px var(--shadow);
}

.news-card.featured {
  grid-column: 1 / -1;
  flex-direction: row;
}

.card-img {
  aspect-ratio: 16/9;
  overflow: hidden;
  flex-shrink: 0;
}

.news-card.featured .card-img {
  width: 45%;
  aspect-ratio: auto;
}

.card-img-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  transition: transform 0.4s;
  min-height: 180px;
}

.news-card:hover .card-img-inner { transform: scale(1.06); }

.card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.card-category {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: fit-content;
}

.cat-comeback { background: rgba(255, 77, 141, 0.15); color: var(--pink); }
.cat-tour { background: rgba(155, 93, 229, 0.15); color: var(--purple); }
.cat-award { background: rgba(255, 209, 102, 0.2); color: #c78800; }
.cat-mv { background: rgba(0, 201, 212, 0.15); color: var(--cyan); }
.cat-news { background: rgba(99, 102, 241, 0.15); color: #6366f1; }

[data-theme="dark"] .cat-award { color: var(--yellow); }

.card-title {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.4;
}

.news-card.featured .card-title { font-size: 1.3rem; }

.card-excerpt {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.card-artist {
  font-weight: 700;
  color: var(--pink);
}

.load-more {
  display: block;
  margin: 32px auto 0;
  padding: 12px 40px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white;
  border-radius: 100px;
  font-weight: 800;
  font-size: 0.95rem;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 4px 16px var(--shadow);
}

.load-more:hover { opacity: 0.9; transform: translateY(-2px); }

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar { display: flex; flex-direction: column; gap: 24px; }

.widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 4px 16px var(--shadow);
}

.widget-title {
  font-size: 1rem;
  font-weight: 900;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Trending Artists */
.artist-list { display: flex; flex-direction: column; gap: 10px; }

.artist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
  cursor: pointer;
}

.artist-item:hover { background: rgba(255, 77, 141, 0.07); }

.artist-rank {
  font-size: 0.85rem;
  font-weight: 900;
  min-width: 24px;
  text-align: center;
  color: var(--text-muted);
}

.artist-rank.top { color: var(--pink); }

.artist-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.artist-info { flex: 1; min-width: 0; }
.artist-name { font-weight: 800; font-size: 0.9rem; }
.artist-type { font-size: 0.75rem; color: var(--text-muted); }

.artist-trend {
  font-size: 0.78rem;
  font-weight: 700;
}
.trend-up { color: #22c55e; }
.trend-down { color: #ef4444; }
.trend-same { color: var(--text-muted); }

/* Comeback List */
.comeback-list { display: flex; flex-direction: column; gap: 12px; }

.comeback-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.comeback-date {
  text-align: center;
  min-width: 40px;
  flex-shrink: 0;
}

.comeback-day {
  font-size: 1.3rem;
  font-weight: 900;
  line-height: 1;
  color: var(--pink);
}

.comeback-month {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.comeback-artist { font-weight: 800; font-size: 0.88rem; }
.comeback-title { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

.comeback-type {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 100px;
  background: rgba(255, 77, 141, 0.12);
  color: var(--pink);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Chart */
.chart-subtitle {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 6px;
}

.chart-list { display: flex; flex-direction: column; gap: 10px; }

.chart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.chart-pos {
  font-size: 0.88rem;
  font-weight: 900;
  min-width: 22px;
  color: var(--text-muted);
}

.chart-pos.gold { color: #f59e0b; }
.chart-pos.silver { color: #94a3b8; }
.chart-pos.bronze { color: #cd7f32; }

.chart-emoji { font-size: 1.2rem; }

.chart-info { flex: 1; min-width: 0; }
.chart-song { font-weight: 800; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-artist-name { font-size: 0.73rem; color: var(--text-muted); }

.chart-change {
  font-size: 0.75rem;
  font-weight: 700;
}

/* ============================================
   ARTISTS SECTION
   ============================================ */
.artists-section {
  background: var(--bg-section);
  padding: 48px 0;
  overflow: hidden;
}

.artists-section .section-header {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
  margin-bottom: 28px;
}

.artists-scroll {
  display: flex;
  gap: 16px;
  padding: 0 max(24px, calc((100vw - 1300px) / 2));
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 8px;
}

.artists-scroll::-webkit-scrollbar { display: none; }

.artist-card {
  flex-shrink: 0;
  width: 180px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px var(--shadow);
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s;
}

.artist-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px var(--shadow);
}

.artist-card-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  position: relative;
}

.artist-card-avatar::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--purple), var(--cyan));
  z-index: -1;
}

.artist-card-name {
  font-weight: 900;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.artist-card-members {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.artist-card-tag {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(255, 77, 141, 0.1);
  color: var(--pink);
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 800;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--bg-card);
  border-top: 2px solid var(--border);
  padding: 48px 24px 0;
}

.footer-inner {
  max-width: 1300px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 2fr;
  gap: 40px;
  padding-bottom: 40px;
}

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

.footer-col {
  flex: 1;
}

.footer-brand .logo-text {
  font-size: 1.3rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 8px;
}

.footer-col h4 {
  font-weight: 900;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
  color: var(--pink);
}

.footer-col ul { display: flex; flex-direction: column; gap: 8px; }

.footer-col a {
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-col a:hover { color: var(--pink); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 16px 0;
  max-width: 1300px;
  margin: 0 auto;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ============================================
   HIDDEN STATE
   ============================================ */
.news-card.hidden { display: none; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
  }

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

  .hero-featured { display: none; }

  .footer-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .main-nav ul { gap: 0; }
  .main-nav a { padding: 8px 10px; font-size: 0.8rem; }

  .hero { padding: 40px 16px; }
  .hero-content { margin-left: 0; }

  .main-content { padding: 32px 16px; }

  .news-card.featured { flex-direction: column; }
  .news-card.featured .card-img { width: 100%; }

  .footer-inner { grid-template-columns: 1fr; }

  .footer-links { flex-wrap: wrap; }
}
