/* Chat de grupo de cada fiesta (app-chat-grupos.js) */

/* Foto del grupo: el cartel de la fiesta, cuadrado redondeado, con un sello de grupo */
.chat-grupo-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  border-radius: 12px;
  background: #1a1d17;
  color: var(--accent, #d2f365);
  flex: 0 0 auto;
}
.chat-grupo-avatar-icono {
  grid-area: 1 / 1;
}
.chat-grupo-avatar img {
  grid-area: 1 / 1;
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.chat-grupo-avatar-badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--accent, #d2f365);
  color: #11130f;
  font-size: 10px;
  border: 2px solid #0b0c0a;
}
.chat-grupo-avatar.is-thread {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}
.chat-grupo-avatar.is-thread .chat-grupo-avatar-badge {
  width: 17px;
  height: 17px;
  font-size: 8px;
}
.chat-grupo-avatar.is-grande {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  margin-bottom: 6px;
}

/* Vacío: invita a saludar */
.chat-grupo-vacio {
  text-align: center;
  align-items: center;
}

/* Botón ⋮ y su menú */
#chatPrivateModal .chat-thread-bar {
  position: relative;
}
#chatPrivateModal .chat-thread-more {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text, #f4f4f5);
  font-size: 18px;
  display: grid;
  place-items: center;
}
#chatPrivateModal .chat-thread-more.hidden {
  display: none;
}
.chat-grupo-menu {
  position: absolute;
  right: 4px;
  top: calc(100% + 2px);
  z-index: 5;
  min-width: 230px;
  max-width: min(320px, calc(100vw - 32px));
  max-height: 60vh;
  overflow: auto;
  padding: 6px;
  border-radius: 16px;
  background: #171915;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  display: grid;
  gap: 2px;
}
.chat-grupo-menu.hidden {
  display: none;
}
.chat-grupo-menu > button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text, #f4f4f5);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.chat-grupo-menu > button:hover,
.chat-grupo-menu > button:focus-visible {
  background: rgba(255, 255, 255, 0.06);
}
.chat-grupo-menu > button.is-peligro {
  color: #ff8a80;
}
.chat-grupo-gente-cab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 4px 10px;
}
.chat-grupo-gente-cab button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text, #f4f4f5);
}
.chat-grupo-gente {
  display: grid;
  gap: 2px;
}
.chat-grupo-persona {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text, #f4f4f5);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.chat-grupo-persona:hover {
  background: rgba(255, 255, 255, 0.06);
}
.chat-grupo-persona span {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-grupo-persona em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: #11130f;
  background: var(--accent, #d2f365);
  border-radius: 999px;
  padding: 2px 8px;
}
.chat-grupo-gente-cargando {
  padding: 12px;
  color: #a9ae9f;
}

/* Botón de la ficha: a todo lo ancho, como «Con amigos» */
.interest-btn.interest-btn-grupo,
#detailModal #detailInterestActions > .interest-btn-grupo {
  grid-column: 1 / -1;
  justify-content: center;
  border-color: rgba(210, 243, 101, 0.4);
}
.interest-btn.interest-btn-grupo i {
  color: var(--accent, #d2f365);
}

/* Interruptor del editor: «Chat de los que van» */
#postModal .post-compose-row.post-compose-row-switch {
  grid-template-columns: minmax(120px, auto) minmax(0, 1fr) auto;
}
.dv-switch {
  appearance: none;
  -webkit-appearance: none;
  width: 46px;
  height: 28px;
  margin: 0;
  border-radius: 999px;
  background: #2a2e26;
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  cursor: pointer;
  transition: background 0.15s ease;
}
.dv-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f4f6ef;
  transition: transform 0.15s ease;
}
.dv-switch:checked {
  background: var(--accent, #d2f365);
}
.dv-switch:checked::after {
  transform: translateX(18px);
  background: #11130f;
}
.dv-switch:focus-visible {
  outline: 3px solid var(--accent, #d2f365);
  outline-offset: 2px;
}

/* Grupos como WhatsApp: foto a la izquierda del primer mensaje de cada persona */
#chatPrivateModal .chat-msg.con-cara {
  gap: 6px;
}
.chat-msg-cara {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  overflow: hidden;
  cursor: pointer;
  margin-top: 2px;
}
.chat-msg-cara .community-avatar {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px;
  font-size: 11px;
}
.chat-msg-cara.is-hueco {
  height: 1px;
  cursor: default;
}
#chatPrivateModal .chat-msg.con-cara .chat-msg-author {
  display: block !important;
  margin: 0 0 1px;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
}

/* --- Info del grupo, como en WhatsApp (app-chat-grupos.js) -------------- */
#chatPrivateModal .chat-private-modal-panel {
  position: relative;
}
.chat-grupo-info {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: #0b0c0a;
  color: #f4f6ef;
  transform: translateX(100%);
  transition: transform 0.22s ease;
}
.chat-grupo-info.is-abierta {
  transform: none;
}
.chat-grupo-info.hidden {
  display: none;
}
.cgi-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-weight: 700;
  font-size: 17px;
}
.cgi-volver {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--accent, #d2f365);
  font-size: 20px;
}
.cgi-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}
.cgi-cabecera {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 22px 20px 16px;
  text-align: center;
}
.cgi-cartel {
  position: relative;
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  margin-bottom: 10px;
  border-radius: 50%;
  overflow: hidden;
  background: #22261e;
  color: #a9ae9f;
  font-size: 38px;
}
.cgi-cartel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cgi-cabecera h3 {
  margin: 0;
  font-size: 23px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.cgi-sub {
  margin: 0;
  color: #a9ae9f;
  font-size: 15px;
}
.cgi-linea {
  margin: 4px 0 0;
  color: var(--accent, #d2f365);
  font-size: 14px;
  font-weight: 600;
}
.cgi-acciones {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 4px 16px 18px;
  border-bottom: 8px solid #050605;
}
.cgi-acciones button {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #f4f6ef;
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}
.cgi-acciones button span {
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 96px;
  height: 58px;
  border-radius: 18px;
  background: #1b1d18;
  font-size: 20px;
  color: var(--accent, #d2f365);
}
.cgi-seccion {
  padding: 14px 0 8px;
  border-bottom: 8px solid #050605;
}
.cgi-seccion:last-child {
  border-bottom: 0;
}
.cgi-seccion-cab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 16px 8px;
  color: #a9ae9f;
  font-size: 14px;
  font-weight: 600;
}
.cgi-filtro {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 55%;
  padding: 0 10px;
  border-radius: 999px;
  background: #1b1d18;
}
.cgi-filtro input {
  width: 100%;
  min-height: 34px;
  border: 0;
  background: transparent;
  color: #f4f6ef;
  font: inherit;
  font-size: 14px;
  outline: none;
}
.cgi-persona {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 8px 16px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.cgi-persona:hover,
.cgi-persona:focus-visible {
  background: rgba(255, 255, 255, 0.04);
}
.cgi-persona[aria-disabled="true"] {
  cursor: default;
}
.cgi-persona .community-avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
}
.cgi-persona-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.cgi-persona-copy strong {
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cgi-persona-copy small {
  color: #8b9083;
  font-size: 13px;
}
.cgi-badge {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(210, 243, 101, 0.14);
  color: var(--accent, #d2f365);
  font-style: normal;
  font-size: 12.5px;
  font-weight: 700;
}
.cgi-vacio {
  margin: 0;
  padding: 10px 16px;
  color: #8b9083;
  font-size: 14px;
}
.cgi-salir {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  border: 0;
  background: transparent;
  color: #ff8a80;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.cgi-nota {
  margin: 0;
  padding: 4px 18px 10px;
  color: #6f7468;
  font-size: 12.5px;
}

/* Hoja al tocar a alguien: mensaje o perfil */
.cgi-hoja {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.55);
}
.cgi-hoja.hidden {
  display: none;
}
.cgi-hoja-caja {
  width: 100%;
  display: grid;
  gap: 2px;
  padding: 14px 10px max(14px, env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0;
  background: #171915;
  animation: cgi-hoja-sube 0.18s ease;
}
@keyframes cgi-hoja-sube {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
}
.cgi-hoja-quien {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 12px;
  font-size: 16px;
}
.cgi-hoja-quien .community-avatar {
  width: 40px;
  height: 40px;
}
.cgi-hoja-caja button {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #f4f6ef;
  font: inherit;
  font-size: 15.5px;
  text-align: left;
  cursor: pointer;
}
.cgi-hoja-caja button:hover,
.cgi-hoja-caja button:focus-visible {
  background: rgba(255, 255, 255, 0.06);
}
.cgi-hoja-caja button i {
  width: 22px;
  text-align: center;
  color: var(--accent, #d2f365);
}
.cgi-hoja-caja .cgi-hoja-cancelar {
  justify-content: center;
  margin-top: 4px;
  color: #a9ae9f;
}

/* Buscar en el chat: como en WhatsApp, ocupa el sitio de la cabecera (fuera
   de la rejilla del panel, que reparte las filas entre cabecera, mensajes y
   caja de escribir). */
.chat-buscar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 55px;
  padding: 6px 8px 6px 16px;
  background: #0b0c0a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #a9ae9f;
}
.chat-buscar.hidden {
  display: none;
}
.chat-buscar input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #171915;
  color: #f4f6ef;
  font: inherit;
  outline: none;
}
.chat-buscar-cuenta {
  flex: 0 0 auto;
  font-size: 12.5px;
}
.chat-buscar button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}
#chatMessages .is-oculto-busqueda {
  display: none !important;
}
.chat-buscar input::-webkit-search-cancel-button,
.cgi-filtro input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  display: none;
}
