/* Topic Queue — Admin Topic Approval */

/* ---- Counter Row ---- */
.topic-counters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.topic-counter {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  text-align: center;
}

.topic-counter .tc-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.topic-counter .tc-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.topic-counter.pending .tc-value { color: var(--warning); }
.topic-counter.approved .tc-value { color: var(--success); }
.topic-counter.rejected .tc-value { color: var(--error); }
.topic-counter.expired .tc-value { color: var(--text-muted); }

/* ---- Tabs ---- */
.topic-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.topic-tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}

.topic-tab-btn:hover {
  color: var(--text-primary);
}

.topic-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---- Bulk Actions ---- */
.topic-bulk-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
}

.topic-bulk-btn {
  background: rgba(74, 222, 128, 0.1);
  color: var(--success);
  border: 1px solid rgba(74, 222, 128, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-sans);
  transition: all 0.15s;
}

.topic-bulk-btn:hover {
  background: rgba(74, 222, 128, 0.2);
}

.topic-bulk-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.topic-bulk-btn-accent {
  background: var(--accent);
  color: var(--text-primary);
  border-color: var(--accent);
}
.topic-bulk-btn-accent:hover {
  background: var(--accent-hover);
}

/* ---- Topic Cards Grid ---- */
.topic-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 14px;
}

/* ---- Topic Card ---- */
.topic-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s;
}

.topic-card:hover {
  border-color: var(--accent-dim);
}

.topic-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.topic-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  text-decoration: none;
}

a.topic-card-title:hover {
  color: var(--accent);
  text-decoration: underline;
}

.topic-card-translation {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 2px;
}

.topic-card-pin {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  transition: all 0.15s;
  flex-shrink: 0;
}

.topic-card-pin:hover,
.topic-card-pin.pinned {
  color: var(--warning);
  border-color: var(--warning);
  background: rgba(251, 191, 36, 0.1);
}

.topic-card-angle {
  font-size: 13px;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ---- Badges Row ---- */
.topic-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.topic-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.topic-badge.source {
  background: rgba(124, 92, 252, 0.15);
  color: var(--accent);
}

.topic-badge.region {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.topic-badge.language {
  background: rgba(124, 92, 252, 0.08);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
}

/* ---- Safety Score ---- */
.topic-safety {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.topic-safety-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  max-width: 120px;
}

.topic-safety-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}

.topic-safety-fill.green { background: var(--success); }
.topic-safety-fill.yellow { background: var(--warning); }
.topic-safety-fill.red { background: var(--error); }

.topic-safety-value {
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 12px;
  min-width: 24px;
}

.topic-safety-value.green { color: var(--success); }
.topic-safety-value.yellow { color: var(--warning); }
.topic-safety-value.red { color: var(--error); }

/* ---- Score Bars ---- */
.topic-scores {
  display: flex;
  gap: 12px;
  font-size: 11px;
}

.topic-score-item {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.topic-score-label {
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 28px;
}

.topic-score-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.topic-score-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.3s;
}

.topic-score-val {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-size: 10px;
  min-width: 16px;
  text-align: right;
}

/* ---- Tags ---- */
.topic-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.topic-tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

/* ---- Format Affinities ---- */
.topic-formats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
}

.topic-format-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topic-format-name {
  min-width: 72px;
  color: var(--text-muted);
  white-space: nowrap;
}

.topic-format-bar {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.topic-format-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent-dim);
  transition: width 0.3s;
}

.topic-format-val {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-size: 10px;
  min-width: 20px;
  text-align: right;
}

/* ---- Cultural Notes (collapsible) ---- */
.topic-cultural-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  font-family: var(--font-sans);
  padding: 2px 0;
  text-align: left;
}

.topic-cultural-toggle:hover {
  color: var(--text-secondary);
}

.topic-cultural-content {
  display: none;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  margin-top: 4px;
}

.topic-cultural-content.open {
  display: block;
}

/* ---- Action Buttons ---- */
.topic-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.topic-approve-btn,
.topic-reject-btn,
.topic-remove-btn {
  flex: 1;
  padding: 8px 0;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  transition: all 0.15s;
}

.topic-approve-btn {
  background: rgba(74, 222, 128, 0.15);
  color: var(--success);
}

.topic-approve-btn:hover {
  background: rgba(74, 222, 128, 0.25);
}

.topic-reject-btn {
  background: rgba(248, 113, 113, 0.15);
  color: var(--error);
}

.topic-reject-btn:hover {
  background: rgba(248, 113, 113, 0.25);
}

.topic-remove-btn {
  background: rgba(248, 113, 113, 0.1);
  color: var(--error);
  flex: 0 0 auto;
  padding: 8px 16px;
}

.topic-remove-btn:hover {
  background: rgba(248, 113, 113, 0.2);
}

/* ---- Admin Notes ---- */
.topic-notes-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  font-family: var(--font-sans);
  padding: 0;
  text-align: left;
}

.topic-notes-toggle:hover {
  color: var(--text-secondary);
}

.topic-notes-area {
  display: none;
  margin-top: 6px;
}

.topic-notes-area.open {
  display: block;
}

.topic-notes-area textarea {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12px;
  padding: 8px;
  resize: vertical;
  min-height: 48px;
}

.topic-notes-area textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* ---- Approved/Rejected Card Extras ---- */
.topic-meta-row {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
}

.topic-meta-row span {
  display: flex;
  align-items: center;
  gap: 3px;
}

.topic-rejected-reason {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 8px 10px;
  background: rgba(248, 113, 113, 0.06);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--error);
  line-height: 1.4;
}

/* ---- Auto-refresh indicator ---- */
.topic-refresh-indicator {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.topic-refresh-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ---- Safety Pipeline Dashboard ---- */
.safety-section {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.safety-section-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.safety-section-toggle:hover {
  color: var(--text-primary);
}

.safety-section-body {
  display: none;
  padding-top: 12px;
}

.safety-section.open .safety-section-body {
  display: block;
}

.safety-histogram {
  margin-top: 8px;
}

.safety-histogram-bars {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  height: 100px;
  padding: 0 4px;
}

.safety-histogram-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.safety-histogram-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.safety-histogram-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  min-height: 4px;
  transition: height 0.3s;
}

.safety-histogram-label {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
