/* ===== THE HUB — Comunidad (perfiles + mensajería) ===== */

.community-main {
  min-height: calc(100vh - 64px);
  padding: 3rem 0 4rem;
}

/* ── Aviso "no configurado" ───────────────────────────────────── */
.community-notice {
  max-width: 640px;
  margin: 4rem auto;
  text-align: center;
}
.community-notice h1 { margin: 1rem 0 1rem; }
.community-notice p { margin: 0 auto; }
.community-notice code {
  background: var(--gray);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
  font-size: 0.9em;
}

/* ── Auth ─────────────────────────────────────────────────────── */
.community-auth {
  max-width: 460px;
  margin: 2rem auto;
}
.community-auth h1 { margin: 1.25rem 0 0.5rem; }
.community-auth > p { margin-bottom: 2rem; color: #555; }

.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #e0e4ea;
}
.auth-tab {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #999;
  padding: 0.75rem 0.25rem;
  margin-right: 1.5rem;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.auth-tab.active { color: var(--blue); border-color: var(--blue); }

.auth-form .btn { width: 100%; justify-content: center; }
.form-note {
  background: rgba(27,95,168,0.06);
  border: 1px solid rgba(27,95,168,0.2);
  color: var(--blue);
  border-radius: 10px;
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* ── Botón outline para fondos claros ────────────────────────────── */
.btn-outline-dark {
  background: transparent;
  color: var(--black);
  border: 1.5px solid #d6dbe2;
}
.btn-outline-dark:hover { background: var(--gray); }

/* ── App layout ───────────────────────────────────────────────── */
.community-app {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  align-items: stretch;
  min-height: 70vh;
}

.community-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  background: var(--gray);
  border-radius: var(--radius);
  padding: 1.5rem;
  overflow-y: auto;
}

.community-profile {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.community-profile-info { flex: 1; min-width: 0; }
.community-avatar {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
}
.community-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.community-section h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 0.75rem;
}
.community-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.community-section-head h4 { margin-bottom: 0; }
.community-empty {
  font-size: 0.82rem;
  color: #999;
}

/* ── Listas de conversaciones / miembros ─────────────────────────── */
.conversation-list,
.member-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.conversation-item,
.member-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--black);
  transition: background 0.15s;
}
.conversation-item:hover,
.member-item:hover { background: rgba(27,95,168,0.08); }
.conversation-item.active {
  background: var(--blue);
  color: var(--white);
}
.conversation-item .conv-icon {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(27,95,168,0.12);
  color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
}
.conversation-item.active .conv-icon {
  background: rgba(255,255,255,0.2);
  color: var(--white);
}
.conv-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-list-checkbox .member-item {
  cursor: pointer;
}
.member-list-checkbox input[type="checkbox"] {
  flex-shrink: 0;
}

/* ── Panel de chat ────────────────────────────────────────────── */
.community-chat {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid #e8ebef;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.community-chat-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #eef1f4;
}
.community-chat-header h3 { font-size: 1.1rem; }

.community-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-height: 320px;
}
.community-empty-chat {
  margin: auto;
  color: #999;
  font-size: 0.9rem;
  text-align: center;
}

.message-bubble {
  max-width: 70%;
  padding: 0.65rem 1rem;
  border-radius: 14px;
  background: var(--gray);
  font-size: 0.9rem;
  line-height: 1.5;
}
.message-bubble .message-meta {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--blue);
  margin-bottom: 0.2rem;
}
.message-bubble .message-time {
  display: block;
  font-size: 0.68rem;
  color: #aaa;
  margin-top: 0.25rem;
}
.message-bubble.own {
  align-self: flex-end;
  background: var(--blue);
  color: var(--white);
}
.message-bubble.own .message-meta { color: rgba(255,255,255,0.75); }
.message-bubble.own .message-time { color: rgba(255,255,255,0.6); }

.community-composer {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid #eef1f4;
}
.community-composer input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1.5px solid #e0e4ea;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s;
}
.community-composer input:focus { border-color: var(--blue); }

/* ── Modales ──────────────────────────────────────────────────── */
.community-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6,9,15,0.55);
  backdrop-filter: blur(4px);
  padding: 1rem;
}
.community-modal-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}
.community-modal-card h3 { margin-bottom: 1.25rem; }
.community-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .community-app {
    grid-template-columns: 1fr;
  }
  .community-sidebar { order: 2; }
  .community-chat { min-height: 60vh; }
}
