@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400;700;900&display=swap');

:root {
    --clr-primary: rgb(54, 112, 190);
    --clr-light: #f4f4f4;
    --clr-dark: #333;
    --clr-warning: rgb(99, 36, 36);
}

* {
    box-sizing: border-box;
    font-family: 'Work Sans', sans-serif;
}

body {
    margin: 0;
    font-weight: 300;
    font-size: 1.5rem;
    background-color: var(--clr-primary);
    color: var(--clr-light);
    display: grid;
    grid: 
        "header header header header" auto
        ".      lists  active      ." auto /
        1fr minmax(100px, 300px) minmax(250px, 500px) 1fr;
}

.title {
    grid-area: header;
    font-weight: 900;
    font-size: calc(7vw + 2rem);
    text-align: center;
    color: rgba(0, 0, 0, 0.1);
    letter-spacing: 2px;
    margin: -1rem 0 3rem;
}

.all-tasks {
    grid-area: lists;
}

.task-list {
    line-height: 1.7;
    font-size: 1.1rem;
    list-style: circle;
    padding-left: 1.5rem;
}

.list-name {
    cursor: pointer;
}

.list-name:hover {
    opacity: 0.7;
}

form {
    display: flex;
}

.btn {
    cursor: pointer;
    background: 0;
    border: 0;
    padding: 0;
    color: inherit;
}

.btn.create {
    font-size: 1.5rem;
    font-weight: 700;
    margin-right: 0.25rem;
    transition: opacity 250ms ease-in;
}

.btn.delete {
    opacity: 0.7;
    font-size: 1rem;
    transition: color 200ms;
}

.btn.delete:hover {
    color: var(--clr-warning);
}

.btn.create:hover {
    opacity: 0.7;
}

.new {
    background-color: transparent;
    border: 0;
    color: inherit;
    border-bottom: 1px solid currentColor;
    font-size: inherit;
    outline: none;
    padding: 0.25rem;
    transition: border-bottom 150ms ease-in;
    order: 2;
}

.new:focus {
    border-bottom-width: 3px;
}

.new::placeholder {
    color: inherit;
    opacity: 0.4;
}

.new:focus::placeholder {
    opacity: 0.15;
}

.new.list {
    font-size: 1.1rem;
}

.new.task {
    margin-bottom: 0;
}

.active-list {
    font-weight: 700;
    letter-spacing: 1px;
}

.todo-list {
    --spacer: 2rem;

    grid-area: active;
    background-color: var(--clr-light);
    color: var(--clr-dark);
}

.todo-header {
    padding: var(--spacer);
    background-color: #e4e4e4;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.todo-body {
    padding: var(--spacer);
    position: relative;
}

.list-title {
    margin: 0;
    margin-right: 1rem;
}

.task-count {
    margin: 0;
    font-size: 1.1rem;
}

.new-task-creator .create {
    color: var(--clr-primary);
}

[type="checkbox"] { /* anything that has checkbox*/
    opacity: 0;
    position: absolute;
}

.task label {
    display: inline-flex;
    align-items: center;
    position: relative;
}

.task {
    position: relative;   
    margin-bottom: 2rem;
}

.task::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -50%;
    background-color: currentColor;
    height: 1px;
    opacity: 0.1;
}

.custom-checkbox {
    --size: 1.25rem;
    display: inline-block;
    width: var(--size);
    height: var(--size);
    margin-right: var(--size);
    cursor: pointer;
    border: 2px solid currentColor;
    border-radius: 50%;
    transform: scale(1);
    transition: transform 300ms ease-in-out;
}

.task:hover .custom-checkbox, 
[type="checkbox"]:focus + label .custom-checkbox { /* + means a label that next to the checkbox. if i tab the scaling will still be responding not just hover*/
    transform: scale(1.2);
    color: var(--clr-primary);
}

[type="checkbox"]:checked + label .custom-checkbox {
    background-color: var(--clr-primary);
    border-color: var(--clr-primary);
    box-shadow: inset 0 0 0 3px white;
}

[type="checkbox"]:checked + label {
    opacity: 0.5;
}

.task label::after {
    content: '';
    position: absolute;
    left: 2.5rem;
    right: 0;
    top: 50%;
    height: 3px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 150ms ease-in-out;
}

[type="checkbox"]:checked + label::after {
    transform: scaleX(1);
    transform-origin: left;
}

.delete-stuff {
    display: flex;
    justify-content: space-evenly;
    position: absolute;
    width: 100%;
    left: 0;
    bottom: -50px;
    color: var(--clr-light);
}

@media only screen and (max-width: 900px) {
    body {
        display: grid;
        grid: 
            "header header header header" auto
            ".      lists  lists      ." auto 
            ".      active  active      ." auto /
            1fr 300px 300px 1fr;
    }
    .all-tasks {
        margin-bottom: 70px;
    }
}

@media only screen and (max-width: 645px) {
    body {
        display: grid;
        grid: 
            "header header header header" auto
            ".      lists  lists      ." auto 
            ".      active  active      ." auto /
            1fr 200px 200px 1fr;
    }
}

@media only screen and (max-width: 450px) {
    body {
        display: grid;
        grid: 
            "header header header header" auto
            ".      lists  lists      ." auto 
            ".      active  active      ." auto/
            1fr 120px 120px 1fr;
    }
    .new.task {
        margin-bottom: 0;
        width: 150px;
    }
}

