@import './base.css';

body {
        width: 100%;
        height: 100%;
        position: relative;
        display: grid;
        place-items: center;
}
.container {
        display: grid;
        grid-template-columns: .8fr 1fr;
        place-items: center;
        position: relative;
}
.main-text {
        font-size: clamp(1.5rem, 2vw, 2rem);
        font-weight: 700;
        place-self: start;
        align-self: center;
        color: var(--very-dark-violet);
        text-align: left;
        margin-bottom: 1.5rem;
        max-width: 20em;
}
h1 {
        margin-bottom: 2rem;
}
h3 {
        font-size: clamp(.8rem, .8vw, 2rem);
        font-weight: 700;
}
.main-text p {
        font-size: clamp(1rem, 2.3vw, 1.10rem);
        font-weight: 400;
        line-height: 1.7;
        color: var(--dark-grayish-violet);
}


.app {
        display: flex;
        flex-direction: column;
        align-items: center;
        place-self: start;
        overflow: hidden;
        aspect-ratio: 1/2;
        max-width: 380px;
        justify-content: start;
        border: 13px solid white;
        border-radius: 3rem;
        background-color: var(--light-grayish-violet);
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        position: relative;
        z-index: 1;
}
.dock {
        margin: 0 auto;
        width: 50%;
        border-radius: 0 0 1rem 1rem;
        height: 20%;
        background-color: white;
}

.appHeader {
        width: 100%;
        height: 13%;
        background-image: var(--mag-vio-gradient-l);
        border-radius: .7rem;
}
.personProfile {
        position: relative;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: start;
        width: 100%;
        color: white;
        padding-inline: 5%;
        gap: 3%;
        margin-top: 3%;
}
.personProfile img {
        width: 13%;
        aspect-ratio: 1/1;
        border: 2px solid white;
        object-fit: cover;
        border-radius: 50%;
}
.personProfile p {
        color: var(--pale-violet);
        font-size: clamp(.5rem, .7vw, 1rem);
}

.dots {
        position: absolute;
        right: 5%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: .2rem;
        margin-top: .3rem;
}
.dots .dot {
        width: 0.2rem;
        aspect-ratio: 1/1;
        border-radius: 50%;
        background-color: var(--light-grayish-violet);
}
.messages {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: 1rem;
        padding-top: 0;
        width: 100%;
}

.leftMessage {
        display: grid;
        place-items: center;
        padding: 1rem;
        background-color: var(--moderate-violet-pale);
        max-width: 80%;
        margin-top: 1rem;
        border-radius: 1rem 1rem 1rem .3rem;
}
.leftMessage:has(input) {
        background-image: var(--mag-vio-gradient-r);
        display: flex;
        max-width: 85%;
        flex-direction: row;
        justify-content: start;
        align-items: center;
        gap: .7rem;
}
.leftMessage:has(input) p, span{
        color: white;
        width: 40%;
}
.leftMessage:has(input) span{
        font-weight: 700;
        text-align: right;
}
.leftMessage:has(input) input{
        all: unset;
        transition: all .2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        width: 12px;
        height: 12px;
        border: 2px solid var(--very-light-magenta);
        border-radius: 50%;
        background-color: transparent;
}
.leftMessage:has(input) input:checked{
        background-color: var(--moderate-violet);
        border: 2px solid var(--very-light-magenta);

}
.leftMessage p {
        color: var(--moderate-violet);
        font-size: clamp(.5rem, .6vw, 1rem);
}



.rightMessage {
        place-self: end;
        display: flex;
        flex-direction: row;
        padding: 1rem;
        background-color: white;
        width: fit-content;
        max-width: 80%;
        margin-top: 1rem;
        border-radius: 1rem 1rem .3rem 1rem;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.rightMessage:has(img){
        width: fit-content;
        gap: .7rem;
        padding-top: 0;
        padding-right: 0;
        padding-bottom: 0;
        background-color: transparent;
        justify-content: end;
        box-shadow: 0 0 0px rgba(0, 0, 0, 0.1);
}
.rightMessage:has(img) img{
        width: 55px;
        border-radius: 20%;
}
.rightMessage p {
        color: var(--dark-violet);
        font-size: clamp(.5rem, .6vw, 1rem);
}

@keyframes slideIn {
        0% {
                opacity: 0;
                transform: translateX(-100%);
        }
        100% {
                opacity: 1;
                transform: translateX(0);
        }
}
@keyframes slideIn-r {
        0% {
                opacity: 0;
                transform: translateX(100%);
        }
        100% {
                opacity: 1;
                transform: translateX(0);
        }
}

.leftMessage {
        animation: slideIn 0.5s ease-in-out forwards;
        opacity: 0;
}
.rightMessage {
        animation: slideIn-r 0.5s ease-in-out forwards;
        opacity: 0;
}



.inputMessage  {
        width: 90%;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: .5rem;
        background-color: white;
        border-radius: 2rem;
}
.inputMessage input {
        width: 100%;
        border: none;
        padding-left: .8rem;
        font-size: clamp(.5rem, .6vw, 1rem);
        font-family: inherit;
}
input:focus {
        outline: none;
}
.inputMessage button {
        all: unset;
        width: 33px;
        height: 30px;
        border-radius: 100%;
        background-color: var(--very-dark-desaturated-violet);
        display: grid;
        line-height: 0;
        margin: 0;
        padding: 0;
        place-items: center;
        color: white;
        font-size: clamp(.7rem, 1vw, 1rem);
        cursor: pointer;
}




.background-element-left {
        position: absolute;
        top: 0;
        left: -5%;
        width: 26%;
        height: 85%;
        border-bottom-left-radius: 50% 30%;
        border-bottom-right-radius: 50% 30%;
        background-image: var(--mag-vio-gradient-b);
        z-index: -1;
}
.background-element-right {
        position: absolute;
        bottom: 0;
        right: -5%;
        width: 26%;
        height: 85%;
        border-top-left-radius: 50% 30%;
        border-top-right-radius: 50% 30%;
        background-color: var(--light-grayish-violet);
        z-index: -1;
}

.attribution {
        font-size: 11px;
        text-align: center;
}

.attribution a {
        color: hsl(228, 45%, 44%);
}

@media (max-width: 768px) {
        body {
                padding: 2rem;
        }
        .container {
                grid-template-columns: 1fr;
                gap: 2rem;
        }
        .app {
                max-width: 400px;
                aspect-ratio: 0;
                height: auto;
                align-self: center;
                padding-bottom: 1rem;
        }
        .main-text {
                text-align: center;
                padding: 5%;
        }
        .personProfile {
                gap: 1rem;
                padding-block: .6rem;
        }
        .inputMessage {
                width: 90%;
        }
        .background-element-left {
                display: none;
        }
        .background-element-right {
                display: none;
        }
        .attribution{
                padding-bottom: 5%;
        }
}