/* echomap.css — Echo Map overlay styles */

/* ── Overlay ── */

.forge-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--forge-bg, #0f0f0f);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.forge-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.forge-overlay-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.overlay-title {
  font-size: 18px;
  font-weight: 600;
  flex: 1;
}

.overlay-close-btn {
  background: none;
  border: none;
  color: inherit;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.6;
  padding: 4px 8px;
}

.overlay-close-btn:hover { opacity: 1; }

.forge-overlay-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ── Echo heatmap ── */

.echo-section {
  margin-bottom: 32px;
}

.echo-section-title {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.echo-heatmap {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 120px;
  padding: 8px 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.heatmap-col {
  flex: 0 0 auto;
  width: 8px;
  height: 100%;
  display: flex;
  align-items: flex-end;
  cursor: default;
}

.heatmap-bar {
  width: 100%;
  border-radius: 2px 2px 0 0;
  min-height: 0;
  transition: height 0.3s ease;
}

.echo-color-moved     { background: #e05a7a; }
.echo-color-laughed   { background: #f5c842; }
.echo-color-wow       { background: #a855f7; }
.echo-color-nailed_it { background: #22c55e; }
.echo-color-hard      { background: #6b7280; }
.echo-color-disagree  { background: #f97316; }
.echo-color-none      { background: rgba(255,255,255,0.1); }

.heatmap-time-axis {
  display: flex;
  font-size: 10px;
  color: rgba(255,255,255,0.25);
  padding-top: 4px;
  gap: 2px;
  overflow-x: auto;
}

.heatmap-time-label {
  flex: 0 0 auto;
  text-align: center;
}

/* ── Drop-off chart ── */

.dropoff-chart {
  display: flex;
  align-items: flex-end;
  height: 60px;
  gap: 1px;
  margin-top: 8px;
}

.dropoff-segment {
  flex: 1;
  height: var(--pct, 100%);
  background: rgba(255,255,255,0.15);
  border-radius: 1px;
  min-height: 2px;
}

/* ── Echo type breakdown ── */

.echo-breakdown { display: flex; flex-direction: column; gap: 8px; }

.breakdown-row {
  display: grid;
  grid-template-columns: 24px 90px 1fr 40px;
  align-items: center;
  gap: 8px;
}

.breakdown-emoji { font-size: 16px; }
.breakdown-label { font-size: 13px; color: rgba(255,255,255,0.7); }

.breakdown-bar-track {
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
}

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

.breakdown-count {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  text-align: right;
}

/* ── Prompt responses ── */

.prompt-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.prompt-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.prompt-card-title {
  font-size: 14px;
  font-weight: 500;
}

.prompt-type-badge {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.5;
}

.prompt-position {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  margin-left: auto;
}

.prompt-response-count {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 8px;
}

.poll-tally {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.poll-tally-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.poll-tally-bar-track {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.poll-tally-bar {
  height: 100%;
  background: rgba(255,255,255,0.3);
  border-radius: 3px;
}

.response-list {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.response-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  padding: 6px 8px;
  background: rgba(255,255,255,0.03);
  border-radius: 4px;
  color: rgba(255,255,255,0.7);
}

.response-item.flagged {
  opacity: 0.35;
  text-decoration: line-through;
}

.response-text { flex: 1; }

.flag-btn {
  background: none;
  border: none;
  font-size: 11px;
  cursor: pointer;
  opacity: 0.4;
  flex-shrink: 0;
  padding: 2px 4px;
  color: inherit;
}

.flag-btn:hover { opacity: 0.8; color: #f97316; }

/* ── Brand share toggle ── */

.brand-share-section {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  margin-top: 24px;
}

.brand-share-label {
  flex: 1;
  font-size: 13px;
}

.brand-share-label strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.brand-share-label span {
  color: rgba(255,255,255,0.4);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 24px;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  bottom: 3px;
  left: 3px;
  transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent, #5a7ac4);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ── Overview grid ── */

.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.overview-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.overview-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.overview-ep-number {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  font-weight: 500;
}

.overview-ep-date {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
}

.overview-ep-title {
  font-weight: 500;
  font-size: 14px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.overview-stats {
  display: flex;
  gap: 16px;
}

.overview-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.overview-stat .stat-value { font-size: 16px; font-weight: 600; }
.overview-stat .stat-label { font-size: 11px; opacity: 0.45; }

.overview-completion-bar {
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}

.overview-completion-fill {
  height: 100%;
  background: rgba(255,255,255,0.4);
  border-radius: 2px;
}

.view-map-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  text-align: center;
  transition: background 0.15s;
}

.view-map-btn:hover { background: rgba(255,255,255,0.14); }

.echo-no-data {
  font-size: 13px;
  color: rgba(255,255,255,0.3);
  font-style: italic;
  padding: 12px 0;
}

.echo-breadcrumb {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  margin-bottom: 16px;
  display: inline-block;
}

.echo-breadcrumb:hover { color: rgba(255,255,255,0.8); }

.echo-episode-header {
  margin-bottom: 24px;
}

.echo-episode-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.echo-episode-meta {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
}

@media (max-width: 768px) {
  .overview-grid { grid-template-columns: 1fr; }
  .forge-overlay-content { padding: 16px; }
  .forge-overlay-header { padding: 12px 16px; }
}
