*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'segoe ui',sans-serif;
}

body{
    background: linear-gradient(135deg, #4e73df, #1cc88a);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    background: #ffffff;
    width: 100%;
    max-width: 500px;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

header h1{
    text-align: center;
    color: #333333;
    margin-bottom: 20px;
}
#task-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}
#task-input {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    outline: none;
    transition: 0.3s;
}

#task-input:focus {
    border-color: #4e73df;
    box-shadow: 0 0 5px rgba(78, 115, 223, 0.5);
}

.add-task-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    background-color: #4e73df;
    color: white;
    cursor: pointer;
    transition: 0.3s;
    margin-left: 10px;
}
.add-task-btn:hover {
    background-color: #2e59d9;
}

#task-list {
    list-style: none;
}

#task-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    background-color: #f8f9fc;
    transition: 0.2s;
}

#task-list li:hover {
    background-color: #e2e6f5;
}

/* Checkbox */
#task-list input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    border-radius: 50%;
    appearance: none; 
    -webkit-appearance: none;
    border: 2px solid #ccc;
    transition: 0.2s;
}

/* Completed task style */
#task-list input[type="checkbox"]:checked + span {
    text-decoration: line-through;
    color: #888;
}

button {
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.edit-btn {
    background-color: #facc15;
    color: #1f2937;
    margin-left: auto;
}

.edit-btn:hover {
    background-color: #eab308;
}

/* Delete Button */
.delete-btn {
    background-color: #ef4444;
    color: white;
    
}

.delete-btn:hover {
    background-color: #dc2626;
}

#task-counter {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 15px;
    text-align: center;
}

#filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.filter-btn {
    background: #e5e7eb;
    color: #374151;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
}

.filter-btn.active {
    background: #4f46e5;
    color: white;
}


@media (max-width: 480px) {
    .container {
        padding: 20px;
        margin: 15px;
        border-radius: 8px;
    }

    header h1 {
        font-size: 22px;
    }

    #task-form {
        flex-direction: column; /* stack input and button vertically */
    }

    .add-task-btn {
        width: 100%;       
        margin-left: 0;
    }

    #task-list li {
        flex-wrap: wrap;   
        gap: 8px;
    }

    .edit-btn, .delete-btn {
        padding: 6px 10px;
        font-size: 13px;
    }
}

#task-list li {
    animation: fadeIn 0.3s ease;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#search-input {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

#search-btn {
    background-color: #10b981;
    color: white;
}

#search-btn:hover {
    background-color: #059669;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
