/* MODULE: Funnel | FILE: styles.css */
/* Styles for funnel analysis page. */

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

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

.funnel-page__subtitle {
  font-size: 13px;
  color: #8b8fa3;
  margin-bottom: 24px;
}

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

/* ─── Overview KPIs ────────────────────────────────────────────────── */

.funnel-kpis {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.funnel-kpi {
  background: #1e2235;
  border: 1px solid #2a2f4e;
  border-radius: 10px;
  padding: 16px 22px;
  min-width: 180px;
  flex: 1;
}

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

.funnel-kpi__value {
  font-size: 24px;
  font-weight: 700;
  color: #e0e0e0;
}

.funnel-kpi__value--green {
  color: #22c55e;
}

.funnel-kpi__value--red {
  color: #ef4444;
}

.funnel-kpi__detail {
  font-size: 11px;
  color: #8b8fa3;
  margin-top: 2px;
}

/* ─── Visual Funnel Chart ──────────────────────────────────────────── */

.funnel-chart-wrap {
  background: #1e2235;
  border: 1px solid #2a2f4e;
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 24px;
}

.funnel-chart-wrap__title {
  font-size: 14px;
  font-weight: 600;
  color: #e0e0e0;
  margin-bottom: 20px;
}

.funnel-visual {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: center;
}

.funnel-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  border-radius: 6px;
  transition: width 0.5s ease;
  cursor: default;
}

.funnel-bar__label {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  z-index: 1;
  white-space: nowrap;
}

.funnel-bar__count {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  margin-left: 8px;
  z-index: 1;
}

.funnel-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  font-size: 11px;
  color: #8b8fa3;
}

.funnel-connector__rate {
  font-weight: 600;
  margin-left: 4px;
}

.funnel-connector__rate--good {
  color: #22c55e;
}

.funnel-connector__rate--mid {
  color: #eab308;
}

.funnel-connector__rate--bad {
  color: #ef4444;
}

/* Stage colors */
.funnel-bar--1 { background: #635bff; }
.funnel-bar--2 { background: #3b82f6; }
.funnel-bar--3 { background: #14b8a6; }
.funnel-bar--4 { background: #22c55e; }
.funnel-bar--5 { background: #eab308; }

/* ─── Stage Metrics Table ──────────────────────────────────────────── */

.stage-metrics-wrap {
  background: #1e2235;
  border: 1px solid #2a2f4e;
  border-radius: 10px;
  overflow-x: auto;
  margin-bottom: 24px;
}

.stage-metrics-wrap__title {
  font-size: 14px;
  font-weight: 600;
  color: #e0e0e0;
  padding: 16px 20px 0;
}

.stage-metrics {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.stage-metrics th {
  text-align: left;
  padding: 12px 16px;
  color: #8b8fa3;
  font-weight: 600;
  border-bottom: 1px solid #2a2f4e;
  white-space: nowrap;
}

.stage-metrics td {
  padding: 12px 16px;
  color: #c4c7d4;
  border-bottom: 1px solid #2a2f4e22;
  white-space: nowrap;
}

.stage-metrics tr:last-child td {
  border-bottom: none;
}

.stage-metrics tr:hover td {
  background: #252a40;
}

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

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

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

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

/* ─── Drop-Off Alert ───────────────────────────────────────────────── */

.dropoff-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.dropoff-card {
  background: #1e2235;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.dropoff-card--critical {
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.dropoff-card--warning {
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.dropoff-card--healthy {
  border: 1px solid #2a2f4e;
}

.dropoff-card__icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.dropoff-card__icon--critical {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.dropoff-card__icon--warning {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}

.dropoff-card__icon--healthy {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.dropoff-card__body {
  flex: 1;
}

.dropoff-card__title {
  font-size: 14px;
  font-weight: 600;
  color: #e0e0e0;
  margin-bottom: 4px;
}

.dropoff-card__stat {
  font-size: 12px;
  color: #8b8fa3;
  margin-bottom: 6px;
}

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

/* ─── Benchmark Bar ────────────────────────────────────────────────── */

.benchmark-section {
  background: #1e2235;
  border: 1px solid #2a2f4e;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 24px;
}

.benchmark-section__title {
  font-size: 14px;
  font-weight: 600;
  color: #e0e0e0;
  margin-bottom: 16px;
}

.benchmark-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.benchmark-row:last-child {
  margin-bottom: 0;
}

.benchmark-row__label {
  width: 200px;
  font-size: 12px;
  color: #c4c7d4;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.benchmark-row__bars {
  flex: 1;
  position: relative;
  height: 24px;
  display: flex;
  align-items: center;
}

.benchmark-bar {
  height: 10px;
  border-radius: 5px;
  position: absolute;
  left: 0;
  transition: width 0.4s ease;
}

.benchmark-bar--yours {
  background: #635bff;
  z-index: 2;
}

.benchmark-bar--industry {
  background: #2a2f4e;
  z-index: 1;
}

.benchmark-row__values {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
  font-size: 12px;
  min-width: 150px;
  justify-content: flex-end;
}

.benchmark-row__yours {
  color: #635bff;
  font-weight: 600;
}

.benchmark-row__industry {
  color: #8b8fa3;
}

.benchmark-row__delta {
  font-weight: 600;
}

.benchmark-row__delta--above {
  color: #22c55e;
}

.benchmark-row__delta--at {
  color: #8b8fa3;
}

.benchmark-row__delta--below {
  color: #ef4444;
}
