@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;700&display=swap');


*{
    padding: 0;
    margin: 0;
}

:root{
    --border-radius: 1rem;

    --soft-red: 10, 79%, 65%;
    --cyan: 186, 34%, 60%;

    --dark-brown: 25, 47%, 15%;
    --medium-brown: 28, 10%, 53%;
    --cream: 27, 66%, 92%;
    --very-pale-orange: 33, 100%, 98%;
}

body{
    display: grid;
    place-items: center;
    min-height: 100svh;
    width: 100vw;
    overflow: hidden;
    font-size: 18px;
    font-family: 'DM Sans', sans-serif;
    background-color: hsl(var(--cream));
}

.component{
    display: flex;
    flex-direction: column;
    gap: 2.5%;
    width: min(95vw, 22.5rem);
    aspect-ratio: 1/1.5;
}

.component h5{
    font-weight: 300;
}

.component>header{
    color: hsl(var(--very-pale-orange));
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    height: 10%;
    padding: 5%;
    background-color: hsl(var(--soft-red));
    border-radius: var(--border-radius);
}

.component>main{
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    gap: 5%;
    width: 90%;
    height: 80%;
    padding: 5%;
    background-color: hsl(var(--very-pale-orange));
    border-radius: var(--border-radius);
}

.component .chart-block{
    width: 100%;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 5%;
}

.component .chart-block .chart{
    margin-top: 10%;
    width: 100%;
    flex-grow: 1;
    display: grid;
    align-items: last baseline;
    gap: 4%;
    grid-template-columns: repeat(7, 1fr);
}

.component .chart-block .chart .chart-bar{
    position: relative;
    border-radius: 0.3rem;
    height: 0%;
    transition: height 1.5s cubic-bezier(.85,.18,.65,.65), filter 0.3s ease-in-out;
    background-color: hsl(var(--soft-red));
    cursor: pointer;
}

.component .chart-block .chart .chart-bar .tooltip{
    position: absolute;
    top: -2.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    padding: 0.5rem;
    border-radius: 0.2rem;
    background-color: hsl(var(--dark-brown));
    color: hsl(var(--very-pale-orange));
    font-size: 0.8rem;
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none;
    z-index: 5;
}

.component .chart-block .chart .chart-bar:hover .tooltip{
    opacity: 1;
    pointer-events: all;
}

.component .chart-block .chart .chart-bar:hover{
    filter: brightness(1.2);
}

.component .chart-block .chart-labels{
    font-size: 0.9rem;
    text-align: center;
    width: 100%;
    text-transform: lowercase;
    display: grid;
    grid-template-columns: repeat(7, 1fr);    
    gap: 4%;
    color: hsla(var(--dark-brown), 0.6);
}

.component footer{
    position: relative;
    height: 20%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.component footer .line{
    position: absolute;
    top: -1px;
    width: 100%;
    height: 2px;
    background-color: hsla(var(--cream), 1);
}

.component footer h5{
    color: hsla(var(--dark-brown), 0.6);
}

.component footer .improvement{
    text-align: right;
}

.component footer .total h3{
    font-size: 1.8rem;
}