/* ClubicOS Trending Topics Page */

/* Trending cards grid */
.trending-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 64px;
}

.trending-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.trending-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  border-color: var(--muted);
}

.trend-rank {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trend-keyword {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.trend-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.heat-icon {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
}
.heat-icon svg { flex-shrink: 0; }

.btn-generate {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn-generate:hover { background: #c02a18; }
.btn-generate:active { transform: scale(0.97); }
.btn-generate:disabled {
  background: var(--muted);
  cursor: not-allowed;
  transform: none;
}

/* Loading spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

/* Section titles */
.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--line);
}

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

/* Briefs table */
.briefs-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: white; }
.briefs-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.briefs-table thead { border-bottom: 2px solid var(--line); }
.briefs-table th {
  padding: 14px 16px;
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.briefs-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.briefs-table tbody tr:last-child td { border-bottom: none; }
.briefs-table tbody tr:hover { background: var(--surface); }

.brief-keyword { font-weight: 600; color: var(--ink); }
.brief-format { color: var(--muted); font-size: 0.8rem; }
.brief-date { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }

.btn-view {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background 0.15s;
}
.btn-view:hover { background: var(--line); }

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 5px;
  white-space: nowrap;
}
.status-badge .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.status-badge.draft { background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
.status-badge.draft .dot { background: var(--muted); }
.status-badge.approved { background: #e8f4e8; color: #1a5c2a; border: 1px solid #b8d8b8; }
.status-badge.approved .dot { background: #1a7a3a; }
.status-badge.assigned { background: #e8f0ff; color: #1a3c8c; border: 1px solid #b8c8f8; }
.status-badge.assigned .dot { background: #3864e8; }

/* Brief detail view (modal overlay) */
.brief-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}
.brief-overlay.hidden { display: none; }

.brief-panel {
  background: white;
  border-radius: 12px;
  max-width: 780px;
  width: 100%;
  padding: 36px 40px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.btn-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 4px;
}
.btn-close:hover { background: var(--surface); color: var(--ink); }

.brief-panel-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.brief-panel-keyword {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.brief-panel-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.brief-format-tag {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 8px;
}
.brief-word-count {
  font-size: 0.8rem;
  color: var(--muted);
}
.brief-word-count strong { color: var(--ink); }

/* Outline */
.outline-section {
  margin-bottom: 24px;
}
.outline-h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
  padding-left: 16px;
  border-left: 3px solid var(--accent);
}
.outline-h3-list {
  list-style: none;
  padding-left: 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}
.outline-h3-list li {
  font-size: 0.875rem;
  color: var(--muted);
  position: relative;
  padding-left: 14px;
}
.outline-h3-list li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--line);
}
.outline-h3-list li.empty-h3 { color: var(--line); font-style: italic; }

/* Competitor & affiliate sections */
.resource-section {
  margin-bottom: 20px;
}
.resource-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 10px;
}
.resource-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.resource-list li a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.resource-list li a:hover { text-decoration: underline; }

.affiliate-slots { display: flex; flex-direction: column; gap: 8px; }
.affiliate-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 14px;
}
.affiliate-slot-badge {
  background: var(--accent);
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
}
.affiliate-slot-label { font-size: 0.875rem; font-weight: 600; color: var(--ink); }
.affiliate-slot-placement { font-size: 0.75rem; color: var(--muted); margin-left: auto; }

/* Approve button */
.btn-approve {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1a7a3a;
  color: white;
  border: none;
  border-radius: 7px;
  padding: 12px 22px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 8px;
}
.btn-approve:hover { background: #166030; }
.btn-approve:disabled { background: var(--muted); cursor: not-allowed; }

/* Section dividers */
.brief-divider {
  height: 1px;
  background: var(--line);
  margin: 24px 0;
}

/* Responsive */
@media (max-width: 600px) {
  .trending-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .brief-panel { padding: 24px 20px; }
  .brief-panel-keyword { font-size: 1.3rem; }
}