:root{
    --purple: hsl(246, 80%, 60%);
    --orange: hsl(15, 100%, 70%);
    --blue: hsl(195, 74%, 62%);
    --pink: hsl(348, 100%, 68%);
    --green: hsl(145, 58%, 55%);
    --purple-pink: hsl(264, 64%, 52%);
    --yellow: hsl(43, 84%, 65%);
    --navy: hsl(236, 100%, 87%);
    --grey-purple: hsl(235, 45%, 61%);
    --dark-blue-purple: hsl(235, 46%, 20%);
    --dark-blue: hsl(226, 43%, 10%);
    --hover-bg: hsl(236, 41%, 34%); /*i had to get the color in hex and trasfer it into hs... idk why they didnt give us this color ;-;*/
}

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Rubik;
}

html{
    font-size: 16px;
}

body{
    min-height: 100vh;
    padding: 60px 25px;
    background-color: var(--dark-blue);
    display: flex;
    align-items: center;
    justify-content: center;
}

.container{
    width: fit-content;
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(4, 16rem);
    grid-template-rows: repeat(2, 16rem);
    grid-template-areas: 
    "profile work play study"
    "profile exercise social self-care";
}
.cell{
    overflow: hidden;
    opacity: 0;
    border-radius: 20px;
    -webkit-border-radius: 20px;
    -moz-border-radius: 20px;
    -ms-border-radius: 20px;
    -o-border-radius: 20px;
}
/* cells other than the main one */
.cell:not(.profile){
    background-repeat: no-repeat;
    background-position: calc(100% - 20px) var(--offset), center;
    display: flex;
    transition: 1.8s;
    -webkit-transition: 1.8s;
    -moz-transition: 1.8s;
    -ms-transition: 1.8s;
    -o-transition: 1.8s;
}

.profile{
    background-color: var(--dark-blue-purple);
    grid-area: profile;
    transition: 0.35s;
    -webkit-transition: 0.35s;
    -moz-transition: 0.35s;
    -ms-transition: 0.35s;
    -o-transition: 0.35s;
}
.profile .info{
    width: 100%;
    background-color: var(--purple);
    padding: 35px;
    border-radius: 20px;
    -webkit-border-radius: 20px;
    -moz-border-radius: 20px;
    -ms-border-radius: 20px;
    -o-border-radius: 20px;
}

.profile .info .info-img{
    width: 5rem;
    height: fit-content;
    border: 4px solid white;
    margin: 5px 0;
    border-radius: 50%;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    -ms-border-radius: 50%;
    -o-border-radius: 50%;
}
.profile .info .info-name{
    margin: 30px 0;
    margin-bottom: 60px;
}
p{
    color: var(--navy);
    font-size: 0.9rem;
}
h2{
    font-size: 2.5rem;
    color: white;
    font-weight: 300;
}
.profile .timespan-buttons{
    padding: 35px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
}
.profile .timespan-buttons button{
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--grey-purple);
    transition: 0.4s;
    -webkit-transition: 0.4s;
    -moz-transition: 0.4s;
    -ms-transition: 0.4s;
    -o-transition: 0.4s;
}
.profile .timespan-buttons button:not(.active):hover{   
    color: var(--navy);
}
.cell .content{
    margin-top: 40px;
    background-color: var(--dark-blue-purple);
    width: 100%;
    padding: 30px;
    border-radius: 20px;
    -webkit-border-radius: 20px;
    -moz-border-radius: 20px;
    -ms-border-radius: 20px;
    -o-border-radius: 20px;
    transition: 0.35s;
    -webkit-transition: 0.35s;
    -moz-transition: 0.35s;
    -ms-transition: 0.35s;
    -o-transition: 0.35s;
}
.cell .content:hover{
    background-color: var(--hover-bg);
    cursor: pointer;
}

/* as you can see im a fan of background image*/
.cell .content span{
    font-size: 1.15rem;
    color: white;
    font-weight: 500;
    background-color: transparent;
    background-image: url(images/icon-ellipsis.svg);
    background-repeat: no-repeat;
    background-position: right;
    display: block;
    width: 100%;
}
.cell .content h1{
    color: white;
    font-size: 3.5rem;
    font-weight: 300;
    margin-top: 30px;
    margin-bottom: 10px;
}

/*i saw a vid about how to do socials hover effect and it used this method where you do a non existant var and define it in the element's style so each  one has its color
also i didnt do an img cuz it will add 6 more elements (since we have 6 cards) so i just used the background img for that with the help of chatgpt*/
.work{
    grid-area: work;
    background-image: url(images/icon-work.svg), linear-gradient(to bottom, var(--bg-color) 20%, transparent) ;
}
.exercise{
    grid-area: exercise;
    background-image: url(images/icon-exercise.svg), linear-gradient(to bottom, var(--bg-color) 20%, transparent);
}
.play{
    grid-area: play;
    background-image: url(images/icon-play.svg), linear-gradient(to bottom, var(--bg-color) 20%, transparent);
}
.social{
    grid-area: social;
    background-image: url(images/icon-social.svg), linear-gradient(to bottom, var(--bg-color) 20%, transparent);
}
.study{
    grid-area: study;
    background-image: url(images/icon-study.svg), linear-gradient(to bottom, var(--bg-color) 20%, transparent);
}
.self-care{
    grid-area: self-care;
    background-image: url(images/icon-self-care.svg), linear-gradient(to bottom, var(--bg-color) 20%, transparent);
}

.profile .timespan-buttons .active{
    color: white;
}
.cell.show{
    opacity: 1;
}

/* media queries also yes its desktop first cuz i was too lazy making it mobile first*/
@media screen and (max-width: 1140px){
    .container{
        grid-template-columns: repeat(3, 16rem);
        grid-template-rows: repeat(3, 16rem);
        grid-template-areas: 
        "profile profile profile"
        "work play study"
        "exercise social self-care";
    }
    .profile .info{
        display: flex;
        flex-direction: row;
    }
    .profile .info .info-name{
        margin: 0 20px; 
        margin-right: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    .profile .timespan-buttons{
        flex-direction: row;
        justify-content: center;
        gap: 3.5rem;
    }
    .profile .timespan-buttons button{
        font-size: 1.25rem;
    }
}

@media screen and (max-width: 860px){
    .container{
        grid-template-columns: repeat(2, 16rem);
        grid-template-rows: repeat(4, 16rem);
        grid-template-areas:
        "profile profile"
        "work play"
        "study exercise"
        "social self-care";
    }
}

@media screen and (max-width: 580px){
    .container{
        grid-template-columns: 1fr;
        grid-template-rows: repeat(7, 16rem);
        grid-template-areas:
        "profile"
        "work"
        "play"
        "study"
        "exercise"
        "social"
        "self-care";
    }
    h2{
        font-size: 1.5rem;
    }
    .profile .timespan-buttons{
        gap: clamp(20px, 15%, 80px);
    }
}
