@import url('https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap');

:root {
    --purple-300: hsl(276, 100%, 81%);
    --purple-600: hsl(276, 55%, 52%);
    --purple-500: hsl(264, 100%, 61%);
    --purple-950: hsl(271, 36%, 24%);
    --pink-500: hsl(293, 100%, 63%);
    --pink-400: hsl(289, 100%, 72%);
    --gray-500: hsl(270, 7%, 64%);
    --gray-300: hsl(206, 6%, 79%);
    --gray-100: hsl(270, 20%, 96%);
    --white: hsl(0, 100%, 100%);
    --gradient: linear-gradient(225deg, hsl(293, 100%, 63%), hsl(264, 100%, 61%));

    --font-family: "Rubik", sans-serif;
    --font-size: 16px;
    --fw-regular: 400;
    --fw-semibold: 500;
    --fw-bold: 700;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family), sans-serif;
    display: flex;
    flex-direction: column;
    padding: 1em 0;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 650px;
    width: 100%;
    align-self: center;
}

.bg {
    background-image: var(--gradient);
    width: 300px;
    height: 500px;
    border-radius: 0 0 10em 10em;
    position: absolute;
    top: 0;
    z-index: -1;
}

h1 {
    margin: 1em 0;
    font-size: 48px;
    color: var(--purple-950);
}

h3, h4 {color: var(--white);}

p {color: var(--gray-500);}

.description {
    margin: 1em 1em 3em;
    text-align: center; }

.phone {
    background-color: #F5F3F8;
    max-width: 388px;
    display: flex;
    flex-direction: column;
    border: 1em solid var(--white);
    border-radius: 2em;
    box-shadow: 0 8px 8px #ddd;
    position: relative;
}

.phone::before {
    content: '';
    width: 50%;
    height: 25px;
    position: absolute;
    background-color: var(--white);
    top: 0;
    left: 50%;
    translate: -50% 0;
    border-radius: 0 0 1em 1em;
}

.message {
    padding: 1em;
    margin: 0.5em;
    width: fit-content;
    max-width: 70%;
    border-radius: 1em;
}

.message.images {
    padding: 0;
    display: grid;
    background-color: transparent;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5em;
    border-radius: 1em;
    overflow: hidden;
}

.message.images img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 0.5em;
}


.receiver {
    background-color: #EDE5F2;
    box-shadow: 0 2px 2px #F0EAF6;
    border-bottom-left-radius: 0.2em;
    align-self: flex-start;
}

.receiver p {color: var(--purple-600);}

.sender {
    background-color: var(--white);
    box-shadow: 0 2px 2px #E9E7EC;
    border-bottom-right-radius: 0.2em;
    align-self: flex-end;
    color: var(--gray-500);
}

.price {
    background-image: var(--gradient);
    box-shadow: 0 2px 2px #E9E7EC;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    width: 80%;
    position: relative;
}

.price p {color: white; }

.price::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid var(--purple-300);
    border-radius: 50%;
    margin-right: 0.5em;
}

.message h3 {margin-left: auto;}

.profile-bar {
    display: flex;
    align-items: center;
    padding: 2em 0 1em;
    border-radius: 1em 1em 0.5em 0.5em;
    background-image: var(--gradient);
}

.avatar {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 0.5em;
}

.avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--purple-300);
}

.profile {display: flex;}

.fa-less-than {
    margin-left: 1em;
    color: var(--white);
}

.fa-ellipsis-vertical {
    margin-left: auto;
    margin-right: 1em;
    color: var(--white);
}

.type-field {
    width: 90%;
    padding: 0.5em;
    border-radius: 2em;
    background-color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    align-self: center;
    margin-bottom: 0.5em;
}

.type {justify-self: flex-start;}

.send-button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    padding: 0.5em;
    border-radius: 50%;
    background-color: var(--purple-950);
    color: var(--white);
    border: none;
    outline: none;
}

.phone {margin: 0 1em; }


@media screen and (min-width: 768px) {
    main {
        flex-direction: row;
        justify-self: center;
        max-width: 1100px;
    }

    .description {
        margin: 0 0 0 3em;
        text-align: start;
        width: 460px;
    }

    .phone {
        max-width: none;
        width: 610px;
    }

    .attribution {margin-top: 3em; }
}