/* === YouTube-style Homepage === */

/* === Chips Bar (YouTube category tabs) === */
.yt-chips {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  height: 56px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  overflow-x: auto;
  z-index: 90;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.yt-chips::-webkit-scrollbar { display: none; }

.yt-chip {
  background: var(--bg-chip);
  color: var(--text);
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.yt-chip svg { flex-shrink: 0; }
.yt-chip:hover { background: #e5e5e5; }
.yt-chip.active { background: #0f0f0f; color: #fff; }

/* Trend button in header */
.trend-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #004e98, #0070cc);
  color: white;
  border: none;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.trend-header-btn:hover { opacity: 0.85; }
.trend-header-btn svg { flex-shrink: 0; }

/* === Main Content === */
.yt-main {
  margin-top: calc(var(--header-h) + 56px);
  padding: 24px;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

/* === YouTube Video Grid === */
.yt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px 16px;
}

/* === YouTube Card === */
.yt-card {
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.15s;
}
.yt-card:hover { transform: translateY(-2px); }

/* Thumbnail (16:9) */
.yt-thumb {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 12px;
  overflow: hidden;
  background: #f0f0f0;
}

.yt-thumb img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.yt-thumb-gradient {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  opacity: 0.3;
}

.yt-thumb-badge {
  position: absolute;
  bottom: 4px; right: 4px;
  background: rgba(0,0,0,0.8);
  color: #fff;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Space Grotesk', monospace;
}

.yt-thumb-category {
  position: absolute;
  top: 6px; left: 6px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(4px);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

/* Info section (below thumbnail) */
.yt-info {
  display: flex;
  gap: 12px;
  padding: 12px 4px 20px;
}

.yt-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
}

.yt-meta { flex: 1; min-width: 0; }

.yt-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.yt-sub {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.yt-sub span + span::before { content: ' · '; }

/* Avatar gradient colors per category */
.yt-avatar-agent { background: linear-gradient(135deg, #6366f1, #818cf8); }
.yt-avatar-business { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.yt-avatar-culture { background: linear-gradient(135deg, #ec4899, #f472b6); }
.yt-avatar-ethics { background: linear-gradient(135deg, #10b981, #34d399); }
.yt-avatar-community { background: linear-gradient(135deg, #f97316, #fb923c); }
.yt-avatar-default { background: linear-gradient(135deg, #ff6b35, #ff4e45); }

/* === Trend Section === */
.trend-section {
  padding: 8px 0 32px;
}

.trend-header {
  margin-bottom: 24px;
}
.trend-header h2 {
  font-size: 22px;
  font-weight: 700;
}
.trend-header p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

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

.trend-stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.trend-stat {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.trend-stat-num {
  font-family: 'Space Grotesk', monospace;
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
}
.trend-stat span:last-child {
  font-size: 13px;
  color: var(--text-secondary);
}

.trend-chart-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.trend-chart-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

/* === Opinion Spectrum === */
.trend-chart-desc { font-size: 13px; color: var(--text-secondary); margin: -8px 0 16px; }

.trend-topic { margin-bottom: 20px; }
.trend-topic-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.trend-topic-title { font-size: 14px; font-weight: 600; }
.trend-topic-heat { font-size: 13px; font-weight: 700; }

.spectrum-bar { display: flex; height: 20px; border-radius: 10px; overflow: hidden; margin-bottom: 6px; }
.spectrum-seg { transition: width 0.6s ease; min-width: 2px; }

.spectrum-legend { display: flex; flex-wrap: wrap; gap: 8px; }
.spectrum-label { font-size: 11px; color: var(--text-secondary); display: flex; align-items: center; gap: 3px; }
.spectrum-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* === Sentiment Index === */
.sentiment-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.sentiment-card { background: var(--bg-secondary); border-radius: 10px; padding: 14px; text-align: center; }
.sentiment-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.sentiment-value { font-family: 'Space Grotesk', monospace; font-size: 28px; font-weight: 700; }
.sentiment-spark { width: 100%; height: 40px; margin-top: 6px; }
.sentiment-summary { font-size: 13px; color: var(--text-secondary); margin-top: 12px; line-height: 1.6; }

/* === Virality Predictions === */
.viral-card { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.viral-card:last-child { border-bottom: none; }
.viral-score { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white; font-weight: 800; font-size: 16px; font-family: 'Space Grotesk', monospace; flex-shrink: 0; }
.viral-info { flex: 1; }
.viral-title { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.viral-pred { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }

/* === Golden Quotes === */
#goldenQuotes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quote-card { background: var(--bg-secondary); border-radius: 10px; padding: 16px; border-left: 3px solid #004e98; }
.quote-text { font-size: 14px; line-height: 1.6; color: #333; margin-bottom: 10px; font-style: italic; }
.quote-author { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.quote-avatar { width: 20px; height: 20px; border-radius: 50%; }
.quote-reactions { margin-left: auto; }

@media (max-width: 768px) {
  .sentiment-grid { grid-template-columns: 1fr 1fr; }
  #goldenQuotes { grid-template-columns: 1fr; }
}

/* === Empty & Footer === */
.yt-empty {
  text-align: center;
  padding: 80px 20px;
}
.yt-empty h2 { margin: 16px 0 8px; }
.yt-empty p { color: var(--text-secondary); }

.yt-footer {
  background: #f8f8f8;
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
}
.yt-footer-inner {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 13px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.yt-footer-inner a { color: var(--text-secondary); }
.yt-footer-inner a:hover { color: var(--accent); }

/* === Responsive === */
@media (max-width: 768px) {
  .yt-grid { grid-template-columns: 1fr; }
  .trend-stat-row { grid-template-columns: 1fr 1fr; }
  .yt-main { padding: 16px; }
}
