*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body{
    height: 100vh;
    width: 100vw;
    max-width: 1500px;
    margin-inline: auto;
}

main{
    width: 100%;
    height: fit-content;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
}

.page-header{
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 0 1rem;
}

.page-header h1{
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.1rem;
    line-height: 1.2;
}

.page-header p{
    font-size: 1.5rem;
    font-weight: 400;
    color: rgb(99, 98, 98);
}

.tasks_container{
    width: 100%;
    height: fit-content;
    padding: 0 2rem;
    margin-top: 2.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 500px), 1fr));
    gap: 2rem;
}

article{
    background-color: #FFF;
    margin: 10px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    border: 1px solid rgb(0, 0, 0, 0.1);
    border-radius: 14px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    overflow: hidden;
    height: fit-content;
}

.card_header{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.card_top{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.card_header h2{
    flex: 1;
    font-size: 1.5rem;
    letter-spacing: -0.01em;
    font-weight: 600;
}

.card_header input{
    width: 22px;
    height: 22px;
}

input[type="checkbox"]:focus {
    outline: 1px solid black;
}

.card_header .pills{
    font-size: 0.8rem;
    font-weight: 500;
    background-color: #FFF1F2;
    padding: 5px 20px;
    border-radius: 1rem;
    color: #BE123C;
    border: 1px solid #FECDD3;
    display: inline-flex;
    align-items: center;
    font-size: 1rem;
}

article::before{
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
}

article.high::before{
    background: linear-gradient(90deg, #fb7185, #fda4af);
}

article.medium::before{
    background: linear-gradient(90deg, #fbbf24, #f5da80);
}

article.low::before{
    background: linear-gradient(90deg, #34d399, #6ee7b7);
}

article.done::before{
    background: linear-gradient(90deg, #cbd5e1 0%, #e2e8f0 100%);
}

article.medium .pills{
    background-color: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

article.low .pills{
    background-color: #f0fdf4;
    color: #15803d;
    border-color: #bbf7d0;
}

article.done{
    opacity: 0.8;
    background-color: #f8fafc;
}

article.done h2{
    text-decoration: line-through;
    color: #94a3b8;
}

article.done .pills{
    background-color: #f1f5f9;
    color: gray;
    border-color: #e2e8f0;
}

article .card_body{
    margin: 0 2.4rem;
    flex: 1;
}

.task_desc{
    font-size: 1.2rem;
    text-wrap: wrap;
    font-weight: 400;
    color: gray;
    line-height: 1.5;
    margin: 0.2rem 0;
}

.card_time{
    min-height: 30px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    color: gray;
    font-weight: 500;
    margin: 1.22rem 0;
}

.card_time time{
    display: flex;
    height: 100%;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

time.dueDate{
    background-color: #f8fafc;
    padding: 6px 15px;
    border-radius: 8px;
    color: #475569;
}

.card_time .status{
    background-color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 6px 15px;
    color: #475569;
    border: 1px solid #e2e8f0
}

.status select{
    background-color: transparent;
    border: none;
}

.status select:focus{
    outline: 1px solid black;
    outline-offset: 6px;
}

.status.pending{
    background-color: #eff6ff; 
    color: #2563eb;
    border-color: #bfdbfe;   
}

.status.done{
    background-color: #ecfdf5; 
    color: #059669;
    border-color: #a7f3d0;   
}

footer{
    margin: 0 0 0 2.4rem;
    height: fit-content;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

footer ul{
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2rem;
}

ul li{
    background-color: #f8fafc;
    height: 100%;
    padding: 4px 8px;
    border-radius: 8px;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.card_btns{
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.card_btns button{
    background-color: transparent;
    width: 40px;
    height: 40px;
    color: #475569;
    outline: none;
    border: none;
    cursor: pointer;
}

.card_btns button:hover{
    background-color: #d8d9da;
    border-radius: 10px;
    transition: background-color 0.2s ease-in-out;
}

.card_btns button:focus {
    outline: 1px solid black;
    border-radius: 10px;
    background-color: #eff2f5;
}


/* TASK 1 */
.hidden{
    display: none !important;
} 

.edit_form{
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    height: auto;
    max-height: 90vh;
    background-color: white;
    padding: 2rem;
    border-radius: 12px;
    z-index: 1000;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
    gap: 1.5rem;
}

.edit_form div{
    display: flex;
    flex-direction: column;
    align-items: start;
    gap: 0.2rem;
}

.edit_form  label{
    font-size: 16px;
    font-weight: 600;
}

.edit_form input, .edit_form textarea, .edit_form select{
    height: 30px;
    padding: 0 10px;
    border: 1px solid gray;
    border-radius: 4px;
}

textarea{
    height: 50px !important;
}

.edit_form div.form_btns{
    grid-column: span 2;
    flex-direction: row;
    align-items: center;
    padding: 4px 16px 0 0;
    gap: 2rem;
    width: 100%;
    height: 40px;
    margin-top: 20px;
}

div.form_btns button{
    width: 100%;
    height: 100%;
    border: 1px solid gray;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

div.form_btns button.submit{
    background-color: blue;
    color: white;
}

div.form_btns .submit:hover{
    background-color: rgb(35, 35, 248);
    transition: background-color 0.2s ease-in-out;
}

.collapse.close{
    max-height: 40px;
    overflow: hidden;
    transition: max-height 0.3s ease;
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

.collapse.open{
    max-height: 500px;
    mask-image: none;
    transition: max-height 0.5s ease;
}

.expand_btn{
    background: none;
    border: none;
    color: #2563eb;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    margin-bottom: 10px;
}

@media (max-width: 640px){
    .page-header h1{
        font-size: 2.2rem;
    }
    
    .page-header p{
        font-size: 1.1rem;
    }

    .tasks_container{
        padding: 0 0.75rem;
        gap: 1rem;
    }

    article{
        padding: 1.25rem;
    }

    article .card_body{
        margin: 0 0.5rem;
    }

    .card_header{
        flex-direction: column;
        align-items: flex-start;
    }

    .card_header h2{
        font-size: 1.25rem;
    }

    .card_time{
        gap: 0.75rem;
        height: auto;
    }

    footer{
        margin: 1.25rem 0.5rem 0;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 1.25rem;
    }

    .edit_form{
        display: flex;
        flex-direction: column;
    }

    .edit_form input, .edit_form textarea, .edit_form select{
        width: 100%;
    }
}
