/* dashboard.css — Review Pulse dashboard styles */
/* Inherits design tokens from theme.css (loaded separately) */

/* ─── Nav ─────────────────────────────────── */
.dash-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 0 48px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-nav-brand {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-nav-brand span {
  color: var(--accent);
}

.dash-nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.dash-nav-links a {
  font-size: 0.875rem;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.dash-nav-links a:hover,
.dash-nav-links a.active {
  color: var(--fg);
}

.dash-nav-links .accent-link {
  color: var(--accent);
}

/* ─── Page Layout ──────────────────────────── */
.dash-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px;
}

.dash-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 40px;
  gap: 24px;
}

.dash-page-title {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dash-page-subtitle {
  color: var(--fg-muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

/* ─── Cards ────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

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

.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ─── Stats Grid ───────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.stat-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-block-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.stat-block-value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
  line-height: 1;
}

.stat-block-value.accent { color: var(--accent); }
.stat-block-value.warn { color: var(--warn); }
.stat-block-value.red { color: var(--red); }

.stat-block-sub {
  font-size: 0.8rem;
  color: var(--fg-dim);
}

/* ─── Connect App Form ─────────────────────── */
.connect-section {
  margin-bottom: 40px;
}

.connect-form {
  display: flex;
  gap: 12px;
  max-width: 480px;
}

.connect-input {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  color: var(--fg);
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.connect-input::placeholder { color: var(--fg-dim); }
.connect-input:focus { border-color: var(--accent); }

/* ─── Buttons ──────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  background: #00ff88;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--fg);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--fg-dim);
  background: var(--bg-card);
}

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--fg);
  border-color: var(--fg-dim);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-icon {
  padding: 8px;
  border-radius: 8px;
}

/* ─── Reviews List ─────────────────────────── */
.reviews-section {
  margin-top: 40px;
}

.reviews-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-chip {
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--fg-muted);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.filter-chip:hover,
.filter-chip.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: start;
}

.review-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--fg-muted);
  flex-shrink: 0;
}

.review-body {
  min-width: 0;
}

.review-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.review-author {
  font-weight: 600;
  font-size: 0.9rem;
}

.review-rating {
  display: flex;
  gap: 2px;
}

.star {
  font-size: 0.75rem;
  color: var(--fg-dim);
}

.star.filled { color: #f5a623; }

.review-date {
  font-size: 0.75rem;
  color: var(--fg-dim);
  font-family: var(--mono);
}

.review-text {
  font-size: 0.9rem;
  color: var(--fg);
  line-height: 1.55;
  margin-bottom: 12px;
}

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

.tag {
  font-family: var(--mono);
  font-size: 0.65rem;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.tag-bug_report { background: rgba(255, 82, 82, 0.12); color: var(--red); }
.tag-feature_request { background: rgba(0, 232, 123, 0.12); color: var(--accent); }
.tag-praise { background: rgba(0, 232, 123, 0.12); color: var(--accent); }
.tag-complaint { background: rgba(255, 159, 67, 0.12); color: var(--warn); }
.tag-spam { background: rgba(85, 85, 104, 0.3); color: var(--fg-dim); }

.review-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.response-draft {
  background: var(--bg-elevated);
  border-radius: 8px;
  padding: 12px;
  font-size: 0.8rem;
  color: var(--fg-muted);
  font-style: italic;
  max-width: 300px;
  text-align: right;
}

.response-draft strong {
  color: var(--accent);
  font-style: normal;
  display: block;
  margin-bottom: 4px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.responded-badge {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 3px 8px;
  border-radius: 4px;
}

/* ─── Charts ───────────────────────────────── */
.trends-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-top: 24px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bar-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--fg-dim);
  width: 80px;
  flex-shrink: 0;
}

.bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg-elevated);
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.bar-fill.complaint { background: var(--warn); }
.bar-fill.bug_report { background: var(--red); }
.bar-fill.spam { background: var(--fg-dim); }

.bar-count {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--fg-muted);
  width: 32px;
  text-align: right;
}

/* Simple sparkline using CSS */
.sparkline {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 60px;
  padding: 4px 0;
}

.spark-bar {
  flex: 1;
  background: var(--accent);
  border-radius: 2px;
  min-height: 4px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.spark-bar:hover { opacity: 1; }

.spark-bar.negative { background: var(--red); }
.spark-bar.positive { background: var(--accent); }

/* ─── Empty States ─────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 40px;
  color: var(--fg-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* ─── App Switcher ─────────────────────────── */
.app-switcher {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.app-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  text-decoration: none;
  color: var(--fg-muted);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}

.app-chip:hover,
.app-chip.active {
  border-color: var(--accent);
  color: var(--fg);
}

.app-chip-icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: var(--bg-elevated);
}

/* ─── Loading / Syncing ────────────────────── */
.sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.sync-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Responsive ──────────────────────────── */
@media (max-width: 768px) {
  .dash-nav { padding: 0 24px; }
  .dash-page { padding: 24px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .trends-grid { grid-template-columns: 1fr; }
  .review-card { grid-template-columns: 1fr; }
  .review-actions { flex-direction: row; align-items: center; }
  .connect-form { flex-direction: column; }
}