@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

body {
    font-family: "Poppins", sans-serif;
    background-color: #f4f4f9;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    height: 100dvh;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.chat__header {
    display: flex;
    flex-direction: row;
    gap: 1rem;
}

.logo__riccia {
    max-width: 50px;
    aspect-ratio: auto;
    object-fit: contain;
}

.header__title {
    font-size: 3rem;
    font-weight: bold;
    color: #E92177;
    text-align: center;
    box-sizing: border-box;
}

.chat {
    max-width: 50rem;
    width: 100%;
    background-color: white;
    border-radius: 1rem;
    box-shadow: 0 0.5px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat__header {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: linear-gradient(to right, #EA218E, #fe56bb);
    color: white;

    & h1,
    h2 {
        margin: 0;
        padding: 0 1rem;
    }

    & h1 {
        font-size: 1.5rem;
        font-weight: 600;
    }

    & h2 {
        font-size: 1rem;
        font-weight: 400;
    }
}

.chat__messages {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    gap: 1rem;
    height: 20rem;
    padding: 1rem;
    border-radius: 0.8rem;
    scroll-behavior: smooth;
}

.chat__message {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.7rem;
    max-width: 100%;
    font-size: 1rem;
    border-radius: 1rem;
    word-wrap: break-word;
    white-space: normal;
}

.chat__message--user {
    align-self: flex-end;
    background: linear-gradient(to right, #EA218E, #fe56bb);
    text-align: right;
    justify-content: flex-end;
    color: white;
    max-width: 75%;
    align-items: flex-end;
}

.chat__message--bot {
    align-self: flex-start;
    background: linear-gradient(to right, #eeeeee, #e3e3e3);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: left;
    justify-content: flex-start;
    color: #333;
    max-width: 85%;
}

.chat__input-group {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    padding: 0.3rem 1rem;
}

.chat__input {
    box-sizing: border-box;
    width: 100%;
    outline: none;
    border: 1px solid #ffa2ca;
    font-size: 1rem;
    border-radius: 45px;
    padding: 0.2rem 1rem;
    transition: all 300ms ease-in-out;
}

.chat__input:focus {
    border-color: #E92177;
    box-shadow: 0 0 5px #E92177;
}

.chat__button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #E92177;
    color: white;
    padding: 1rem;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    outline: none;
    transition: all 300ms ease;
}

.chat__image {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 0.75rem;
    margin-top: 0.5rem;
}


.loader {
    width: 60px;
    aspect-ratio: 2;
    --_g: no-repeat radial-gradient(circle closest-side, #000 90%, #0000);
    background: var(--_g) 0% 50%, var(--_g) 50% 50%, var(--_g) 100% 50%;
    background-size: calc(100%/3) 50%;
    animation: l3 1s infinite linear;
}

@keyframes l3 {
    20% { background-position: 0% 0%, 50% 50%, 100% 50% }

    40% { background-position: 0% 100%, 50% 0%, 100% 50% }

    60% { background-position: 0% 50%, 50% 100%, 100% 0% }

    80% { background-position: 0% 50%, 50% 50%, 100% 100% }
}

@media (max-width: 500px) {
    body {
        padding: 0.75rem;
    }

    .chat {
        max-width: 100%;
    }

    .chat__message--user,
    .chat__message--bot {
        max-width: 100%;
    }

    .chat__input-group {
        padding: .5rem;
        gap: .5rem;
    }

    .chat__button {
        padding: .5rem;
    }

    .chat__header h1 {
        font-size: 1.25rem;
    }

    .chat__header h2 {
        font-size: 0.875rem;
    }
}