/* XeHello - Groups & Community Module Styling */

.xe-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
  animation: xeFadeIn 0.2s ease-out;
}

@keyframes xeFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.xe-modal-card {
  background: var(--bg-surface, #ffffff);
  color: var(--text-primary, #111111);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  width: 100%;
  max-width: 480px;
  overflow: hidden;
}

.xe-group-modal-card {
  max-width: 520px;
}

.xe-group-info-card {
  max-width: 460px;
}

.xe-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.xe-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.xe-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color, #e0e0e0);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.xe-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--text-muted, #777);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.xe-close-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-primary, #111);
}

.xe-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #555);
  margin-bottom: 6px;
}

.xe-input,
.xe-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color, #ccc);
  border-radius: 10px;
  background: var(--bg-input, #f9f9f9);
  color: var(--text-primary, #111);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.xe-input:focus,
.xe-select:focus {
  border-color: var(--primary, #0088cc);
  background: var(--bg-surface, #fff);
}

.xe-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-primary, #222);
  margin-bottom: 8px;
  cursor: pointer;
}

.xe-btn {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease-in-out;
}

.xe-btn-primary {
  background: var(--primary, #0088cc);
  color: #fff;
}
.xe-btn-primary:hover {
  background: var(--primary-dark, #0077b5);
}

.xe-btn-secondary {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-primary, #333);
}
.xe-btn-secondary:hover {
  background: rgba(0, 0, 0, 0.1);
}

.xe-btn-danger {
  background: #e53935;
  color: #fff;
}
.xe-btn-danger:hover {
  background: #d32f2f;
}

.xe-btn-danger-outline {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid #e53935;
  color: #e53935;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.xe-btn-danger-outline:hover {
  background: rgba(229, 57, 53, 0.08);
}

.xe-btn-link {
  background: none;
  border: none;
  color: var(--primary, #0088cc);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.xe-group-contact-check-badge {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-color, #ccc);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.xe-group-contact-check-badge.active {
  background: var(--primary, #0088cc);
  border-color: var(--primary, #0088cc);
}

.xe-selected-chips-bar {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 6px;
  padding: 6px 2px;
  margin-bottom: 8px;
  scrollbar-width: thin;
}

.xe-selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 136, 204, 0.12);
  border: 1px solid rgba(0, 136, 204, 0.25);
  border-radius: 16px;
  padding: 3px 8px 3px 4px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.xe-chip-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

.xe-chip-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.xe-chip-remove {
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  color: var(--text-muted, #777);
  margin-left: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}
.xe-chip-remove:hover {
  color: #e53935;
  background: rgba(229, 57, 53, 0.1);
}

.xe-group-contact-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 10px;
}

.xe-group-contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: background 0.15s;
}
.xe-group-contact-item:hover {
  background: rgba(0, 0, 0, 0.03);
}
.xe-group-contact-item.selected {
  background: rgba(0, 136, 204, 0.08);
}

.xe-group-contact-avatar,
.xe-group-member-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #0088cc;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 15px;
  overflow: hidden;
  flex-shrink: 0;
}
.xe-group-contact-avatar img,
.xe-group-member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.xe-group-contact-info,
.xe-group-member-info {
  flex: 1;
  min-width: 0;
}
.xe-group-contact-name,
.xe-group-member-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.xe-group-contact-sub,
.xe-group-member-sub {
  font-size: 12px;
  color: var(--text-muted, #777);
}

.xe-role-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.xe-role-badge.owner {
  background: #e3f2fd;
  color: #1565c0;
}
.xe-role-badge.admin {
  background: #e8f5e9;
  color: #2e7d32;
}
.xe-role-badge.mod {
  background: #fff3e0;
  color: #ef6c00;
}

.xe-group-profile-header {
  text-align: center;
  padding: 10px 0 18px;
}
.xe-group-large-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0088cc, #00bcd4);
  color: #fff;
  font-size: 32px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  box-shadow: 0 4px 16px rgba(0, 136, 204, 0.3);
  overflow: hidden;
}
.xe-group-large-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.xe-group-profile-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
}
.xe-group-profile-sub {
  font-size: 13px;
  color: var(--text-muted, #777);
}

.xe-group-quick-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}
.xe-quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.04);
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer;
  color: var(--primary, #0088cc);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s;
}
.xe-quick-btn:hover {
  background: rgba(0, 136, 204, 0.12);
  transform: translateY(-1px);
}

.xe-group-section-box {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border-color, #eee);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.xe-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary, #666);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.xe-section-text {
  font-size: 14px;
  line-height: 1.5;
}

.xe-group-members-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}
.xe-group-member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 6px;
  border-radius: 8px;
  transition: background 0.15s;
}
.xe-group-member-row:hover {
  background: rgba(0, 0, 0, 0.03);
}

.xe-icon-btn-sm {
  background: none;
  border: none;
  color: var(--text-muted, #888);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
}
.xe-icon-btn-sm:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-primary, #111);
}

.xe-invite-box {
  display: flex;
  gap: 8px;
  align-items: center;
}
.xe-invite-box input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: #f7f7f7;
  font-size: 13px;
}

.xe-group-danger-zone {
  margin-top: 10px;
}
