/* Avatar.css - 전역 아바타 스타일 */

/* 기본 프로필 사진 스타일 */
.profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
    background-color: #f5f5f5;
    /* Base64 이미지 지원을 위한 추가 스타일 */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* 기본 이모지 아바타 스타일 */
.profile-emoji {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: inherit;
    font-weight: 500;
    color: inherit;
    background: inherit;
    border-radius: inherit;
}

/* 아바타 컨테이너 기본 스타일 */
.avatar-container {
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-secondary, #f5f5f5);
    color: var(--text-primary, #333);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 크기별 아바타 스타일 */
.avatar-small {
    width: 32px;
    height: 32px;
    font-size: 14px;
}

.avatar-medium {
    width: 48px;
    height: 48px;
    font-size: 18px;
}

.avatar-large {
    width: 64px;
    height: 64px;
    font-size: 24px;
}

.avatar-xlarge {
    width: 80px;
    height: 80px;
    font-size: 28px;
}

/* 기존 스타일과의 호환성 유지 */
.profile-avatar,
.friend-avatar,
.my-profile .profile-avatar {
    /* 기존 스타일 유지하되 새로운 avatar 클래스와 호환 */
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 메시지/댓글 아바타 호환성 */
.messages-conversation-avatar,
.messages-chat-avatar,
.comment-avatar,
.comment-author-avatar,
.like-user-avatar,
.message-avatar,
.post-author-avatar {
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary, #f5f5f5);
    color: var(--text-primary, #333);
}

/* 프로필 사진이 원형으로 표시되도록 보장 */
.profile-avatar .profile-photo,
.friend-avatar .profile-photo,
.messages-conversation-avatar .profile-photo,
.messages-chat-avatar .profile-photo,
.comment-avatar .profile-photo,
.comment-author-avatar .profile-photo,
.message-avatar .profile-photo,
.post-author-avatar .profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* 이모지가 중앙 정렬되도록 보장 */
.profile-avatar .profile-emoji,
.friend-avatar .profile-emoji,
.messages-conversation-avatar .profile-emoji,
.messages-chat-avatar .profile-emoji,
.comment-avatar .profile-emoji,
.comment-author-avatar .profile-emoji,
.message-avatar .profile-emoji,
.post-author-avatar .profile-emoji {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

/* 채팅 메시지 아바타 레이아웃 */
.message-with-avatar {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.message-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    font-size: 16px;
}

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

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.message-username {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary, #333);
}

.message-time {
    font-size: 12px;
    color: var(--text-secondary, #666);
}

/* 게시판 작성자 아바타 레이아웃 */
.post-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-author-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    font-size: 14px;
}

.author-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary, #333);
}

/* 댓글 아바타 레이아웃 개선 */
.comment-author-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-author-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    font-size: 14px;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    font-size: 16px;
}

/* 프로필 모달 아바타 섹션 */
.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 20px 0;
}

.profile-avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid #1428A0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    overflow: hidden;
}

.profile-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-preview .profile-emoji {
    font-size: 50px;
}

.profile-avatar-options {
    display: flex;
    gap: 10px;
}

/* 이모지 팔레트 */
.emoji-palette {
    width: 100%;
    max-width: 400px;
    margin-top: 10px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.emoji-option {
    font-size: 30px;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    text-align: center;
    transition: all 0.2s;
}

.emoji-option:hover {
    background: #1428A0;
    transform: scale(1.2);
}

.emoji-option.selected {
    background: #1428A0;
    box-shadow: 0 2px 5px rgba(20, 40, 160, 0.3);
}