/* to-do list styling */

body{
    display: grid;
    grid: "...... lists active ......" auto /
            1fr minmax(100px, 300px) minmax(250px, 500px) 1fr; 
    font-size: 1.1rem;  
}

form{
    display: flex;
}

.todo-lists-button{
    display: none;
}

.all-tasks, .todo-list{
    margin-top: 70px;
}

.tasks{
    overflow: auto;
    max-height: 135px;
    padding: 2px;
}

p, h2, label{
    color: white;
}

.todo-body .tasks .task label input[type = "text"]{
    background-color: transparent;
    color: white;
    border: none;
    outline: none;
    border-radius: none;
    font-size: 1em;
    width: 80%;
    cursor: default;
    -webkit-touch-callout: initial; /* iOS Safari */
    -webkit-user-select: initial; /* Safari */
    -khtml-user-select: initial; /* Konqueror HTML */
    -moz-user-select: initial; /* Old versions of Firefox */
    -ms-user-select: initial; /* Internet Explorer/Edge */
    user-select: initial; /* Non-prefixed version, currently
                                  supported by Chrome, Edge, Opera and Firefox */
}

.btn{
    background: 0;
    color: white;
    outline: none;
    border: none;
    cursor: pointer;
    /* font-size: 1rem; */

}

.btn.list, .btn.task{
    font-size: .9rem;
    font-weight: 800;
    margin-right: .25em;
    transition: .5s;
}

.btn:hover{
    opacity: .7;
    
}    

.all-tasks{
    grid-area: lists;
}

.task-list{
    line-height: 1.7;
    font-size: 1rem;
    color: white;
    list-style: circle;
    padding-left: 1.1em;
    margin: 30px 0;
}

.list-name{
    cursor: pointer;
    transition: .5s;
}

.list-name:hover{
    opacity: .7;
}    

.list-name.dragging{
    opacity: 0 !important;
    cursor: pointer !important;
}    

.new{
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(217, 217, 217, 0.5);
    color: white;
    font-size: inherit;
    outline: none;
    order: 2;
    transition: border-bottom 150ms ease-in;
}

.new.list{
    font-size: 1rem;
}

.new::placeholder{
    color: rgba(217, 217, 217, 0.5);
}

.new:focus::placeholder{
    opacity: .6;
}

.new:focus{
    border-bottom: 2px solid white;
}

.active-list{
    font-weight: 600;
    opacity: 1 !important;
}

.todo-list{
    --spacer: 2rem;

    grid-area: active;
    background: rgba(255, 255, 255, .1);
    box-shadow: 0  25px 45px rgba(0,0,0, .1);
    border: 1px solid rgba(255, 255, 255, .5);
    backdrop-filter: blur(25px);
    height: fit-content;
    max-height: 390px;
}


.todo-header{
    padding: var(--spacer);
    background: rgba(255, 255, 255, 0.081);
    backdrop-filter: blur(25px);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.todo-body{
    padding: var(--spacer);
}

.task-count{
    font-size: .9rem;
}

[type="checkbox"]{
    opacity: 0;
    position: absolute;
}

.task label{
    display: flex;
    align-items: center;
    position: relative;
    margin-bottom: 1.4em;
}

.task label::after{
    content: "";
    position: absolute;
    right: 0;
    left: 0;
    bottom: -.5em;
    height: 1px;
    opacity: .4;
    background-color: gray;
}

.custom-checkbox{

    --size: .75em;

    display: inline-block;
    width: var(--size);
    height: var(--size);
    margin-right: var(--size);
    cursor: pointer;
    border: 2px solid rgba(63, 63, 63, .4);
    border-radius: 50%;
    transform: scale(1);
    transition: .3s;
}

.task{
    position: relative;
}

.task:hover .custom-checkbox, [type="checkbox"]:hover + label .custom-checkbox{
    transform: scale(1.08);
    border-color: white;
}    

[type="checkbox"]:checked + label .custom-checkbox{
    background-color: white;
    border: 1px solid white;
    box-shadow: inset 0 0 0 4px rgba(115, 115, 115, 1);
}   

label p:hover{
    cursor: pointer;
}

[type="checkbox"]:checked + label input[type = "text"]{
    opacity: .5;
    text-decoration: line-through;
}

.delete-stuff{
    display: flex;
    justify-content: space-evenly;
    margin: 30px 0;
    /* width: 100%; */
}

/* --- Scrollbar styling --- */

::-webkit-scrollbar {
    width: 7px;
}

::-webkit-scrollbar-track {
    background-color: transparent;
    margin: 10px;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(165, 165, 165, 0.7);
    border-radius: 10px;
}

.all-tasks .fa-xmark{
    display: none;
}

/* media queries for mobile devices */

@media(max-width: 700px) {

    body{ 
        display: block;
    }

    .all-tasks .fa-xmark{
        display: inline-block;
        color: white;
        position: absolute;
        right: 10px;
        top: 10px;
        opacity: .6;
        transition: .5s;
    }

    .all-tasks{
        position: fixed;
        z-index: 2;
        top: 0;
        transform: translateX(120%);
        height: 100%;
        width: calc(100% - 50px);
        background-color: rgba(61, 61, 61, 0.93);
        margin: 0;
        transition: 1s;
    }   

    .todo-list{
        height: fit-content;
        max-height: 80vh;
        width: 80%;
        margin: 120px auto;
    }

    .tasks{
        height: fit-content;
        max-height: 50vh;
    }

    .delete-stuff{
        justify-content: space-between;
    }

    .todo-header{
        padding: 15px;
    }

    .todo-lists-button{
        display: flex;
        /* display: none; */
        opacity: 0;
        align-items: center;
        justify-content: center;
        position: absolute;
        width: 25px; 
        height: 25px;
        border-radius: 15px;
        background-color: rgba(255, 255, 255, 0.4);
        border: 1px solid rgb(211, 211, 211);
        cursor: pointer;
        top: 55px;
        left: 15px;
    }

    .logo{
        width: 80%;
    }
}