.chatWrapper {
    padding: 1rem !important;

    @media (width >=70rem) {
        max-width: 60rem !important;
    }
}


.chatAppRow {
    display: flex;
    flex-direction: column;
    width: 100%;

    .centered {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 1rem;
        text-align: center;

        p {
            margin-bottom: 0;
        }
    }
}

.chatAppResults {
    display: flex;
    flex-flow: column nowrap;
    gap: 1rem;
    height: auto;
    max-height: 25rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--pink) transparent;
    padding: 1rem;
    margin-bottom: 1rem;
    position: relative;

    @media (width >=1200px) {
        max-height: 30rem;
    }
}

.chatMessage {
    display: flex;
    flex-flow: row nowrap;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--pink);
    border: 1px solid var(--cherry);
    border-radius: 0.5rem;
    width: calc(95% - 0.5rem);
    height: auto;
    position: relative;

    @media (width >=768px) {
        width: calc(60% - 0.5rem);
    }

    .chatMessageContainer {
        display: flex;
        flex-direction: column;
        text-align: left;
        width: 100%;
    }

    .chatAvatar {
        flex-shrink: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 1rem;
        height: 1rem;
        border-radius: 50%;
        background: var(--cherry);
        color: var(--light);
        font-weight: 700;
        margin-top: 0.25rem;
        font-size: 50%;

        @media (width >=768px) {
            width: 2rem;
            height: 2rem;
            margin-top: 0.25rem;
            font-size: 1rem;
        }
    }

    .chatMessageHeader {
        display: flex;
        align-items: center;
        font-size: 0.75rem;
        margin-top: 0.15rem;

        @media (width >=768px) {
            margin-top: 0.5rem;
            font-size: 0.875rem;
        }
    }

    .chatMessageBody {
        font-size: 0.75rem;
        line-height: 133.33%;
        font-weight: 500;
        max-height: 25rem;
        overflow-y: auto;
        scrollbar-width: thin;
        padding-right: 0.5rem;

        @media (width >=768px) {
            font-size: 0.875rem;
            line-height: 150%;
        }

        p {
            margin-bottom: 0;
        }
    }

    .chatDeleteBtn {
        all: unset;
        color: inherit;
        padding: 0.33rem;
        cursor: pointer;
        position: absolute;
        z-index: 1;
        top: 1%;
        right: 1%;
        font-size: 0.75rem;

        @media (width >=768px) {
            font-size: 0.875rem;
            padding: 0.5rem;
            top: 0.25rem;
            right: 0.25rem;
        }
    }

    .chatTimestamp {
        display: flex;
        font-size: 0.6rem;
        text-align: right;
        align-self: flex-end;
        opacity: 0.75;
        margin-top: 0.33rem;

        span {
            color: inherit;
            text-align: inherit;
        }

        @media (width >=768px) {
            font-size: 0.7rem;
            margin-top: 0.5rem;
        }
    }

    &.currentUser {
        background: var(--cherry);
        color: var(--light);
        align-self: flex-end;

        .chatAvatar {
            background: var(--light);
            color: var(--cherry);
        }
    }
}

.chatAppPost {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;

    .chatAppFormInput {
        display: flex;
        flex-direction: column;
        gap: 0.33rem;
        padding: 1rem;
        border: 1px solid rgba(0, 0, 0, 0.1);
        border-radius: 1rem;
        width: 100%;
        transition: all 0.15s ease-in-out;

        label {
            font-size: 0.75rem;
            font-weight: 600;
            opacity: 0.75;
        }

        textarea {
            font-size: 0.875rem;
            outline: none;
            border: none;
            padding: 0;
            width: 100%;
        }

        &:focus-within {
            border-color: var(--cherry);
        }
    }
}

.chatAppFormFooter {
    button {
        border-radius: 2rem;
        border-color: var(--cherry);

        &:hover {
            background: transparent;
            color: var(--cherry);
        }
    }
}

.isLoading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 1rem;
    position: absolute;
    z-index: 10;
    inset: 0;
    margin: auto;
    width: 100%;
    background: #fff;

    .spinner {
        width: 2.5rem;
        height: 2.5rem;
        border: 4px solid rgba(0, 0, 0, 0.1);
        border-left-color: var(--cherry, #000);
        border-radius: 50%;
        animation: spinner 1s linear infinite;
    }

    p {
        margin: 0;
        color: var(--dark, #333);
        font-size: 0.9rem;
    }

}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}