/**
 * rede.css — Mapa de calor, comunidades, encontros e calendário cultural.
 *
 * Reaproveita as variáveis do design system (style.css). Nada aqui redefine
 * cor de marca: se a família trocar a cor primária nas configurações, o mapa
 * troca junto.
 */

/* ── Convite (opt-in, sugestão de comunidade) ─────────────────────────────── */

.rede-convite {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  border-left: 3px solid var(--accent);
}

/* ── Mapa ─────────────────────────────────────────────────────────────────── */

.rede-mapa-topo {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .6rem;
}

.rede-legenda {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-size: .72rem;
  color: var(--text-muted);
}

.rede-legenda span {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}

.rede-legenda i {
  display: inline-block;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 45%, transparent);
}

.mapa-br {
  width: 100%;
  max-width: 460px;
  height: auto;
  margin: 0 auto .6rem;
  display: block;
}

.mapa-br-shape {
  fill: color-mix(in srgb, var(--primary) 8%, transparent);
  stroke: color-mix(in srgb, var(--primary) 28%, transparent);
  stroke-width: 1.2;
  stroke-linejoin: round;
}

.mapa-vazio {
  fill: color-mix(in srgb, var(--text-muted) 30%, transparent);
}

.mapa-bolha { cursor: pointer; }

/* O círculo que só existe para o dedo: invisível, mas capturando o toque.
   `fill: transparent` (e não `none`) é o que o faz receber o clique. */
.mapa-bolha circle.mapa-toque {
  fill: transparent;
  stroke: none;
}

.mapa-bolha circle:not(.mapa-toque) {
  fill: color-mix(in srgb, var(--primary) 55%, transparent);
  stroke: var(--primary);
  stroke-width: 1;
  transition: fill .2s ease, transform .2s ease;
}

.mapa-bolha:hover circle:not(.mapa-toque) {
  fill: color-mix(in srgb, var(--accent) 70%, transparent);
}

.mapa-bolha text {
  fill: #fff;
  font-size: 9px;
  font-weight: 800;
  text-anchor: middle;
  pointer-events: none;
}

/* ── Ranking de estados ───────────────────────────────────────────────────── */

.rede-rank {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .35rem 0;
  cursor: pointer;
}

.rede-rank:hover .rede-rank-uf {
  background: var(--primary);
  color: #fff;
}

.rede-rank-uf {
  flex-shrink: 0;
  width: 30px;
  text-align: center;
  font-size: .68rem;
  font-weight: 900;
  padding: .2rem 0;
  border-radius: var(--radius-sm, 8px);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  transition: background .15s ease, color .15s ease;
}

.rede-barra {
  height: 5px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--text-muted) 15%, transparent);
  margin-top: .25rem;
  overflow: hidden;
}

.rede-barra i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--primary);
}

/* ── Comunidades ──────────────────────────────────────────────────────────── */

.rede-grupo { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.rede-grupo:hover { transform: translateY(-2px); box-shadow: var(--shadow-md, 0 6px 20px rgba(0,0,0,.08)); }

.family-badge.sm {
  width: 32px;
  height: 32px;
  font-size: .7rem;
  flex-shrink: 0;
}

/* ── Conversa ─────────────────────────────────────────────────────────────── */

.rede-chat {
  max-height: 46vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: .3rem;
}

.rede-msg {
  align-self: flex-start;
  max-width: 78%;
  padding: .55rem .75rem;
  border-radius: 14px 14px 14px 4px;
  background: color-mix(in srgb, var(--text-muted) 10%, transparent);
  font-size: .87rem;
  line-height: 1.55;
}

.rede-msg.minha {
  align-self: flex-end;
  border-radius: 14px 14px 4px 14px;
  background: color-mix(in srgb, var(--primary) 16%, transparent);
}

.rede-msg-hora {
  display: block;
  margin-top: .2rem;
  font-size: .68rem;
  color: var(--text-muted);
}

/* ── Encontros ────────────────────────────────────────────────────────────── */

.enc-card {
  display: flex;
  gap: 1rem;
  cursor: pointer;
  overflow: hidden;
  transition: transform .15s ease;
}

.enc-card:hover { transform: translateX(2px); }

.enc-data {
  flex-shrink: 0;
  width: 66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  padding: .8rem 0;
}

.enc-dia { font-size: 1.5rem; font-weight: 900; line-height: 1; }
.enc-mes { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }

/* ── Calendário cultural ──────────────────────────────────────────────────── */

.cult-card { cursor: pointer; overflow: hidden; transition: transform .15s ease, box-shadow .15s ease; }
.cult-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md, 0 6px 20px rgba(0,0,0,.08)); }

.cult-capa {
  height: 118px;
  background-size: cover;
  background-position: center;
  background-color: color-mix(in srgb, var(--primary) 10%, transparent);
}

.cult-capa-vazia {
  display: flex;
  align-items: center;
  justify-content: center;
  color: color-mix(in srgb, var(--primary) 55%, transparent);
}

/* ── Telas estreitas ──────────────────────────────────────────────────────── */

@media (max-width: 720px) {
  .rede-mapa-topo { flex-direction: column; align-items: flex-start; gap: .4rem; }
  .enc-data { width: 54px; }
  .enc-dia { font-size: 1.25rem; }
}
