/* MODULE: Audiences | FILE: styles.css */
/* Styles for audience intelligence page. */

.audiences-page {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.audiences-page__title {
  font-size: 24px;
  font-weight: 700;
  color: #e0e0e0;
  margin-bottom: 24px;
}

.audiences-loading {
  color: #8b8fa3;
  font-size: 14px;
  text-align: center;
  padding: 40px 0;
}

/* ─── Tabs ─────────────────────────────────────────────────────────── */

.audiences-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid #2a2f4e;
  padding-bottom: 0;
}

.audiences-tabs__btn {
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 500;
  color: #8b8fa3;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.audiences-tabs__btn:hover {
  color: #c4c7d4;
}

.audiences-tabs__btn--active {
  color: #635bff;
  border-bottom-color: #635bff;
}

/* ─── Audience Table ───────────────────────────────────────────────── */

.audience-table-wrap {
  overflow-x: auto;
  background: #1e2235;
  border-radius: 10px;
  border: 1px solid #2a2f4e;
}

.audience-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.audience-table th {
  text-align: left;
  padding: 10px 14px;
  color: #8b8fa3;
  font-weight: 600;
  border-bottom: 1px solid #2a2f4e;
  white-space: nowrap;
}

.audience-table td {
  padding: 10px 14px;
  color: #c4c7d4;
  border-bottom: 1px solid #2a2f4e22;
  white-space: nowrap;
}

.audience-table tr:last-child td {
  border-bottom: none;
}

.audience-table tr:hover td {
  background: #252a40;
}

.sat-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

.sat-badge--green {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.sat-badge--amber {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}

.sat-badge--red {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.expansion-flag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

/* ─── Saturation Gauge ─────────────────────────────────────────────── */

.saturation-section {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.saturation-card {
  background: #1e2235;
  border: 1px solid #2a2f4e;
  border-radius: 10px;
  padding: 16px;
}

.saturation-card__name {
  font-size: 13px;
  font-weight: 600;
  color: #e0e0e0;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saturation-gauge {
  position: relative;
  height: 8px;
  background: #2a2f4e;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.saturation-gauge__fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.saturation-gauge__fill--green {
  background: #22c55e;
}

.saturation-gauge__fill--amber {
  background: #eab308;
}

.saturation-gauge__fill--red {
  background: #ef4444;
}

.saturation-card__meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #8b8fa3;
}

.saturation-card__value {
  font-weight: 600;
}

.saturation-card__trend {
  font-size: 11px;
}

.trend--rising {
  color: #ef4444;
}

.trend--stable {
  color: #8b8fa3;
}

.trend--declining {
  color: #22c55e;
}

/* ─── Summary Bar ──────────────────────────────────────────────────── */

.saturation-summary {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.saturation-summary__item {
  background: #1e2235;
  border: 1px solid #2a2f4e;
  border-radius: 10px;
  padding: 14px 20px;
  min-width: 160px;
}

.saturation-summary__label {
  font-size: 11px;
  color: #8b8fa3;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.saturation-summary__value {
  font-size: 22px;
  font-weight: 700;
  color: #e0e0e0;
}

/* ─── Cluster Map (bubble chart) ───────────────────────────────────── */

.cluster-map-wrap {
  background: #1e2235;
  border: 1px solid #2a2f4e;
  border-radius: 10px;
  padding: 16px;
}

.cluster-map-wrap h4 {
  font-size: 14px;
  font-weight: 600;
  color: #e0e0e0;
  margin-bottom: 12px;
}

.cluster-map-canvas {
  width: 100%;
  height: 360px;
}

.cluster-map-canvas canvas {
  width: 100%;
  height: 100%;
}

.cluster-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 12px;
  color: #8b8fa3;
}

.cluster-legend__item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cluster-legend__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─── Expansion Panel ──────────────────────────────────────────────── */

.expansion-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.expansion-card {
  background: #1e2235;
  border: 1px solid #2a2f4e;
  border-radius: 10px;
  padding: 16px;
}

.expansion-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.expansion-card__name {
  font-size: 14px;
  font-weight: 600;
  color: #e0e0e0;
}

.expansion-card__sat {
  font-size: 13px;
  font-weight: 600;
}

.expansion-card__reason {
  font-size: 12px;
  color: #8b8fa3;
  margin-bottom: 8px;
}

.expansion-card__action {
  font-size: 13px;
  color: #635bff;
  font-weight: 500;
  padding: 8px 12px;
  background: rgba(99, 91, 255, 0.08);
  border-radius: 6px;
  border: 1px solid rgba(99, 91, 255, 0.2);
}

.expansion-card__headroom {
  margin-top: 10px;
  font-size: 12px;
  color: #8b8fa3;
}

.expansion-empty {
  text-align: center;
  color: #8b8fa3;
  font-size: 14px;
  padding: 40px 0;
}
