/* Avatar Component - Cacao UI Framework */

.avatar {
    display: inline-block;
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #f8f9fa;
    border: 1px solid #e8e8e8;
    overflow: hidden;
    vertical-align: middle;
    transition: all 0.3s ease;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.avatar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 16px;
    color: #8B4513;
    background-color: rgba(139, 69, 19, 0.1);
}

/* Shape Variants */
.avatar.circle {
    border-radius: 50%;
}

.avatar.square {
    border-radius: 4px;
}

/* Size Variants */
.avatar.small {
    width: 24px;
    height: 24px;
}

.avatar.small .avatar-icon {
    font-size: 12px;
}

.avatar.medium {
    width: 32px;
    height: 32px;
}

.avatar.medium .avatar-icon {
    font-size: 16px;
}

.avatar.large {
    width: 48px;
    height: 48px;
}

.avatar.large .avatar-icon {
    font-size: 24px;
}

.avatar.xlarge {
    width: 64px;
    height: 64px;
}

.avatar.xlarge .avatar-icon {
    font-size: 32px;
}

/* Hover Effects */
.avatar:hover {
    border-color: #8B4513;
    transform: scale(1.05);
}

/* Focus States for Accessibility */
.avatar:focus {
    outline: 2px solid #8B4513;
    outline-offset: 2px;
}

/* Avatar Group Support */
.avatar-group {
    display: flex;
    align-items: center;
}

.avatar-group .avatar {
    margin-right: -8px;
    border: 2px solid #fff;
    position: relative;
    z-index: 1;
}

.avatar-group .avatar:hover {
    z-index: 2;
}

.avatar-group .avatar:last-child {
    margin-right: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .avatar.large {
        width: 40px;
        height: 40px;
    }
    
    .avatar.xlarge {
        width: 48px;
        height: 48px;
    }
}