* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 500px;
    padding: 30px;
    transition: transform 0.3s ease;
}

.container:hover {
    transform: translateY(-5px);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 25px;
    font-size: 2rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.input-section {
    display: flex;
    margin-bottom: 20px;
    gap: 10px;
}

#todo-input {
    flex: 1;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

#todo-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#add-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 100px;
}

#add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

#add-btn:active {
    transform: translateY(0);
}

.filter-section {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
}

.filter-btn {
    background-color: transparent;
    border: 2px solid transparent;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    flex: 1;
    margin: 0 5px;
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea, #4b85a2);
    color: white;
    border-color: #667eea;
}

.filter-btn:hover:not(.active) {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

#todo-list {
    list-style-type: none;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.todo-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #f8f9fa;
}

.todo-item:hover {
    background-color: #e9ecef;
    transform: translateX(5px);
}

.todo-item.completed {
    background-color: #d4edda;
    text-decoration: line-through;
    color: #155724;
}

.todo-item.completed .todo-text {
    opacity: 0.7;
}

.todo-text {
    flex: 1;
    margin-left: 15px;
    font-size: 16px;
    word-break: break-word;
}

.checkbox {
    width: 22px;
    height: 22px;
    cursor: pointer;
    border-radius: 4px;
    border: 2px solid #667eea;
    appearance: none;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox:checked {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #667eea;
}

.checkbox:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 14px;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.delete-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    opacity: 0;
}

.todo-item:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    background-color: #c82333;
    transform: scale(1.05);
}

.empty-message {
    text-align: center;
    color: #6c757d;
    padding: 40px 20px;
    font-style: italic;
}

.stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

#task-count {
    color: #495057;
    font-weight: 500;
}

#clear-completed {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

#clear-completed:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

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

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-100%);
    }
}

.todo-item.removing {
    animation: slideOut 0.3s ease forwards;
}

#todo-list::-webkit-scrollbar {
    width: 6px;
}

#todo-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#todo-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 3px;
}

#todo-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8, #6a42a0);
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .input-section {
        flex-direction: column;
    }
    
    #add-btn {
        width: 100%;
    }
    
    .filter-section {
        flex-direction: column;
        gap: 5px;
    }
    
    .filter-btn {
        margin: 2px 0;
    }
    
    .stats {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .delete-btn {
        opacity: 1;
    }
}