body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(to right, #6a11cb 0%, #2575fc 100%);
    /* Gradient background */
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    color: #333;
}

.container {
    background-color: #ffffff;
    padding: 35px;
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    /* Deeper shadow */
    width: 100%;
    max-width: 550px;
    margin-top: 50px;
    animation: fadeIn 0.8s ease-out;
    /* Fade-in effect */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 35px;
    font-size: 2.5em;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

h1 .fas {
    color: #007bff;
    /* Icon color */
}

.input-section {
    display: flex;
    margin-bottom: 25px;
    gap: 10px;
}

#taskInput {
    flex-grow: 1;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1.05em;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

#taskInput:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

#addTaskBtn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 14px 22px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.05em;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

#addTaskBtn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

#addTaskBtn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Shake animation for empty input */
@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
    }
}

#taskInput.shake {
    animation: shake 0.3s ease-in-out;
    border-color: #dc3545;
    /* Red border for shake */
}


.filter-section {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
    gap: 10px;
}

.filter-section button {
    background-color: #f0f0f0;
    color: #555;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 25px;
    /* Pill shape */
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.filter-section button:hover {
    background-color: #e0e0e0;
    color: #333;
}

.filter-section button.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.2);
    transform: translateY(-1px);
}

#taskList {
    list-style: none;
    padding: 0;
    margin: 0;
}

.task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #fefefe;
    padding: 15px 20px;
    margin-bottom: 12px;
    border-radius: 10px;
    border: 1px solid #e9e9e9;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    /* For transition effects */
    animation: taskFadeIn 0.5s ease-out;
    /* Fade-in for individual tasks */
}

@keyframes taskFadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.task-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.task-item.completed {
    background-color: #eaf8e2;
    /* Softer green */
    border-color: #c9e6bb;
    opacity: 0.8;
}

.task-item.completed .task-text {
    text-decoration: line-through;
    color: #888;
    font-style: italic;
}

.task-content {
    display: flex;
    align-items: center;
    flex-grow: 1;
    margin-right: 15px;
    gap: 15px;
}

.task-checkbox {
    min-width: 22px;
    /* Ensure checkbox doesn't shrink */
    min-height: 22px;
    accent-color: #28a745;
    /* Green checkbox */
    cursor: pointer;
    border-radius: 4px;
    /* Slightly rounded checkbox */
}

.task-text {
    font-size: 1.15em;
    color: #333;
    word-break: break-word;
    flex-grow: 1;
    cursor: pointer;
    /* Indicate it's interactive */
}

.task-text.editing {
    outline: 2px solid #007bff;
    border-radius: 5px;
    padding: 2px 5px;
    background-color: #e6f7ff;
    /* Light blue background when editing */
    cursor: text;
}

.task-actions {
    display: flex;
    gap: 8px;
}

.task-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1em;
    /* Slightly smaller icons */
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.task-actions button:hover {
    background-color: rgba(0, 0, 0, 0.08);
}

.task-actions .edit-btn {
    color: #ffc107;
    /* Yellow */
}

.task-actions .edit-btn:hover {
    color: #e0a800;
}

.task-actions .delete-btn {
    color: #dc3545;
    /* Red */
}

.task-actions .delete-btn:hover {
    color: #c82333;
}

.task-summary {
    text-align: center;
    margin-top: 30px;
    font-size: 1.05em;
    color: #666;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
    font-weight: 500;
}

.no-tasks {
    text-align: center;
    font-style: italic;
    color: #777;
    background-color: #f7f7f7;
    justify-content: center;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05);
}

.no-tasks .far,
.no-tasks .fas {
    /* Style icons within no-tasks message */
    margin-right: 8px;
    color: #999;
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        margin-top: 20px;
        padding: 25px;
    }

    h1 {
        font-size: 2em;
        margin-bottom: 25px;
    }

    .input-section {
        flex-direction: column;
        gap: 10px;
    }

    #addTaskBtn {
        width: 100%;
        justify-content: center;
    }

    .filter-section {
        flex-wrap: wrap;
        gap: 8px;
    }

    .filter-section button {
        flex-grow: 1;
        padding: 8px 15px;
        font-size: 0.9em;
    }

    .task-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 15px;
    }

    .task-content {
        width: 100%;
        margin-right: 0;
        gap: 10px;
    }

    .task-actions {
        width: 100%;
        justify-content: flex-end;
        gap: 5px;
    }

    .task-checkbox {
        min-width: 20px;
        min-height: 20px;
    }

    .task-text {
        font-size: 1.05em;
    }
}