/* ========================================
   USER AVATARS
   ======================================== */

/* Avatar Base */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, #1DB954 0%, #1ed760 100%);
  border: 2px solid transparent;
  box-shadow: 0 0 0 2px rgba(29, 185, 84, 0.3);
  flex-shrink: 0;
}

.avatar.large {
  width: 64px;
  height: 64px;
  border-width: 3px;
}

.avatar.small {
  width: 24px;
  height: 24px;
  border-width: 1px;
}

.avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: #000;
  text-transform: uppercase;
}

.avatar-placeholder.large {
  font-size: 1.5rem;
}

.avatar-placeholder.small {
  font-size: 0.6rem;
}

/* User List in Room */
.room-users {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.03);
  border-top: 1px solid rgba(255,255,255,0.05);
  max-height: 100px;
  overflow-y: auto;
}

.room-users:empty::before {
  content: 'No users in room';
  color: var(--text-tertiary);
  font-size: 0.85rem;
  font-style: italic;
}

.room-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
}

.room-user .avatar {
  width: 24px;
  height: 24px;
}

.room-user.you {
  background: rgba(29, 185, 84, 0.15);
}

/* Chat Messages */
.chat-msg {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.chat-msg .avatar {
  margin-top: 2px;
}

.chat-content {
  flex: 1;
  min-width: 0;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.chat-from {
  font-weight: 600;
  color: var(--accent);
}

.chat-time {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* Profile Section */
.profile-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--bg-glass);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}

.profile-info h3 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}

.profile-info p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Avatar Upload */
.avatar-upload {
  position: relative;
  cursor: pointer;
}

.avatar-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.avatar-upload-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.avatar-upload:hover .avatar-upload-overlay {
  opacity: 1;
}

.avatar-upload-overlay span {
  font-size: 0.7rem;
  color: white;
  text-align: center;
}

/* User Menu */
.user-menu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.user-menu:hover {
  background: rgba(255,255,255,0.1);
}

.user-menu .username {
  font-size: 0.9rem;
  font-weight: 500;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Guest Indicator */
.guest-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-full);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Mobile Adjustments */
@media only screen and (max-width: 768px) {
  .avatar {
    width: 28px;
    height: 28px;
  }
  
  .avatar.large {
    width: 48px;
    height: 48px;
  }
  
  .room-users {
    padding: 0.5rem;
  }
  
  .user-menu .username {
    display: none;
  }
}
