/* Group Chat Component Styles - Following SOLIUS Design System */
/* Cookbook Pattern: Domain-specific CSS for group chat functionality */

/* ===== GROUPS CONTENT STYLES ===== */

.chat-groups-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #00091E 0%, rgba(85, 93, 255, 0.03) 100%);
}

.public-groups-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 16px;
  gap: 16px;
}

.public-groups-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.public-groups-header .section-icon {
  font-size: 20px;
  color: #555DFF;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(85, 93, 255, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(85, 93, 255, 0.2);
}

.public-groups-header .section-title {
  font-size: 16px;
  font-weight: 600;
  color: #FFFFFF;
  font-family: 'Archivo', sans-serif;
  margin: 0;
}

.public-groups-header .section-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-family: 'Archivo', sans-serif;
  margin: 0;
  font-weight: 400;
}

.public-groups-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding-right: 4px;
}

/* Custom scrollbar for groups list */
.public-groups-list::-webkit-scrollbar {
  width: 6px;
}

.public-groups-list::-webkit-scrollbar-track {
  background: rgba(85, 93, 255, 0.1);
  border-radius: 3px;
}

.public-groups-list::-webkit-scrollbar-thumb {
  background: rgba(85, 93, 255, 0.3);
  border-radius: 3px;
}

.public-groups-list::-webkit-scrollbar-thumb:hover {
  background: rgba(85, 93, 255, 0.5);
}

.public-group-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(85, 93, 255, 0.05) 0%, rgba(85, 93, 255, 0.02) 100%);
  border: 1px solid rgba(85, 93, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.public-group-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(85, 93, 255, 0.3), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.public-group-item:hover {
  background: linear-gradient(135deg, rgba(85, 93, 255, 0.08) 0%, rgba(85, 93, 255, 0.04) 100%);
  border-color: rgba(85, 93, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(85, 93, 255, 0.15);
}

.public-group-item:hover::before {
  opacity: 1;
}

.public-group-item:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(85, 93, 255, 0.1);
}

.group-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #555DFF 0%, #00091E 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(85, 93, 255, 0.2);
  flex-shrink: 0;
  position: relative;
}

.group-avatar::after {
  content: '🌐';
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: #00091E;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  border: 2px solid rgba(85, 93, 255, 0.3);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.group-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.group-name {
  font-weight: 600;
  font-size: 16px;
  color: #FFFFFF;
  font-family: 'Archivo', sans-serif;
  margin: 0;
  word-break: break-word;
  line-height: 1.2;
}

.group-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.group-members {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-family: 'Archivo', sans-serif;
  font-weight: 500;
  background: rgba(85, 93, 255, 0.1);
  padding: 2px 8px;
  border-radius: 8px;
  border: 1px solid rgba(85, 93, 255, 0.2);
}

.group-description {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  font-family: 'Archivo', sans-serif;
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.group-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.group-join-btn {
  padding: 8px 16px;
  background: linear-gradient(135deg, #555DFF 0%, #444DEE 100%);
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Archivo', sans-serif;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(85, 93, 255, 0.3);
  display: flex;
  align-items: center;
  gap: 6px;
}

.group-join-btn:hover {
  background: linear-gradient(135deg, #444DEE 0%, #333CCC 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(85, 93, 255, 0.4);
}

.group-join-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(85, 93, 255, 0.3);
}

.group-join-btn:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.4);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.group-join-btn i {
  font-size: 12px;
}

.group-status {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  font-family: 'Archivo', sans-serif;
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.group-status.joined {
  background: rgba(0, 184, 148, 0.1);
  color: #00B894;
  border: 1px solid rgba(0, 184, 148, 0.3);
}

.group-status.pending {
  background: rgba(255, 167, 38, 0.1);
  color: #FFA726;
  border: 1px solid rgba(255, 167, 38, 0.3);
}

.group-status.failed {
  background: rgba(255, 85, 88, 0.1);
  color: #FF5558;
  border: 1px solid rgba(255, 85, 88, 0.3);
}

.loading-groups {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  color: rgba(255, 255, 255, 0.6);
  font-family: 'Archivo', sans-serif;
  font-size: 14px;
  gap: 12px;
}

.loading-groups i {
  animation: spin 1s linear infinite;
  font-size: 16px;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.empty-groups {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
}

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

.empty-groups .empty-title {
  font-size: 16px;
  font-weight: 600;
  color: #FFFFFF;
  font-family: 'Archivo', sans-serif;
  margin-bottom: 8px;
}

.empty-groups .empty-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  font-family: 'Archivo', sans-serif;
  max-width: 280px;
  line-height: 1.4;
}

/* ===== RESPONSIVE DESIGN FOR GROUPS ===== */

@media (max-width: 768px) {
  .chat-groups-content {
    padding: 8px;
  }

  .public-groups-section {
    padding: 12px;
    gap: 12px;
  }

  .public-groups-header {
    margin-bottom: 4px;
  }

  .public-groups-header .section-icon {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }

  .public-groups-header .section-title {
    font-size: 15px;
  }

  .public-groups-header .section-subtitle {
    font-size: 11px;
  }

  .public-group-item {
    padding: 12px;
    gap: 10px;
  }

  .group-avatar {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .group-avatar::after {
    width: 16px;
    height: 16px;
    font-size: 8px;
    top: -3px;
    right: -3px;
  }

  .group-name {
    font-size: 15px;
  }

  .group-members {
    font-size: 11px;
    padding: 2px 6px;
  }

  .group-description {
    font-size: 12px;
  }

  .group-join-btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .group-status {
    font-size: 10px;
    padding: 3px 6px;
  }

  .loading-groups,
  .empty-groups {
    padding: 32px 12px;
  }

  .empty-groups .empty-icon {
    font-size: 40px;
  }

  .empty-groups .empty-title {
    font-size: 15px;
  }

  .empty-groups .empty-subtitle {
    font-size: 13px;
    max-width: 240px;
  }
}

/* ===== ANIMATIONS FOR GROUPS ===== */

.public-group-item {
  animation: fadeInUp 0.4s ease-out forwards;
  opacity: 0;
  transform: translateY(10px);
}

.public-group-item:nth-child(1) { animation-delay: 0.05s; }
.public-group-item:nth-child(2) { animation-delay: 0.1s; }
.public-group-item:nth-child(3) { animation-delay: 0.15s; }
.public-group-item:nth-child(4) { animation-delay: 0.2s; }
.public-group-item:nth-child(5) { animation-delay: 0.25s; }
.public-group-item:nth-child(6) { animation-delay: 0.3s; }
.public-group-item:nth-child(7) { animation-delay: 0.35s; }
.public-group-item:nth-child(8) { animation-delay: 0.4s; }
.public-group-item:nth-child(9) { animation-delay: 0.45s; }
.public-group-item:nth-child(10) { animation-delay: 0.5s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== ACCESSIBILITY FOR GROUPS ===== */

.public-group-item:focus {
  outline: 2px solid #555DFF;
  outline-offset: 2px;
}

.group-join-btn:focus {
  outline: 2px solid #FFFFFF;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .public-group-item {
    animation: none;
  }

  .public-group-item:hover {
    transform: none;
  }

  .group-join-btn:hover {
    transform: none;
  }
}
