/**
 * PowerReader — Blindspot & Source Transparency Styles
 *
 * Uses CSS custom properties defined in main.css :root.
 * Contains: blindspot-page, blindspot-card, blindspot-filter,
 *           source-badge, source-tendency, source-detail, source-trend.
 */

/* ==============================================
   Blindspot Page
   ============================================== */
.blindspot-page__desc {
  color: var(--color-text-secondary);
  font-size: var(--text-caption);
  margin-bottom: var(--spacing-md);
}

/* ==============================================
   Blindspot Filter Bar
   ============================================== */
.blindspot-filter {
  display: flex;
  gap: var(--spacing-xs);
  overflow-x: auto;
  padding-bottom: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
  -webkit-overflow-scrolling: touch;
}

.blindspot-filter__btn {
  flex-shrink: 0;
  padding: 6px 14px;
  font-size: var(--text-small);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: var(--color-bg);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.blindspot-filter__btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.blindspot-filter__btn--active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* ==============================================
   Blindspot List
   ============================================== */
.blindspot-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

/* ==============================================
   Blindspot Card
   ============================================== */
.blindspot-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: var(--spacing-md);
  border-left: 4px solid var(--color-border);
}

.blindspot-card--green {
  border-left-color: #2E7D32;
}

.blindspot-card--blue {
  border-left-color: #1565C0;
}

.blindspot-card--white {
  border-left-color: #757575;
}

.blindspot-card--imbalanced {
  border-left-color: #FFC107;
}

.blindspot-card__badge {
  display: inline-block;
  padding: 2px 10px;
  font-size: var(--text-small);
  font-weight: 600;
  border-radius: 12px;
  margin-bottom: var(--spacing-sm);
}

.blindspot-card--green .blindspot-card__badge {
  background: #E8F5E9;
  color: #2E7D32;
}

.blindspot-card--blue .blindspot-card__badge {
  background: #E3F2FD;
  color: #1565C0;
}

.blindspot-card--white .blindspot-card__badge {
  background: #F5F5F5;
  color: #616161;
}

.blindspot-card--imbalanced .blindspot-card__badge {
  background: #FFF8E1;
  color: #F57F17;
}

.blindspot-card__title {
  font-size: var(--text-h3);
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
  line-height: 1.4;
}

.blindspot-card__missing {
  font-size: var(--text-caption);
  color: #D32F2F;
  font-weight: 500;
  margin-bottom: var(--spacing-sm);
}

.blindspot-card__meta {
  display: flex;
  gap: var(--spacing-md);
  font-size: var(--text-small);
  color: var(--color-text-secondary);
  margin-top: var(--spacing-sm);
}

/* ==============================================
   Blindspot Distribution Bar (shared with source detail)
   ============================================== */
.blindspot-dist {
  margin: var(--spacing-sm) 0;
}

.blindspot-dist__bar {
  display: flex;
  height: 24px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--color-bg-secondary);
}

.blindspot-dist__segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-small);
  color: #fff;
  font-weight: 600;
  transition: width 0.3s;
}

.blindspot-dist__legend {
  display: flex;
  gap: var(--spacing-md);
  margin-top: var(--spacing-xs);
  font-size: var(--text-small);
  color: var(--color-text-secondary);
}

.blindspot-dist__legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.blindspot-dist__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ==============================================
   Source Badge (for article cards)
   ============================================== */
.source-badge {
  display: inline-block;
  padding: 1px 8px;
  font-size: var(--text-small);
  font-weight: 600;
  border-radius: 4px;
  text-decoration: none;
  transition: opacity 0.15s;
}

.source-badge:hover {
  opacity: 0.8;
}

.source-badge--low-confidence {
  opacity: 0.6;
  border: 1px dashed currentColor;
}

/* ==============================================
   Source Tendency Card (detail page)
   ============================================== */
.source-tendency-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.source-tendency__camp {
  display: inline-block;
  padding: 4px 12px;
  font-size: var(--text-caption);
  font-weight: 700;
  border-radius: 16px;
  margin-bottom: var(--spacing-sm);
}

.source-tendency__camp--pan_green {
  background: #E8F5E9;
  color: #2E7D32;
}

.source-tendency__camp--pan_white {
  background: #F5F5F5;
  color: #616161;
}

.source-tendency__camp--pan_blue {
  background: #E3F2FD;
  color: #1565C0;
}

.source-tendency__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-sm);
}

.source-tendency__stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.source-tendency__stat-item--bar {
  grid-column: 1 / -1;
}

.source-tendency__stat-label {
  font-size: var(--text-small);
  color: var(--color-text-secondary);
}

.source-tendency__stat-value {
  font-size: var(--text-body);
  font-weight: 600;
}

/* ==============================================
   Source Detail Sections
   ============================================== */
.source-detail__back {
  margin-bottom: var(--spacing-sm);
}

.source-detail__section {
  margin-bottom: var(--spacing-lg);
}

.source-detail__section h3 {
  font-size: var(--text-h3);
  margin-bottom: var(--spacing-sm);
}

/* ==============================================
   Source Trend Chart (horizontal bars)
   ============================================== */
.source-trend {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.source-trend__row {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.source-trend__month {
  flex-shrink: 0;
  width: 60px;
  font-size: var(--text-small);
  color: var(--color-text-secondary);
}

.source-trend__bar-wrap {
  flex: 1;
  height: 20px;
  background: var(--color-bg-secondary);
  border-radius: 4px;
  overflow: hidden;
}

.source-trend__bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
  min-width: 2px;
}

.source-trend__score {
  flex-shrink: 0;
  width: 60px;
  font-size: var(--text-small);
  color: var(--color-text-secondary);
  text-align: right;
}

/* ==============================================
   Source Recent Articles
   ============================================== */
.source-recent {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.source-recent__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid var(--color-border);
}

.source-recent__item:last-child {
  border-bottom: none;
}

.source-recent__link {
  flex: 1;
  font-size: var(--text-caption);
  color: var(--color-text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: var(--spacing-sm);
}

.source-recent__link:hover {
  color: var(--color-primary);
}

.source-recent__score {
  flex-shrink: 0;
  font-size: var(--text-small);
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-bg-secondary);
  padding: 2px 8px;
  border-radius: 4px;
}
