@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

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

body{
    font-family: "Poppins", sans-serif;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: white;
    min-height: 100vh;
}

.container{
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.flex{
    width: 100%;
    max-width: 600px;
    background-color: #ffffff;
    color: #111827;
    padding: 35px 30px;
    border-radius: 20px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
}

h1{
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 25px;
}

/* input section */
.input-box{
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
}

#input{
    width: 75%;
    padding: 14px 16px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    outline: none;
    font-size: 1rem;
}

#input:focus{
    border-color: #7c3aed;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15);
}

#addbtn{
    width: 25%;
    padding: 14px;
    background: #7c3aed;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    color: white;
    transition: 0.2s;
}

#addbtn:hover{
    background: #6d28d9;
}

/* list */
#todo-list{
    list-style: none;
}

#todo-list li{
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 0;
    background-color: #f8fafc;
    border: 1px solid #e5e7eb;
    padding: 14px;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

#todo-list li:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    background-color: #f1f5f9;
    transition: 0.2s ease;
}

/* checkbox */
#todo-list input[type="checkbox"]{
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #7c3aed;
}

/* text */
.task-label{
    width: 55%;
    word-break: break-word;
}

/* edit icon */
.edit{
    cursor: pointer;
    transition: 0.2s;
}

.edit:hover{
    transform: scale(1.1);
}

/* delete */
.deletebtn{
    background-color: #ef4444;
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

/* counter */
.counter{
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

#count{
    font-weight: 700;
    color: #7c3aed;
}

#clear{
    padding: 10px 16px;
    background-color: #7c3aed;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    color: white;
}

#clear:hover{
    background-color: #6d28d9;
}

/* edit mode */
[contenteditable="true"]{
    outline: 2px solid #c4b5fd;
    background-color: #ede9fe;
    padding: 4px 8px;
    border-radius: 6px;
}