/**
 * Groups Modern UI - Warm, inclusive, community-focused design
 * Community space aesthetic with social energy
 */

/* ============================================ */
/* GROUP PROFILE HEADER - Community Welcome Banner */
/* ============================================ */
.group-profile-header {
  background: var(--bg-primary);
  border-radius: 0;
  margin-bottom: 16px;
  padding: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.group-profile-cover {
  position: relative;
  width: 100%;
  height: 360px;
  background: linear-gradient(135deg, #06d6a0 0%, #0891b2 50%, #9333ea 100%);
  background-size: cover;
  background-position: center;
  border-radius: 0;
  overflow: hidden;
}

.group-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.25) 100%);
  z-index: 1;
  pointer-events: none;
}

.group-profile-info {
  position: relative;
  padding: 0 24px 20px 24px;
  margin-top: -70px;
  z-index: 10;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.group-avatar-section {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 18px;
}

.group-avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: linear-gradient(135deg, #06d6a0, #0891b2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3.8rem;
  font-weight: 700;
  border: 5px solid var(--bg-primary);
  box-shadow: 0 8px 28px rgba(0,0,0,0.2);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.group-avatar:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 36px rgba(6, 214, 160, 0.35);
  border-color: #06d6a0;
}

.group-title-section {
  flex: 1;
  padding-top: 45px;
  min-width: 0;
}

.group-title-section h1 {
  font-size: 2.1rem;
  font-weight: 700;
  margin: 0 0 10px 0;
  color: var(--text-primary);
  line-height: 1.2;
}

.group-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.group-privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: linear-gradient(135deg, rgba(6, 214, 160, 0.12), rgba(8, 145, 178, 0.12));
  border: 1px solid rgba(6, 214, 160, 0.4);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: #06d6a0;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
}

.group-privacy-badge::before {
  content: '🔒';
  font-size: 13px;
}

.group-privacy-badge[data-privacy="public"] {
  background: linear-gradient(135deg, rgba(6, 214, 160, 0.15), rgba(8, 145, 178, 0.15));
  border-color: rgba(6, 214, 160, 0.5);
}

.group-privacy-badge[data-privacy="public"]::before {
  content: '🌐';
}

.group-privacy-badge:hover {
  background: linear-gradient(135deg, rgba(6, 214, 160, 0.2), rgba(8, 145, 178, 0.2));
  transform: translateY(-1px);
}

.group-meta-sep {
  color: var(--border-primary);
  font-weight: 300;
}

.group-profile-desc {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0 0 18px 0;
  line-height: 1.6;
  max-width: 700px;
}

.group-quick-stats {
  display: flex;
  gap: 32px;
  padding: 18px 0;
  border-top: 2px solid var(--border-primary);
  border-bottom: 2px solid var(--border-primary);
  margin-bottom: 18px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.stat-item:hover {
  transform: translateY(-2px);
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  background: linear-gradient(135deg, #06d6a0, #0891b2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.group-profile-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============================================ */
/* MEMBER ROLE BADGES */
/* ============================================ */
.member-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.member-role-badge.admin {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #78350f;
}

.member-role-badge.moderator {
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  color: #1e3a8a;
}

.member-role-badge.member {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

/* ============================================ */
/* GROUP TABS NAVIGATION - Community Menu */
/* ============================================ */
.group-tabs-nav {
  background: var(--bg-primary);
  border-bottom: 2px solid var(--border-primary);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  max-width: 1100px;
  margin: 0 auto;
}

.group-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.group-tabs::-webkit-scrollbar {
  display: none;
}

.group-tabs .tab {
  padding: 16px 24px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  position: relative;
}

.group-tabs .tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, #06d6a0, #0891b2);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.group-tabs .tab:hover {
  background: rgba(6, 214, 160, 0.05);
  color: var(--text-primary);
}

.group-tabs .tab.active {
  color: #06d6a0;
  border-bottom-color: transparent;
}

.group-tabs .tab.active::after {
  width: 100%;
}

/* ============================================ */
/* GROUP MEMBERS LIST - Enhanced */
/* ============================================ */
.group-members-list {
  display: grid;
  gap: 0;
}

.group-member-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-primary);
  cursor: pointer;
  transition: background 0.2s;
}

.group-member-card:hover {
  background: var(--bg-secondary);
}

.group-member-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border-primary);
}

.group-member-info {
  flex: 1;
  min-width: 0;
}

.group-member-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.group-member-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.group-member-actions {
  display: flex;
  gap: 8px;
}

/* ============================================ */
/* ANNOUNCEMENTS BANNER */
/* ============================================ */
.group-announcements-banner {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #fbbf24;
  border-radius: 12px;
  padding: 16px 20px;
  margin: 16px 24px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.group-announcements-banner::before {
  content: '📢';
  font-size: 24px;
  flex-shrink: 0;
}

.announcement-content {
  flex: 1;
}

.announcement-content h4 {
  font-size: 15px;
  font-weight: 700;
  color: #78350f;
  margin: 0 0 4px 0;
}

.announcement-content p {
  font-size: 14px;
  color: #92400e;
  margin: 0;
  line-height: 1.5;
}

/* ============================================ */
/* GROUP ADMINS SIDEBAR */
/* ============================================ */
.group-admins-list {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.group-admins-list h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 12px 0;
  color: var(--text-primary);
}

.admin-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  cursor: pointer;
  transition: opacity 0.2s;
}

.admin-item:hover {
  opacity: 0.8;
}

.admin-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.admin-info {
  flex: 1;
  min-width: 0;
}

.admin-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.admin-role {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: capitalize;
}

/* ============================================ */
/* NEW MEMBERS WIDGET */
/* ============================================ */
.group-new-members {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 16px;
}

.group-new-members h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 12px 0;
  color: var(--text-primary);
}

.new-member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  cursor: pointer;
  transition: opacity 0.2s;
}

.new-member-item:hover {
  opacity: 0.8;
}

.new-member-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.new-member-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

/* ============================================ */
/* ACTIVITY INDICATORS */
/* ============================================ */
.activity-indicator {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background: #22c55e;
  border: 3px solid var(--bg-primary);
  border-radius: 50%;
  animation: pulse-activity 2s infinite;
}

@keyframes pulse-activity {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ============================================ */
/* GROUP POSTS FEED */
/* ============================================ */
.group-tab-content {
  background: var(--bg-primary);
}

.group-tab-content .posts-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px;
}

/* ============================================ */
/* MOBILE RESPONSIVE - Community on the Go */
/* ============================================ */
@media (max-width: 768px) {
  .group-profile-cover {
    height: 240px;
  }

  .group-avatar {
    width: 120px;
    height: 120px;
    font-size: 3rem;
    border-width: 4px;
  }

  .group-title-section {
    padding-top: 30px;
  }

  .group-title-section h1 {
    font-size: 1.6rem;
  }

  .group-profile-info {
    padding: 0 16px 16px 16px;
    margin-top: -50px;
  }

  .group-avatar-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .group-quick-stats {
    flex-wrap: wrap;
    gap: 16px;
  }

  .stat-value {
    font-size: 20px;
  }

  .group-tabs-nav {
    padding: 0 16px;
  }

  .group-tabs .tab {
    padding: 14px 18px;
    font-size: 14px;
  }

  .group-privacy-badge {
    padding: 5px 12px;
    font-size: 12px;
  }

  .group-member-card {
    padding: 12px 16px;
  }

  .group-announcements-banner {
    margin: 12px 16px;
    padding: 12px 16px;
    font-size: 14px;
  }

  .media-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .group-profile-cover {
    height: 200px;
  }

  .group-avatar {
    width: 100px;
    height: 100px;
    font-size: 2.5rem;
  }

  .group-title-section h1 {
    font-size: 1.4rem;
  }

  .group-profile-info {
    padding: 0 12px 12px 12px;
    margin-top: -40px;
  }

  .group-tabs .tab {
    padding: 12px 14px;
  }
}

/* ============================================ */
/* EMPTY STATES */
/* ============================================ */
.group-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.group-empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.group-empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--text-secondary);
}

.group-empty-state p {
  font-size: 14px;
  margin: 0 0 20px 0;
  color: var(--text-muted);
}

/* ============================================ */
/* MEDIA GALLERY */
/* ============================================ */
.media-gallery-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.media-gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-tertiary);
  transition: transform 0.2s, box-shadow 0.2s;
}

.media-gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.media-gallery-item img,
.media-gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-gallery-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-primary);
}

.media-gallery-header h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.media-gallery-header p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 8px 0 0 0;
}

/* ============================================ */
/* ACTIVITY FEED */
/* ============================================ */
.activity-feed-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-primary);
}

.activity-feed-header h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.activity-feed-header p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 8px 0 0 0;
}

.activity-feed-list {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: 12px;
  margin-bottom: 12px;
  transition: background 0.2s;
}

.activity-item:hover {
  background: var(--bg-tertiary);
}

/* ============================================ */
/* PINNED POST BADGE */
/* ============================================ */
.pinned-post-badge {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #78350f;
  padding: 8px 16px;
  border-radius: 12px 12px 0 0;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pinned-post-badge button {
  margin-left: auto;
  background: rgba(0, 0, 0, 0.2);
  border: none;
  color: #78350f;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.pinned-post-badge button:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* ============================================ */
/* LOADING SKELETONS */
/* ============================================ */
.group-skeleton {
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.group-skeleton-header {
  width: 100%;
  height: 320px;
  background: var(--bg-tertiary);
  border-radius: 0 0 16px 16px;
  margin-bottom: 80px;
}

.group-skeleton-avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  margin-top: -60px;
  margin-left: 24px;
  margin-bottom: 16px;
}

.group-skeleton-title {
  width: 300px;
  height: 32px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  margin: 0 24px 8px 24px;
}

.group-skeleton-meta {
  width: 200px;
  height: 20px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  margin: 0 24px 16px 24px;
}

/* ============================================ */
/* ENHANCED GROUP TAB CONTENT STYLING */
/* ============================================ */
.group-tab-contents {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

.group-tab-content {
  animation: fadeInGroupTab 0.25s ease;
}

@keyframes fadeInGroupTab {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Enhanced member cards */
.group-member-card {
  border-radius: 0;
  transition: background 0.15s, transform 0.1s;
}

.group-member-card:hover {
  background: var(--bg-secondary);
  transform: translateX(4px);
}

.group-member-card:first-child {
  border-radius: 12px 12px 0 0;
}

.group-member-card:last-child {
  border-radius: 0 0 12px 12px;
  border-bottom: none;
}

/* Group tabs flex alignment */
.group-tabs .tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.group-tabs .tab svg {
  flex-shrink: 0;
}

/* Enhanced sidebar cards */
.group-admins-list,
.group-new-members {
  border: 1px solid var(--border-primary);
  transition: box-shadow 0.2s;
}

.group-admins-list:hover,
.group-new-members:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

/* Group quick stats enhanced */
.stat-item {
  padding: 8px 0;
}

.stat-value {
  font-variant-numeric: tabular-nums;
}
