/* 사이드바 공통 스타일 - 활동 중인 멤버, 실시간 채팅, 접속자 통계 */

/* 활동 중인 멤버 - 멤버 아이템 */
.member-item {
    display: flex;
    align-items: center;
    padding: 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.member-item:last-child {
    border-bottom: none;
}

.member-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 0.8rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
    flex-shrink: 0;
}

.member-name {
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    margin-left: 0.5rem;
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

.visitor-item {
    opacity: 0.8;
}

.visitor-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f59e0b;
    margin-left: 0.5rem;
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

/* 실시간 채팅 스타일 */
.chat-messages {
    display: flex;
    flex-direction: column;
    min-height: 300px;
    max-height: 350px;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    padding-right: 5px;
}

.chat-messages::after {
    content: '';
    flex: 1;
    min-height: 1px;
}

.chat-message {
    display: flex;
    margin-bottom: 8px;
    align-items: flex-start;
    width: 100%;
}

/* 메시지 아바타 */
.message-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 3px;
    flex-shrink: 0;
    font-size: 10px;
    color: white;
    font-weight: bold;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

/* 메시지 콘텐츠 */
.message-content {
    flex: 1;
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e1e5e9;
    min-width: 0;
    overflow: hidden;
    max-width: calc(100% - 25px);
    width: calc(100% - 25px);
}

/* 메시지 헤더 스타일 */
.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    min-width: 0;
}

.message-username {
    font-weight: 600;
    font-size: 12px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

/* 채팅 사용자 교대 색상 */
.message-username.speaker-a {
    background-color: rgba(102, 126, 234, 0.15);
    color: #3f51b5;
}

.message-username.speaker-b {
    background-color: rgba(118, 75, 162, 0.15);
    color: #6a1b9a;
}

.message-time {
    font-size: 10px;
    color: #999;
    white-space: nowrap;
    margin-left: 8px;
    flex-shrink: 0;
}

.message-text {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* 접속자 통계 - 상세 분석 보기 링크 */
.visitor-stats-actions {
    margin-top: 1rem;
    text-align: center;
}

.admin-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.admin-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    color: white;
    text-decoration: none;
}

.admin-link i {
    font-size: 1rem;
}

/* 로딩 및 빈 상태 */
.loading-members,
.no-members {
    color: white;
    text-align: center;
    padding: 2rem;
    font-size: 0.9rem;
}

.loading-members i {
    margin-right: 0.5rem;
}

.chat-loading {
    color: #999;
    text-align: center;
    padding: 2rem;
    font-size: 0.9rem;
}

/* 애니메이션 */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
