/* Who's Online Modal Styles */

/* Modal Overlay */
.who-is-online-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

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

/* Modal Container */
.who-is-online-modal {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

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

/* Modal Header */
.who-is-online-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.who-is-online-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Online Indicator (pulse) */
.online-indicator {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  background-color: #10b981;
  border-radius: 50%;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

.who-is-online-close {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.375rem;
  transition: background-color 0.2s, color 0.2s;
}

.who-is-online-close:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.who-is-online-close svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* Modal Content */
.who-is-online-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

/* Count Section */
.who-is-online-count {
  padding: 0.75rem 1rem;
  background-color: #dbeafe;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  text-align: center;
  color: #1e40af;
  font-size: 0.875rem;
}

.who-is-online-count strong {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0.25rem;
}

/* User List */
.who-is-online-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* User Item */
.who-is-online-user {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background-color: #f9fafb;
  transition: background-color 0.2s;
}

.who-is-online-user:hover {
  background-color: #f3f4f6;
}

/* Avatar */
.user-avatar-container {
  position: relative;
  flex-shrink: 0;
}

.user-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
}

.online-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0.875rem;
  height: 0.875rem;
  background-color: #10b981;
  border: 2px solid white;
  border-radius: 50%;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* User Info */
.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-weight: 600;
  color: #111827;
  font-size: 0.875rem;
  margin-bottom: 0.125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.user-role.owner {
  background-color: #f3e8ff;
  color: #6b21a8;
}

.user-role.moderator {
  background-color: #dbeafe;
  color: #1e40af;
}

.user-role.member {
  background-color: #f3f4f6;
  color: #374151;
}

.user-bio {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-status {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 0.25rem;
}

/* User Actions */
.user-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
  background-color: white;
  border: 1px solid #d1d5db;
  color: #6b7280;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
  text-decoration: none;
}

.btn-icon:hover {
  background-color: #f9fafb;
  color: #3b82f6;
  border-color: #3b82f6;
}

.btn-icon.btn-call {
  color: #0f766e;
  border-color: #99f6e4;
  background-color: #ccfbf1;
}

.btn-icon.btn-call:hover {
  background-color: #5eead4;
  color: #0f766e;
  border-color: #0f766e;
}

.btn-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Loading State */
.who-is-online-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  gap: 1rem;
}

.spinner {
  width: 3rem;
  height: 3rem;
  border: 3px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.who-is-online-loading p {
  color: #6b7280;
  font-size: 0.875rem;
}

/* Error State */
.who-is-online-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  gap: 1rem;
  text-align: center;
}

.error-icon {
  width: 3rem;
  height: 3rem;
  color: #ef4444;
}

.who-is-online-error p {
  color: #6b7280;
  font-size: 0.875rem;
}

/* Empty State */
.who-is-online-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  gap: 1rem;
  text-align: center;
}

.empty-icon {
  width: 4rem;
  height: 4rem;
  color: #9ca3af;
}

.who-is-online-empty p {
  color: #6b7280;
  font-size: 0.875rem;
}

/* Footer */
.who-is-online-footer {
  padding-top: 1rem;
  text-align: center;
  border-top: 1px solid #e5e7eb;
  margin-top: 1rem;
}

.who-is-online-footer small {
  color: #9ca3af;
  font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 640px) {
  .who-is-online-modal {
    max-height: 90vh;
    margin: 0.5rem;
  }

  .who-is-online-header {
    padding: 1rem;
  }

  .who-is-online-content {
    padding: 1rem;
  }

  .who-is-online-user {
    flex-wrap: wrap;
  }

  .user-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 0.5rem;
  }
}

/* Utility classes */
.w-5 { width: 1.25rem; }
.h-5 { height: 1.25rem; }
.w-6 { width: 1.5rem; }
.h-6 { height: 1.5rem; }
