/* ============================================================
   TRENDTER — Trends Feature CSS
   assets/css/trend.css
   ============================================================ */

/* ── Trend Discovery Page ─────────────────────────────────── */

.trends-header {
  padding: 20px 20px 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  backdrop-filter: blur(20px);
}

.trends-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}

.trends-title {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 900;
  margin: 0;
}

.trends-filter-bar {
  display: flex;
  gap: 8px;
  padding-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.trends-filter-bar::-webkit-scrollbar { display: none; }

.trends-filter-btn {
  padding: 6px 14px;
  border-radius: 50px;
  border: 1px solid var(--border2);
  background: none;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  color: var(--text2);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.trends-filter-btn:hover,
.trends-filter-btn.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

/* ── Trend Cards Grid ─────────────────────────────────────── */

.trends-grid {
  padding: 0;
}

.trend-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  transition: background 0.12s;
}
.trend-card:hover { background: var(--bg2); }

.trend-card-avatar {
  flex-shrink: 0;
}
.trend-card-avatar img {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  display: block;
}

.trend-card-body {
  flex: 1;
  min-width: 0;
}

.trend-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}

.trend-card-name {
  font-weight: 800;
  font-size: 15px;
  font-family: var(--font-head);
}

.trend-card-desc {
  font-size: 13px;
  color: var(--text2);
  margin: 0 0 6px;
  line-height: 1.5;
}

.trend-card-meta {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--text3);
  font-weight: 500;
}

.trend-card-action { flex-shrink: 0; }

/* ── Type Badges ──────────────────────────────────────────── */

.trend-type-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 50px;
  background: var(--bg3);
  color: var(--text2);
  white-space: nowrap;
}

.trend-type-discussion { background: rgba(59,130,246,0.12); color: #3b82f6; }
.trend-type-question   { background: rgba(245,158,11,0.12);  color: #f59e0b; }
.trend-type-knowledge  { background: rgba(34,197,94,0.12);   color: #22c55e; }
.trend-type-fan        { background: rgba(255,102,46,0.12);  color: var(--accent); }
.trend-type-creative   { background: rgba(168,85,247,0.12);  color: #a855f7; }

/* ── Create Trend Modal ───────────────────────────────────── */

.create-trend-form .form-group { margin-bottom: 18px; }
.create-trend-form .form-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}
.create-trend-form .form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  font-family: var(--font-body);
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.create-trend-form .form-control:focus {
  outline: none;
  border-color: var(--accent);
}
.create-trend-form textarea.form-control { resize: vertical; min-height: 80px; }

.trend-type-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 6px;
}
.trend-type-option {
  padding: 10px 6px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 11px;
  font-weight: 700;
  color: var(--text2);
}
.trend-type-option:hover { border-color: var(--accent); color: var(--text); }
.trend-type-option.selected { border-color: var(--accent); background: var(--accent-bg); color: var(--text); }
.trend-type-option .type-icon { font-size: 20px; display: block; margin-bottom: 4px; }

/* Slug preview */
.slug-preview {
  font-size: 13px;
  color: var(--text3);
  margin-top: 5px;
}
.slug-preview span { color: var(--accent); font-weight: 700; }

/* Limit notice */
.trend-limit-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--accent-bg);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 16px;
}
.trend-limit-bar {
  flex: 1;
  height: 6px;
  background: var(--bg4);
  border-radius: 3px;
  overflow: hidden;
}
.trend-limit-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s;
}

/* ── Individual Trend Page ────────────────────────────────── */

.trend-hero {
  position: relative;
  border-bottom: 1px solid var(--border);
}

.trend-hero-banner {
  height: 120px;
  background: linear-gradient(135deg, var(--accent) 0%, #c44020 100%);
  position: relative;
  overflow: hidden;
}

.trend-hero-body {
  padding: 0 20px 20px;
}

.trend-hero-avatar-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: -36px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.trend-hero-avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  border: 3px solid var(--bg);
  object-fit: cover;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.trend-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trend-hero-name {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 900;
  margin: 0 0 4px;
}

.trend-hero-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 10px;
}

.trend-hero-desc {
  font-size: 15px;
  color: var(--text2);
  line-height: 1.6;
  margin: 0 0 12px;
}

.trend-rules-box {
  background: var(--bg3);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.7;
  margin-top: 12px;
}
.trend-rules-box strong {
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text3);
  margin-bottom: 6px;
}

/* Trend composer (same style as feed composer) */
.trend-composer-wrapper {
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
}

/* Empty state */
.trend-empty {
  text-align: center;
  padding: 60px 20px;
}
.trend-empty-icon { font-size: 48px; margin-bottom: 12px; }
.trend-empty-title {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-head);
  margin-bottom: 8px;
}
.trend-empty-desc { font-size: 15px; color: var(--text2); }

/* ── Profile Trends Tab ───────────────────────────────────── */

.profile-trend-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: background 0.12s;
}
.profile-trend-card:hover { background: var(--bg2); }
.profile-trend-card img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}
.profile-trend-info { flex: 1; min-width: 0; }
.profile-trend-name { font-weight: 700; font-size: 15px; }
.profile-trend-meta { font-size: 12px; color: var(--text3); margin-top: 2px; }

/* ── Mobile ───────────────────────────────────────────────── */

@media (max-width: 768px) {
  .trends-title { font-size: 18px; }
  .trend-type-grid { grid-template-columns: repeat(3, 1fr); }
  .trend-hero-avatar { width: 60px; height: 60px; }
  .trend-hero-name { font-size: 18px; }
  .trend-card { padding: 12px 14px; }
  .trend-card-avatar img { width: 44px; height: 44px; }
}
/* ============================================================
   TREND CSS — Phase 2 Additions
   ============================================================ */

/* ── Daily Topic banner ───────────────────────────────────── */
.daily-topic-bar {
  border-bottom: 1px solid var(--border);
  background: var(--accent-bg);
  padding: 14px 20px;
}

/* ── Top Contributors ─────────────────────────────────────── */
.contributor-bar {
  height: 3px;
  background: var(--bg4);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 3px;
}
.contributor-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}

/* ── Reputation level badge ───────────────────────────────── */
.rep-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 50px;
  background: var(--bg3);
  color: var(--text2);
}

/* ── Mod delete button on post cards (injected via JS) ───── */
.mod-del-btn {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--text3);
  opacity: 0.5;
  flex-shrink: 0;
  transition: opacity 0.15s;
  padding: 2px 4px;
}
.mod-del-btn:hover { opacity: 1 !important; }

/* ── Weekly Best Posts panel ──────────────────────────────── */
.weekly-best-post {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}
.weekly-best-post:hover { background: var(--bg2); }

/* ── Right sidebar Trends widget ─────────────────────────── */
.sidebar-trend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
  transition: opacity 0.12s;
}
.sidebar-trend-item:hover { opacity: 0.8; }