@component: Twilio-ChatItem;

.@{component} {
    flex: 1 1 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: 0px;
    margin-top: 20px;
    overflow: hidden;
}

.@{component}.@{component}-GroupWithPrevious {
    margin-top: 4px;
    .@{component}-Avatar {
        display: none;
    }
}


.@{component}-fromMe {
    //justify-content: space-between;

    .@{component}-ContentContainer {
        justify-content: space-between;
    }

    .@{component}-BubbleContainer {
        margin-left: 32px;
    }

    .@{component}-Spike {
        align-self: flex-end;
    }

    .@{component}-Avatar {
        display: none;
    }
}

.@{component}-fromOthers{

    .@{component}-BubbleContainer {
        margin-left: 0px;
        margin-right: 44px;
    }
}

.@{component}-ContentContainer{
    display: flex;
}

.@{component}-ReadStatus {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;

    span {
        font-size: 10px;
        margin-right: 4px
    }
}

.@{component}-AvatarContainer {
    flex: 0 0 48px;
    font-size: 18px;
    vertical-align: top;
    display: flex;
}

.@{component}-Avatar {
    text-align: center;
    width: 36px;
    height: 36px;
    margin-right: 12px;
    border-radius: 18px;
    overflow: hidden;

    svg {
        margin-top: 8px;
    }

    img {
        width: 36px;
        height: 36px;
    }
}

.@{component}-AvatarLine {
    width: 4px;
    flex: 1 1 auto;
    margin-left: 12px;
    margin-right: 0px;
}

.@{component}-MessageContainer {
    overflow-x: hidden;
}

.@{component}-BubbleContainer {
    display: flex;
    flex-direction: column;
    max-width: 440px;
    min-width: 100px;
    overflow-x: hidden;

    p {
        margin: 0;
    }
}

.@{component}-Bubble {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    border-radius: 4px;
    overflow-x: hidden;
    padding-left: 12px;
    padding-right: 12px;
    padding-top: 5px;
    padding-bottom: 8px;
}

.@{component}-Header {
    display: flex;
    justify-content: space-between;

    p {
        font-size: 10px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

.@{component}-UserName {
    flex: 0 1 auto;
    margin-right: 8px;
    overflow: hidden;

    p {
        font-size: 10px;
        font-weight: bold;
    }
}

.@{component}-Time {
    flex: 0 0 auto;
    text-align: right;

    p {
        font-size: 10px;
    }
}

.@{component}-Body {
    margin-top: 3px;

    p {
        font-size: 13px;
        line-height: 1.54;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    a {
        color: inherit;
        text-decoration: initial;
    }

    a:hover{
        text-decoration: underline;
    }
}

/// Config options
.Twilio {

    // Square bubbles
    .@{component}.@{component}-Squared {
        margin-top: 12px; //20 regular minus 8px for the spike

        .@{component}-Avatar {
            border-radius: 0px;
        }

        .@{component}-Bubble {
            border-radius: 0px;
        }
    }

    .@{component}.@{component}-Squared.@{component}-GroupWithPrevious {
        margin-top: 4px;
    }

    // Minimal bubbles
    .@{component}.@{component}-Minimal {
        margin-top: 24px;

        .@{component}-ContentContainer{
            justify-content: flex-start;
        }

        .@{component}-AvatarContainer {
            flex: 0 0 auto;
        }

        .@{component}-Header {
            justify-content: flex-start;
            margin-top: 0px;
        }

        .@{component}-UserName{
            font-weight: 600;
        }

        .@{component}-BubbleContainer{
            margin-left: 0px;
            margin-right: 8px;
        }

        .@{component}-Bubble
        {
            background-color: transparent;
            padding-top: 0px;
            padding-bottom: 0px;
        }

        .@{component}-Body {
            margin-top: 2px;
            margin-left: 0px;
            margin-bottom: 0px;
            margin-right: 17px;
        }

    }
}