/* Stats Cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; padding-right: 75px; position: relative; overflow: hidden; transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .7px; margin-bottom: 8px; font-weight: 600; }
.stat-value { font-size: 30px; font-weight: 800; color: var(--text-strong); line-height: 1.1; }
.stat-sub { font-size: 11px; color: var(--muted); margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.stat-icon { position: absolute; right: 16px; top: 16px; width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 17px; opacity: .9; }

/* Sentiment Insight Card */
.insight-card { 
  background: linear-gradient(135deg, var(--bg2) 0%, rgba(79,142,247,0.1) 100%);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.insight-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(79,142,247,0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.insight-content {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
@media (max-width: 768px) {
  .insight-content {
    flex-direction: column;
    gap: 16px;
  }
}
.insight-icon {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
}
.insight-text {
  flex: 1;
}
.insight-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 4px;
}
.insight-message {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.5;
}
.insight-breakdown {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.insight-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}
.insight-stat-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
/* Trending Keywords in Insight Card */
.insight-trending {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.insight-trending-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.insight-trending-title i {
  color: var(--yellow);
  font-size: 14px;
}
.trending-keywords-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.trending-keyword {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  transition: all 0.2s;
}
.trending-keyword:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-1px);
}
.keyword-mention-count {
  opacity: 0.8;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255,255,255,0.2);
  padding: 2px 6px;
  border-radius: 4px;
}
.trending-keyword:hover .keyword-mention-count {
  background: rgba(255,255,255,0.4);
}
/* Charts */
.charts-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 24px; }
.chart-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
  transition: box-shadow .2s;
}
.chart-card:hover { box-shadow: var(--shadow); }
.chart-title { font-size: 13px; font-weight: 700; color: var(--text-strong); margin-bottom: 16px; display: flex; align-items: center; gap: 7px; }
.chart-title i { color: var(--accent); font-size: 13px; }

/* Search + Filter Bar */
.search-bar {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.search-input {
  flex: 1; min-width: 200px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 14px; color: var(--text); font-size: 14px; outline: none;
}
.search-input:focus { border-color: var(--accent); }
.filter-select {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; color: var(--text); font-size: 13px; outline: none; cursor: pointer;
}

/* Tables */
.table-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.table-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.table-title { font-size: 14px; font-weight: 600; }
.table-count { font-size: 12px; color: var(--muted); }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 16px; text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--bg3); }
td { padding: 12px 16px; border-bottom: 1px solid rgba(45,49,72,.5); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(79,142,247,.06); }
.article-title a { color: var(--text); text-decoration: none; font-weight: 500; line-height: 1.4; }
.article-title a:hover { color: var(--accent); }
.article-summary { color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.5; }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.badge-nasional { background: rgba(79,142,247,.15); color: var(--accent); }
.badge-ekonomi { background: rgba(245,158,11,.15); color: var(--yellow); }
.badge-teknologi { background: rgba(34,197,94,.15); color: var(--green); }
.badge-default { background: rgba(108,99,255,.15); color: var(--accent2); }
.badge-positif { background: rgba(34,197,94,.15); color: var(--green); }
.badge-negatif { background: rgba(239,68,68,.15); color: var(--red); }
.badge-netral  { background: rgba(100,116,139,.15); color: var(--muted); }
.badge-active { background: rgba(34,197,94,.15); color: var(--green); }
.badge-inactive { background: rgba(100,116,139,.15); color: var(--muted); }
.time-text { font-size: 11px; color: var(--muted); white-space: nowrap; }
.source-text { font-size: 12px; font-weight: 600; color: var(--accent); white-space: nowrap; }

/* Pagination */
.pagination { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: var(--bg3); }
.page-info { font-size: 13px; color: var(--muted); }
.page-btns { display: flex; gap: 6px; }
.page-btn { padding: 5px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg2); color: var(--text); cursor: pointer; font-size: 12px; }
.page-btn:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-btn:disabled { opacity: .3; cursor: not-allowed; }

/* Section title */
.section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .9px; color: var(--muted); margin: 28px 0 14px;
  display: flex; align-items: center; gap: 9px;
}
.section-title i { font-size: 13px; color: var(--accent); opacity: .8; }
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Grids */
.p3-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.p3-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.nlp-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 24px; }

/* Filter chips */
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px 0 8px; }
.filter-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; padding: 3px 10px; border-radius: 99px; background: rgba(79,142,247,.12); color: var(--accent); border: 1px solid rgba(79,142,247,.25); cursor: pointer; transition: background .15s; }
.filter-chip:hover { background: rgba(79,142,247,.22); }

/* Toggle btn */
.toggle-btn { border: none; cursor: pointer; border-radius: 99px; font-size: 11px; font-weight: 700; padding: 3px 10px; transition: background .15s; }
.toggle-btn.on  { background: rgba(52,211,153,.2); color: #34d399; }
.toggle-btn.off { background: rgba(248,113,113,.15); color: #f87171; }

/* Keyword tags */
.keyword-cloud { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.kw-tag {
  padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 500;
  background: var(--bg3); border: 1px solid var(--border); color: var(--text);
  cursor: default; transition: all .15s;
}
.kw-tag:hover { border-color: var(--accent); color: var(--accent); }
.kw-tag .kw-count { font-size: 10px; color: var(--muted); margin-left: 3px; }

/* Sentiment meter */
.sentiment-bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; gap: 1px; margin-top: 10px; }
.sentiment-bar-pos { background: var(--green); transition: flex .5s; }
.sentiment-bar-neg { background: var(--red);   transition: flex .5s; }
.sentiment-bar-neu { background: var(--muted); transition: flex .5s; }
.sentiment-legend { display: flex; gap: 12px; margin-top: 6px; }
.sentiment-legend-item { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.sentiment-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* NLP progress */
.nlp-progress-wrap { margin-top: 8px; }
.nlp-progress-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.nlp-progress-bar { height: 6px; background: var(--bg3); border-radius: 99px; overflow: hidden; }
.nlp-progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 99px; transition: width .5s; }

/* Entity */
.entity-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; max-height: 220px; overflow-y: auto; }
.entity-item { display: flex; align-items: center; justify-content: space-between; padding: 5px 8px; border-radius: 6px; background: var(--bg3); }
.entity-name { font-size: 12px; font-weight: 500; color: var(--text); }
.entity-type-badge { font-size: 10px; padding: 2px 8px; border-radius: 99px; font-weight: 600; display: inline-block; }
.entity-count { font-size: 11px; color: var(--muted); margin-left: auto; padding-left: 8px; }
.type-PERSON, .entity-type-badge.PERSON       { background: rgba(79,142,247,.15); color: #4f8ef7; }
.type-ORGANIZATION, .entity-type-badge.ORGANIZATION { background: rgba(52,211,153,.15); color: #34d399; }
.type-LOCATION, .entity-type-badge.LOCATION     { background: rgba(251,191,36,.15); color: #fbbf24; }
.type-TOPIC        { background: rgba(245,158,11,.15); color: var(--yellow); }
.entity-type-badge.OTHER { background: rgba(167,139,250,.15); color: #a78bfa; }

/* Entity tabs */
.entity-tabs, .entity-type-tabs { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.entity-tab { padding: 5px 14px; border-radius: 99px; font-size: 12px; font-weight: 600; border: 1px solid var(--border); background: var(--bg2); color: var(--muted); cursor: pointer; transition: all .15s; }
.entity-tab.active { border-color: var(--accent); background: rgba(79,142,247,.12); color: var(--accent); }
.entity-tab:hover:not(.active) { border-color: var(--border); background: var(--bg); color: var(--text); }

/* Entity grid */
.entity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.entity-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; cursor: pointer; transition: box-shadow .15s; }
.entity-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.3); border-color: var(--accent); }
.entity-mentions { font-size: 22px; font-weight: 800; color: var(--accent); }
.entity-sentiment-bar { display: flex; height: 4px; border-radius: 3px; overflow: hidden; margin-top: 8px; gap: 1px; }

/* Platform tags */
.platform-tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 600; }
.platform-tag.youtube  { background: rgba(255,0,0,.12);  color: #ff4444; }
.platform-tag.twitter  { background: rgba(29,161,242,.12); color: #1da1f2; }
.platform-tag.instagram{ background: rgba(225,48,108,.12); color: #e1306c; }
.platform-tag.web      { background: rgba(79,142,247,.12); color: var(--accent); }
.platform-tag.tv       { background: rgba(50,205,50,.12);   color: #3aac3a; }
.platform-tag.tiktok   { background: rgba(0,0,0,.10);       color: #555; }
.platform-tag.linkedin { background: rgba(0,119,181,.12);   color: #0077b5; }

/* Sent badge for search results */
.sent-badge { display: inline-block; padding: 1px 6px; border-radius: 99px; font-size: 10px; font-weight: 600; }
.sent-badge.sent-positif { background: rgba(34,197,94,.15); color: var(--green); }
.sent-badge.sent-negatif { background: rgba(239,68,68,.15); color: var(--red); }
.sent-badge.sent-netral  { background: rgba(100,116,139,.15); color: var(--muted); }
