/* ========== TRUE PRESS INTELLIGENCE PLATFORM v2.0 — Business-Focused ========== */

/* --- Layout --- */
.tp-layout { display: flex; gap: 16px; }
.tp-sidebar { width: 260px; flex-shrink: 0; }
.tp-content { flex: 1; min-width: 0; }

/* --- Sidebar Section Titles --- */
.tp-sidebar-section-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  padding: 12px 12px 6px 12px;
  margin-top: 4px;
}
.tp-sidebar-divider {
  border-top: 1px solid var(--border);
  margin: 8px 12px;
}

/* --- Business Parent Items (expandable) --- */
.tp-biz-parent {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.15s;
  margin: 1px 4px;
  border-left: 3px solid transparent;
}
.tp-biz-parent:hover {
  background: var(--surface2);
  color: var(--text);
}
.tp-biz-parent.tp-biz-active {
  background: var(--surface2);
  color: var(--text);
}
.tp-biz-icon { font-size: 16px; min-width: 22px; text-align: center; }
.tp-biz-label { flex: 1; }
.tp-biz-count {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
  background: var(--surface2);
  color: var(--text-dim);
}
.tp-biz-chevron {
  font-size: 10px;
  color: var(--text-dim);
  min-width: 12px;
  text-align: center;
}

/* --- Business Sub-items --- */
.tp-biz-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 44px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-dim);
  transition: all 0.15s;
  border-radius: 6px;
  margin: 0 4px;
}
.tp-biz-sub:hover {
  background: var(--surface2);
  color: var(--text-muted);
}
.tp-biz-sub-active {
  background: var(--primary-dim) !important;
  color: var(--primary) !important;
  font-weight: 600;
}
.tp-biz-sub-label { flex: 1; }
.tp-biz-sub-count {
  font-size: 10px;
  color: var(--text-dim);
  background: var(--surface2);
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 600;
}
.tp-biz-sub-active .tp-biz-sub-count {
  background: rgba(0,212,255,0.15);
  color: var(--primary);
}

/* --- Generic Sidebar Items (all, general categories) --- */
.tp-biz-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  transition: all 0.15s;
  margin: 1px 4px;
}
.tp-biz-item:hover { background: var(--surface2); color: var(--text); }
.tp-biz-active {
  background: var(--primary-dim) !important;
  color: var(--primary) !important;
  font-weight: 600;
}
.tp-biz-active .tp-biz-count {
  background: rgba(0,212,255,0.15) !important;
  color: var(--primary) !important;
}

/* --- Business Briefing Cards --- */
.tp-briefing-card {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: all 0.18s;
}
.tp-briefing-card:hover {
  border-color: var(--text-dim);
  transform: translateY(-1px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.tp-briefing-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.tp-briefing-icon { font-size: 18px; }
.tp-briefing-name { font-size: 13px; font-weight: 700; color: var(--text); flex: 1; }
.tp-briefing-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}
.tp-briefing-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.tp-briefing-count {
  font-weight: 700;
  color: var(--primary);
}
.tp-briefing-empty {
  color: var(--text-dim);
  font-style: italic;
}

/* --- Freshness Toggle --- */
.tp-stale-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.tp-stale-btn:hover { border-color: var(--primary); color: var(--text); }
.tp-stale-on {
  background: var(--primary-dim);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

/* --- Business Relevance Badge on Articles --- */
.tp-biz-relevance {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid;
  background: rgba(0,0,0,0.2);
  white-space: nowrap;
}

/* --- Business Tags on Articles --- */
.tp-biz-tag {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 8px;
  white-space: nowrap;
}

/* --- Stale Articles --- */
.tp-article-stale {
  opacity: 0.55;
}
.tp-article-stale:hover {
  opacity: 0.85;
}

/* --- Show Older Button --- */
.tp-show-older-btn {
  margin-top: 12px;
  padding: 8px 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.tp-show-older-btn:hover {
  background: var(--primary-dim);
  border-color: var(--primary);
}

/* --- Pipeline Status --- */
.tp-pipeline-item { display: flex; align-items: center; gap: 6px; padding: 4px 0; font-size: 12px; color: var(--text-muted); }
.tp-pip-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* --- Filtered count badge --- */
.tp-filtered-count {
  font-size: 12px;
  color: var(--text-dim);
  padding: 4px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
  display: none;
}

/* --- Article Cards --- */
.tp-article-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
  cursor: pointer; transition: all 0.2s;
  margin-bottom: 8px;
}
.tp-article-card:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,212,255,0.08); }
.tp-article-main { display: flex; gap: 12px; align-items: flex-start; }
.tp-article-icon { font-size: 24px; min-width: 32px; text-align: center; padding-top: 2px; }
.tp-article-body { flex: 1; min-width: 0; }
.tp-article-title { font-size: 14px; font-weight: 600; line-height: 1.4; margin-bottom: 4px; color: var(--text); }
.tp-article-summary { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin-bottom: 6px; }
.tp-article-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* --- Scores --- */
.tp-scores { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.tp-score {
  display: flex; flex-direction: column; align-items: center;
  padding: 6px 10px; border-radius: 8px; border: 1px solid;
  background: rgba(0,0,0,0.2); min-width: 56px;
}
.tp-score-val { font-size: 18px; font-weight: 700; line-height: 1.1; }
.tp-score-lbl { font-size: 8px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); font-weight: 600; }

/* --- Tags --- */
.news-filter-btn {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-muted); padding: 6px 16px; border-radius: 20px;
  cursor: pointer; font-size: 12px; font-weight: 600;
  transition: all 0.15s;
}
.news-filter-btn:hover { border-color: var(--primary); color: var(--text); }
.news-filter-btn.active { background: var(--primary-dim); border-color: var(--primary); color: var(--primary); }
.news-grid { display: flex; flex-direction: column; gap: 0; }
.news-tag { font-size: 10px; padding: 2px 8px; border-radius: 10px; background: var(--primary-dim); color: var(--primary); font-weight: 600; }
.tp-tag-sub { font-size: 10px; padding: 2px 6px; border-radius: 8px; background: var(--surface2); color: var(--text-dim); }
.news-time { font-size: 11px; color: var(--text-dim); }

/* --- Daily Summary / Headlines --- */
.tp-daily-headlines { display: flex; flex-direction: column; gap: 8px; }
.tp-headline-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 14px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; transition: all 0.15s;
}
.tp-headline-item:hover { border-color: var(--primary); background: var(--surface2); }
.tp-headline-num {
  font-size: 22px; font-weight: 800; min-width: 28px; text-align: center;
  line-height: 1.2; padding-top: 2px;
}
.tp-headline-text { flex: 1; min-width: 0; }
.tp-headline-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.4; margin-bottom: 4px; }
.tp-headline-meta { display: flex; gap: 8px; align-items: center; }

/* --- Resumo Executivo --- */
.tp-resumo-text { font-size: 13px; line-height: 1.7; color: var(--text); white-space: pre-wrap; }
.tp-resumo-time { font-size: 11px; color: var(--text-dim); margin-top: 8px; font-style: italic; }

/* --- Modal --- */
.tp-modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 10000;
}
.tp-modal-content {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 16px; max-width: 700px; width: 100%;
  max-height: 85vh; overflow-y: auto; padding: 24px;
}
.tp-modal-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.tp-modal-title { font-size: 18px; font-weight: 700; line-height: 1.3; color: var(--text); }
.tp-modal-close {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-muted); width: 32px; height: 32px;
  border-radius: 8px; cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.15s;
}
.tp-modal-close:hover { background: var(--primary-dim); color: var(--primary); border-color: var(--primary); }
.tp-modal-scores { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.tp-modal-score {
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 16px; border-radius: 10px; border: 2px solid;
  background: rgba(0,0,0,0.2);
}
.tp-modal-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* --- Analysis Sections --- */
.tp-analysis-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; margin-bottom: 10px;
}
.tp-analysis-title { font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.tp-analysis-body { font-size: 13px; line-height: 1.6; color: var(--text-muted); white-space: pre-wrap; }
.tp-analysis-empty .tp-analysis-body { color: var(--text-dim); font-style: italic; }

/* --- Briefing Grid --- */
.tp-briefing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .tp-sidebar { width: 220px; }
  .tp-briefing-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
@media (max-width: 768px) {
  .tp-layout { flex-direction: column; }
  .tp-sidebar { width: 100%; display: flex; flex-wrap: wrap; gap: 4px; }
  .tp-sidebar-section-title { width: 100%; }
  .tp-biz-parent, .tp-biz-item { padding: 6px 10px; font-size: 12px; }
  .tp-biz-sub { padding: 5px 10px 5px 32px; font-size: 11px; }
  .tp-article-main { flex-direction: column; }
  .tp-scores { flex-direction: row; }
  .tp-modal-content { padding: 16px; }
  .tp-modal-title { font-size: 15px; }
  .tp-briefing-grid { grid-template-columns: 1fr; }
  .tp-briefing-card { padding: 10px 12px; }
}
@media (max-width: 480px) {
  .tp-article-card { padding: 10px 12px; }
  .tp-article-title { font-size: 13px; }
  .tp-article-summary { font-size: 11px; }
  .tp-score { padding: 4px 8px; min-width: 48px; }
  .tp-score-val { font-size: 15px; }
}
