/* ==========================================================================
   pages/sentiment.css — AI Sentiment overview card + LLM Conversations
   ========================================================================== */

:root {
  --sentiment-positive: #059669;
  --sentiment-neutral:  #D97706;
  --sentiment-negative: #DC2626;
}

/* ── Sentiment overview card (dashboard + dedicated view) ───────────── */
.sentiment-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.sentiment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.sentiment-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-m);
  font-weight: 600;
}

.sentiment-score {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.sentiment-bars {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sentiment-bar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sentiment-label {
  width: 90px;
  font-size: 0.82rem;
  color: var(--text);
}

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

.sentiment-bar-fill {
  height: 100%;
  width: var(--sentiment-width, 0%);
  border-radius: 99px;
  transition: width 0.5s ease;
}

.sentiment-positive .sentiment-bar-fill { background: var(--sentiment-positive); }
.sentiment-neutral  .sentiment-bar-fill { background: var(--sentiment-neutral);  }
.sentiment-negative .sentiment-bar-fill { background: var(--sentiment-negative); }

.sentiment-count {
  width: 30px;
  text-align: right;
  font-size: 0.82rem;
  color: var(--text-m);
}

.sentiment-keyphrases {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.sentiment-kp-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-m);
  margin-bottom: 0.5rem;
}

.sentiment-kp-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sentiment-kp-item {
  font-size: 0.78rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  color: var(--text);
}

.sentiment-kp-item.is-positive { color: var(--sentiment-positive); }
.sentiment-kp-item.is-negative { color: var(--sentiment-negative); }

.sentiment-view-all {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
}

.sentiment-view-all:hover { text-decoration: underline; }

.sentiment-empty {
  padding: 1rem;
  font-size: 0.85rem;
  color: var(--text-m);
  text-align: center;
}

/* ── LLM Conversations list ─────────────────────────────────────────── */
.conversations-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.conversations-toolbar select,
.conversations-toolbar input[type="date"] {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  font-size: 0.85rem;
}

.conversations-list { margin-top: 1rem; }

.conversation-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.conversation-card.sentiment-positive     { border-left-color: var(--sentiment-positive); }
.conversation-card.sentiment-neutral      { border-left-color: var(--sentiment-neutral);  }
.conversation-card.sentiment-negative     { border-left-color: var(--sentiment-negative); }
.conversation-card.sentiment-not_mentioned { border-left-color: var(--text-d); }

.conv-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.conv-engine-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  background: var(--engine-color, var(--accent));
}

.conv-sentiment-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  text-transform: capitalize;
}

.conv-sentiment-badge.sentiment-positive {
  background: rgba(5, 150, 105, 0.12);
  color: var(--sentiment-positive);
}
.conv-sentiment-badge.sentiment-neutral {
  background: rgba(217, 119, 6, 0.12);
  color: var(--sentiment-neutral);
}
.conv-sentiment-badge.sentiment-negative {
  background: rgba(220, 38, 38, 0.12);
  color: var(--sentiment-negative);
}
.conv-sentiment-badge.sentiment-not_mentioned {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-m);
}

.conv-date {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--text-m);
}

.conv-prompt {
  font-size: 0.85rem;
  color: var(--text);
  margin: 0.5rem 0;
}

.conv-prompt-label {
  color: var(--text-m);
  font-weight: 600;
  margin-right: 0.4rem;
}

.conv-response-preview {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-m);
  margin: 0.75rem 0;
}

.conv-key-phrase {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--accent);
  margin: 0.5rem 0;
}

.conv-expand-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.conv-expand-btn:hover { text-decoration: underline; }

.conv-full-response {
  display: none;
  white-space: pre-wrap;
  font-size: 0.88rem;
  line-height: 1.6;
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  border-top: 1px solid var(--border);
  color: var(--text);
}

.conversation-card.conv-expanded .conv-full-response { display: block; }

.conversations-loadmore {
  display: block;
  margin: 1rem auto;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
}

.conversations-loadmore:hover { border-color: var(--accent); }

.conversations-empty,
.conversations-error {
  padding: 2rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-m);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

/* ── Mentioned competitor brands (conversations + dashboard recent) ── */
.conv-mentioned-brands {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.conv-mentioned-label {
  font-size: 0.75rem;
  color: var(--text-m);
}

.conv-brand-chip {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  background: rgba(220, 38, 38, 0.10);
  color: #EF4444;
  border: 1px solid rgba(220, 38, 38, 0.20);
  border-radius: 99px;
  line-height: 1.4;
  white-space: nowrap;
}

/* ── Rich empty states (Conversations + Sentiment pages) ───────────── */
.conv-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}

.conv-empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  display: inline-block;
  animation: convEmptyFloat 3s ease-in-out infinite;
}

@keyframes convEmptyFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.conv-empty-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.75rem 0;
}

.conv-empty-desc {
  color: var(--text-m);
  line-height: 1.7;
  margin: 0 0 2rem 0;
  font-size: 0.95rem;
}

.conv-empty-example {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  width: 100%;
  margin-bottom: 2rem;
  text-align: left;
}

.conv-empty-example-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.conv-empty-engine {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  color: #fff;
  flex-shrink: 0;
}

.conv-empty-engine.chatgpt { background: #10A37F; }
.conv-empty-engine.claude  { background: #D97706; }

.conv-empty-chip {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  background: rgba(220, 38, 38, 0.10);
  color: #EF4444;
  border: 1px solid rgba(220, 38, 38, 0.20);
  border-radius: 99px;
}

.conv-empty-example-label {
  font-size: 0.78rem;
  color: var(--text-m);
  margin: 0.5rem 0 0 0;
}

.conv-empty-cta {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.75rem 2rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.conv-empty-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.40);
}

.conv-empty-sentiment-preview {
  width: 100%;
  margin-bottom: 2rem;
}

.conv-empty-sentiment-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.conv-empty-sentiment-bar span {
  width: 100px;
  font-size: 0.82rem;
  color: var(--text-m);
  flex-shrink: 0;
  text-align: left;
}

.conv-empty-bar-fill {
  height: 8px;
  border-radius: 99px;
  width: var(--w, 0%);
  transition: width 0.6s ease;
}

.conv-empty-sentiment-bar.positive .conv-empty-bar-fill { background: #059669; }
.conv-empty-sentiment-bar.neutral  .conv-empty-bar-fill { background: #D97706; }
.conv-empty-sentiment-bar.negative .conv-empty-bar-fill { background: #DC2626; }
